From 5b552508ae886f2374e62eb64f2de08b28c259f4 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 3 Mar 2016 14:28:37 +0000 Subject: [PATCH] [MSI] Sync with Wine Staging 1.9.4. CORE-10912 svn path=/trunk/; revision=70891 --- reactos/dll/win32/msi/action.c | 5 ++++- reactos/dll/win32/msi/database.c | 4 ++-- reactos/dll/win32/msi/dialog.c | 24 +++++++++++++++++++++--- reactos/dll/win32/msi/registry.c | 2 +- reactos/dll/win32/msi/sql.y | 2 +- reactos/media/doc/README.WINE | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/reactos/dll/win32/msi/action.c b/reactos/dll/win32/msi/action.c index cedfb7c30f0..b77d40c2f71 100644 --- a/reactos/dll/win32/msi/action.c +++ b/reactos/dll/win32/msi/action.c @@ -2987,7 +2987,11 @@ static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) { *p = 0; if (!p[1]) continue; /* trailing backslash */ +#ifdef __REACTOS__ /* CORE-10587 */ hkey = open_key( comp, root, subkey, FALSE, access | READ_CONTROL ); +#else + hkey = open_key( comp, root, subkey, FALSE, access ); +#endif if (!hkey) break; res = RegDeleteKeyExW( hkey, p + 1, access, 0 ); RegCloseKey( hkey ); @@ -4119,7 +4123,6 @@ static UINT ITERATE_PublishIcon(MSIRECORD *row, LPVOID param) if (rc != ERROR_SUCCESS) { ERR("Failed to get stream\n"); - CloseHandle(the_file); DeleteFileW(FilePath); break; } diff --git a/reactos/dll/win32/msi/database.c b/reactos/dll/win32/msi/database.c index 281dac220bd..f120e318736 100644 --- a/reactos/dll/win32/msi/database.c +++ b/reactos/dll/win32/msi/database.c @@ -972,7 +972,7 @@ static UINT msi_export_stream( LPCWSTR folder, LPCWSTR table, MSIRECORD *row, UI return r; /* if the destination folder does not exist then create it (folder name = table name) */ - snprintfW( stream_filename, sizeof(stream_filename), fmt_folder, folder, table ); + snprintfW( stream_filename, sizeof(stream_filename)/sizeof(WCHAR), fmt_folder, folder, table ); if (GetFileAttributesW( stream_filename ) == INVALID_FILE_ATTRIBUTES) { if (!CreateDirectoryW( stream_filename, NULL )) @@ -980,7 +980,7 @@ static UINT msi_export_stream( LPCWSTR folder, LPCWSTR table, MSIRECORD *row, UI } /* actually create the file */ - snprintfW( stream_filename, sizeof(stream_filename), fmt_file, folder, table, stream_name ); + snprintfW( stream_filename, sizeof(stream_filename)/sizeof(WCHAR), fmt_file, folder, table, stream_name ); file = CreateFileW( stream_filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); if (file == INVALID_HANDLE_VALUE) diff --git a/reactos/dll/win32/msi/dialog.c b/reactos/dll/win32/msi/dialog.c index 77ebc5b6c12..4db0f3f506a 100644 --- a/reactos/dll/win32/msi/dialog.c +++ b/reactos/dll/win32/msi/dialog.c @@ -537,6 +537,17 @@ static void msi_dialog_update_controls( msi_dialog *dialog, LPCWSTR property ) } } +static void msi_dialog_update_all_controls( msi_dialog *dialog ) +{ + msi_control *control; + + LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry ) + { + if ( control->property && control->update ) + control->update( dialog, control ); + } +} + static void msi_dialog_set_property( MSIPACKAGE *package, LPCWSTR property, LPCWSTR value ) { UINT r = msi_set_property( package->db, property, value, -1 ); @@ -674,11 +685,13 @@ static void event_subscribe( msi_dialog *dialog, const WCHAR *event, const WCHAR { struct subscriber *sub; - TRACE("event %s control %s attribute %s\n", debugstr_w(event), debugstr_w(control), debugstr_w(attribute)); + TRACE("dialog %s event %s control %s attribute %s\n", debugstr_w(dialog->name), debugstr_w(event), + debugstr_w(control), debugstr_w(attribute)); LIST_FOR_EACH_ENTRY( sub, &dialog->package->subscriptions, struct subscriber, entry ) { - if (!strcmpiW( sub->event, event ) && + if (sub->dialog == dialog && + !strcmpiW( sub->event, event ) && !strcmpiW( sub->control, control ) && !strcmpiW( sub->attribute, attribute )) { @@ -2210,6 +2223,7 @@ static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec ) control->attributes = MSI_RecordGetInteger( rec, 8 ); prop = MSI_RecordGetString( rec, 9 ); control->property = msi_dialog_dup_property( dialog, prop, FALSE ); + control->update = msi_dialog_update_pathedit; info->dialog = dialog; info->control = control; @@ -4369,7 +4383,11 @@ static UINT event_spawn_dialog( msi_dialog *dialog, const WCHAR *argument ) { /* don't destroy a modeless dialogs that might be our parent */ event_do_dialog( dialog->package, argument, dialog, FALSE ); - if (dialog->package->CurrentInstallState != ERROR_SUCCESS) msi_dialog_end_dialog( dialog ); + if (dialog->package->CurrentInstallState != ERROR_SUCCESS) + msi_dialog_end_dialog( dialog ); + else + msi_dialog_update_all_controls(dialog); + return ERROR_SUCCESS; } diff --git a/reactos/dll/win32/msi/registry.c b/reactos/dll/win32/msi/registry.c index 3bb22cdb909..9d0f93e6d4d 100644 --- a/reactos/dll/win32/msi/registry.c +++ b/reactos/dll/win32/msi/registry.c @@ -1305,7 +1305,7 @@ static UINT fetch_user_component( const WCHAR *usersid, DWORD ctx, DWORD index, REGSAM access = KEY_ENUMERATE_SUB_KEYS | KEY_WOW64_64KEY; HKEY key_users, key_components; - if (ctx == MSIINSTALLCONTEXT_USERMANAGED) /* FIXME: were to find these? */ + if (ctx == MSIINSTALLCONTEXT_USERMANAGED) /* FIXME: where to find these? */ return ERROR_NO_MORE_ITEMS; if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, userdataW, 0, access, &key_users )) diff --git a/reactos/dll/win32/msi/sql.y b/reactos/dll/win32/msi/sql.y index 553cc6dd0b5..366764d5aeb 100644 --- a/reactos/dll/win32/msi/sql.y +++ b/reactos/dll/win32/msi/sql.y @@ -355,7 +355,7 @@ data_type_l: data_type: TK_CHAR { - $$ = MSITYPE_STRING | 1; + $$ = MSITYPE_STRING | 0x400; } | TK_CHAR TK_LP data_count TK_RP { diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index e7517a4842d..9488c04d26b 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -114,7 +114,7 @@ reactos/dll/win32/msg711.acm # Synced to WineStaging-1.7.55 reactos/dll/win32/msgsm32.acm # Synced to WineStaging-1.7.55 reactos/dll/win32/mshtml # Synced to WineStaging-1.7.55 reactos/dll/win32/mshtml.tlb # Synced to WineStaging-1.7.55 -reactos/dll/win32/msi # Synced to WineStaging-1.7.55 +reactos/dll/win32/msi # Synced to WineStaging-1.9.4 reactos/dll/win32/msimg32 # Synced to WineStaging-1.7.55 reactos/dll/win32/msimtf # Synced to WineStaging-1.7.55 reactos/dll/win32/msisip # Synced to WineStaging-1.7.55