Hugh McMaster : setupapi: Recursively remove any subkeys before calling NtDeleteKey().

Alexandre Julliard julliard at winehq.org
Tue Sep 12 15:40:38 CDT 2017


Module: wine
Branch: master
Commit: c9308b8d6b1e2f4dd39b19a6890423cd42fd4620
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c9308b8d6b1e2f4dd39b19a6890423cd42fd4620

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Tue Sep 12 06:08:13 2017 +0000

setupapi: Recursively remove any subkeys before calling NtDeleteKey().

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/install.c       | 6 +++++-
 dlls/setupapi/tests/install.c | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c
index a8d38aa..0593df8 100644
--- a/dlls/setupapi/install.c
+++ b/dlls/setupapi/install.c
@@ -320,7 +320,11 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
             }
             else RegDeleteValueW( hkey, value );
         }
-        else NtDeleteKey( hkey );
+        else
+        {
+            RegDeleteTreeW( hkey, NULL );
+            NtDeleteKey( hkey );
+        }
         return TRUE;
     }
 
diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c
index 558453c..3ca7f26 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)




More information about the wine-cvs mailing list