https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e163213a0f887333079364eafe4635fbc835531a

commit e163213a0f887333079364eafe4635fbc835531a
Author:     winesync <[email protected]>
AuthorDate: Sun Jan 16 14:51:44 2022 +0100
Commit:     Thomas Csovcsity <[email protected]>
CommitDate: Sun Jun 19 13:06:27 2022 +0200

    [WINESYNC] reg/tests: Check for elevated privileges before cleaning up the 
Windows 3.1 test key and running unit tests.
    
    Signed-off-by: Hugh McMaster <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id add814af3eb7368961fe5b37a66c616e4bd97e4b by Hugh McMaster 
<[email protected]>
---
 modules/rostests/winetests/reg/reg.c | 10 +++++-----
 sdk/tools/winesync/reg.cfg           |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/rostests/winetests/reg/reg.c 
b/modules/rostests/winetests/reg/reg.c
index afba8424c1a..4be9e635ed7 100644
--- a/modules/rostests/winetests/reg/reg.c
+++ b/modules/rostests/winetests/reg/reg.c
@@ -4204,14 +4204,11 @@ static void test_import_31(void)
 {
     LONG err;
     HKEY hkey;
-    DWORD r;
-
-    err = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
-    ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA 
failed: %d\n", err);
+    DWORD dispos, r;
 
     /* Check if reg.exe is running with elevated privileges */
     err = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, 
REG_OPTION_NON_VOLATILE,
-                          KEY_READ|KEY_SET_VALUE, NULL, &hkey, NULL);
+                          KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos);
     if (err == ERROR_ACCESS_DENIED)
     {
         win_skip("reg.exe is not running with elevated privileges; "
@@ -4219,6 +4216,9 @@ static void test_import_31(void)
         return;
     }
 
+    if (dispos == REG_OPENED_EXISTING_KEY)
+        delete_value(hkey, NULL);
+
     /* Test simple value */
     test_import_str("REGEDIT\r\n"
                     "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n", &r);
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 3b785ba86af..46149d5af82 100644
--- a/sdk/tools/winesync/reg.cfg
+++ b/sdk/tools/winesync/reg.cfg
@@ -4,4 +4,4 @@ directories:
 files:
   programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
 tags:
-  wine: 6cf0e7fe85ba2f9348cec4d4d555c5dac42033de
+  wine: add814af3eb7368961fe5b37a66c616e4bd97e4b

Reply via email to