Added patch to fix setupapi DelReg implementation.

This commit is contained in:
Sebastian Lackner 2016-02-28 03:39:13 +01:00
parent b5dbf4d86c
commit 090ba911dd
3 changed files with 70 additions and 0 deletions

View File

@ -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:

View File

@ -0,0 +1,50 @@
From 60593e8bfdaa748bd006f364a1f134e79066f6a5 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@ -0,0 +1 @@
Fixes: [13548] setupapi DelReg should recursively delete registry keys