From 2a8c38ff74f0ba488934cdb0fd30fce3139ab43e Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Tue, 3 Oct 2006 15:01:23 -0700 Subject: [PATCH] msi: 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(-) diff --git a/dlls/msi/action.h b/dlls/msi/action.h index ae7de8284c4..d58bc52ed6e 100644 --- a/dlls/msi/action.h +++ b/dlls/msi/action.h @@ -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 ); diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 7d607915c68..940939f87c4 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -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 ); } diff --git a/dlls/msi/events.c b/dlls/msi/events.c index e9b7d55bd6e..3502e9a914b 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 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 ); } }