diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a4fbdbe6..31b68248 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -279,6 +279,7 @@ patch_enable_all () enable_server_Signal_Thread="$1" enable_server_Stored_ACLs="$1" enable_server_Timestamp_Compat="$1" + enable_setupapi_DelReg="$1" enable_setupapi_Display_Device="$1" enable_setupapi_HSPFILEQ_Check_Type="$1" enable_setupapi_SetupDiSetDeviceInstallParamsW="$1" @@ -988,6 +989,9 @@ patch_enable () server-Timestamp_Compat) enable_server_Timestamp_Compat="$2" ;; + setupapi-DelReg) + enable_setupapi_DelReg="$2" + ;; setupapi-Display_Device) enable_setupapi_Display_Device="$2" ;; @@ -5845,6 +5849,21 @@ if test "$enable_server_Timestamp_Compat" -eq 1; then ) >> "$patchlist" fi +# Patchset setupapi-DelReg +# | +# | This patchset fixes the following Wine bugs: +# | * [#13548] setupapi DelReg should recursively delete registry keys +# | +# | Modified files: +# | * dlls/setupapi/install.c, dlls/setupapi/tests/install.c +# | +if test "$enable_setupapi_DelReg" -eq 1; then + patch_apply setupapi-DelReg/0001-setupapi-DelReg-should-recursively-delete-registry-k.patch + ( + echo '+ { "Sebastian Lackner", "setupapi: DelReg should recursively delete registry keys.", 1 },'; + ) >> "$patchlist" +fi + # Patchset setupapi-Display_Device # | # | This patchset fixes the following Wine bugs: diff --git a/patches/setupapi-DelReg/0001-setupapi-DelReg-should-recursively-delete-registry-k.patch b/patches/setupapi-DelReg/0001-setupapi-DelReg-should-recursively-delete-registry-k.patch new file mode 100644 index 00000000..fa071ce2 --- /dev/null +++ b/patches/setupapi-DelReg/0001-setupapi-DelReg-should-recursively-delete-registry-k.patch @@ -0,0 +1,50 @@ +From 60593e8bfdaa748bd006f364a1f134e79066f6a5 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 28 Feb 2016 03:36:07 +0100 +Subject: setupapi: DelReg should recursively delete registry keys. + +--- + dlls/setupapi/install.c | 7 ++++++- + dlls/setupapi/tests/install.c | 1 - + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c +index a8d38aa..2aefc16 100644 +--- a/dlls/setupapi/install.c ++++ b/dlls/setupapi/install.c +@@ -302,6 +302,7 @@ static void delete_multi_sz_value( HKEY hkey, const WCHAR *value, const WCHAR *s + */ + static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context, INT flags ) + { ++ static const WCHAR emptyW[] = {0}; + DWORD type, size; + + if (flags & (FLG_ADDREG_DELREG_BIT | FLG_ADDREG_DELVAL)) /* deletion */ +@@ -320,7 +321,11 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context + } + else RegDeleteValueW( hkey, value ); + } +- else NtDeleteKey( hkey ); ++ else ++ { ++ RegDeleteTreeW( hkey, NULL ); ++ RegDeleteKeyW( hkey, emptyW ); ++ } + return TRUE; + } + +diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c +index d12d683..e09ac8e 100644 +--- a/dlls/setupapi/tests/install.c ++++ b/dlls/setupapi/tests/install.c +@@ -174,7 +174,6 @@ static void test_registry(void) + + /* Check if the registry key is recursively deleted */ + res = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest", &key); +- todo_wine + ok(res == ERROR_FILE_NOT_FOUND, "Didn't expect the registry key to exist\n"); + /* Just in case */ + if (res == ERROR_SUCCESS) +-- +2.7.1 + diff --git a/patches/setupapi-DelReg/definition b/patches/setupapi-DelReg/definition new file mode 100644 index 00000000..86bcaf43 --- /dev/null +++ b/patches/setupapi-DelReg/definition @@ -0,0 +1 @@ +Fixes: [13548] setupapi DelReg should recursively delete registry keys