msi [6/12]: Provide a specific dialog to
ControlEvent_SubscribeToEvent,
as package->dialog does not always point to the same dialog
James Hawkins
truiken at gmail.com
Tue Oct 3 17:01:23 CDT 2006
Hi,
Changelog:
* Provide a specific dialog to ControlEvent_SubscribeToEvent, as
package->dialog does not always point to the same dialog.
dlls/msi/action.h | 4 ++--
dlls/msi/dialog.c | 2 +-
dlls/msi/events.c | 11 +++++------
3 files changed, 8 insertions(+), 9 deletions(-)
--
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/action.h b/dlls/msi/action.h
index ae7de82..d58bc52 100644
--- a/dlls/msi/action.h
+++ b/dlls/msi/action.h
@@ -295,8 +295,8 @@ extern UINT msi_create_component_directo
extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
MSIRECORD *data);
extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
-extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
- LPCWSTR control, LPCWSTR attribute);
+extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialog,
+ LPCWSTR event, LPCWSTR control, LPCWSTR attribute);
extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
LPCWSTR control, LPCWSTR attribute );
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 7d60791..940939f 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -602,7 +602,7 @@ static void msi_dialog_map_events(msi_di
event = MSI_RecordGetString( row, 3 );
attribute = MSI_RecordGetString( row, 4 );
- ControlEvent_SubscribeToEvent( dialog->package, event, control, attribute );
+ ControlEvent_SubscribeToEvent( dialog->package, dialog, event, control, attribute );
msiobj_release( &row->hdr );
}
diff --git a/dlls/msi/events.c b/dlls/msi/events.c
index e9b7d55..3502e9a 100644
--- a/dlls/msi/events.c
+++ b/dlls/msi/events.c
@@ -48,6 +48,7 @@ struct _events {
struct subscriber {
struct list entry;
+ msi_dialog *dialog;
LPWSTR event;
LPWSTR control;
LPWSTR attribute;
@@ -267,14 +268,15 @@ static void free_subscriber( struct subs
msi_free(sub);
}
-VOID ControlEvent_SubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
- LPCWSTR control, LPCWSTR attribute )
+VOID ControlEvent_SubscribeToEvent( MSIPACKAGE *package, msi_dialog *dialog,
+ LPCWSTR event, LPCWSTR control, LPCWSTR attribute )
{
struct subscriber *sub;
sub = msi_alloc(sizeof (*sub));
if( !sub )
return;
+ sub->dialog = dialog;
sub->event = strdupW(event);
sub->control = strdupW(control);
sub->attribute = strdupW(attribute);
@@ -309,14 +311,11 @@ VOID ControlEvent_FireSubscribedEvent( M
TRACE("Firing Event %s\n",debugstr_w(event));
- if (!package->dialog)
- return;
-
LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
{
if (lstrcmpiW(sub->event, event))
continue;
- msi_dialog_handle_event( package->dialog, sub->control,
+ msi_dialog_handle_event( sub->dialog, sub->control,
sub->attribute, rec );
}
}
--
1.4.2.1
More information about the wine-patches
mailing list