Commit 2a8c38ff authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Provide a specific dialog to ControlEvent_SubscribeToEvent, as…

msi: Provide a specific dialog to ControlEvent_SubscribeToEvent, as package->dialog does not always point to the same dialog.
parent 7ee3a4ef
......@@ -295,8 +295,8 @@ extern UINT msi_create_component_directories( MSIPACKAGE *package );
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 );
......
......@@ -602,7 +602,7 @@ static void msi_dialog_map_events(msi_dialog* dialog, LPCWSTR control)
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 );
}
......
......@@ -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 subscriber *sub )
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( MSIPACKAGE *package, LPCWSTR event,
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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment