[PATCH 6/6] msi: Send the dialog created message in dialog_create().

Zebediah Figura z.figura12 at gmail.com
Thu Jul 20 23:43:15 CDT 2017


It should be sent before the message loop, and it should also be sent
for dialogs spawned with control events.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msi/dialog.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index a5b839d..c4a94f1 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -3918,6 +3918,8 @@ static BOOL dialog_register_class( void )
 static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent,
                                   control_event_handler event_handler )
 {
+    static const WCHAR szDialogCreated[] =
+        {'D','i','a','l','o','g',' ','c','r','e','a','t','e','d',0};
     MSIRECORD *rec = NULL;
     msi_dialog *dialog;
 
@@ -3949,6 +3951,13 @@ static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_di
     dialog->control_cancel = strdupW( MSI_RecordGetString( rec, 10 ) );
     msiobj_release( &rec->hdr );
 
+    rec = MSI_CreateRecord(2);
+    if (!rec) return NULL;
+    MSI_RecordSetStringW(rec, 1, name);
+    MSI_RecordSetStringW(rec, 2, szDialogCreated);
+    MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, rec);
+    msiobj_release(&rec->hdr);
+
     return dialog;
 }
 
@@ -4603,17 +4612,6 @@ UINT ACTION_DialogBox( MSIPACKAGE *package, const WCHAR *dialog )
         msi_free( name );
     }
     if (r == ERROR_IO_PENDING) r = ERROR_SUCCESS;
-    if (r == ERROR_SUCCESS)
-    {
-        static const WCHAR szDialogCreated[] =
-            {'D','i','a','l','o','g',' ','c','r','e','a','t','e','d',0};
-        MSIRECORD *row = MSI_CreateRecord(2);
-        if (!row) return ERROR_OUTOFMEMORY;
-        MSI_RecordSetStringW(row, 1, dialog);
-        MSI_RecordSetStringW(row, 2, szDialogCreated);
-        MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, row);
-        msiobj_release(&row->hdr);
-    }
     return r;
 }
 
-- 
2.7.4




More information about the wine-patches mailing list