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

commit 6d2c3a08bb3c461bf118c94eabca8258fe90d16c
Author:     winesync <[email protected]>
AuthorDate: Sun Jan 16 20:41:28 2022 +0100
Commit:     Thomas Csovcsity <[email protected]>
CommitDate: Sun Jun 19 13:06:30 2022 +0200

    [WINESYNC] reg/tests: Test whether overwriting a registry key modifies 
existing keys and values.
    
    Signed-off-by: Hugh McMaster <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 89251073c7b7a919ca7c3450d53744921ac2979c by Hugh McMaster 
<[email protected]>
---
 modules/rostests/winetests/reg/add.c | 19 ++++++++++++++++++-
 sdk/tools/winesync/reg.cfg           |  2 +-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/modules/rostests/winetests/reg/add.c 
b/modules/rostests/winetests/reg/add.c
index 8b6f234c6d0..f5d473e8887 100644
--- a/modules/rostests/winetests/reg/add.c
+++ b/modules/rostests/winetests/reg/add.c
@@ -210,7 +210,7 @@ void delete_value_(const char *file, unsigned line, const 
HKEY hkey, const char
 
 static void test_add(void)
 {
-    HKEY hkey;
+    HKEY hkey, hsubkey;
     LONG err;
     DWORD r, dword, type, size;
     char buffer[22];
@@ -606,6 +606,7 @@ static void test_add(void)
     verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
 
     close_key(hkey);
+    delete_tree(HKEY_CURRENT_USER, KEY_BASE);
 
     /* Test duplicate switches */
     run_reg_exe("reg add HKCU\\" KEY_BASE " /v Wine /t REG_DWORD /d 0x1 /v 
Test /f", &r);
@@ -642,6 +643,22 @@ static void test_add(void)
     run_reg_exe("reg add HKCU\\" KEY_BASE " /v invalid4 -", &r);
     ok(r == REG_EXIT_FAILURE, "got exit code %u, expected 1\n", r);
 
+    /* Test whether overwriting a registry key modifies existing keys and 
values */
+    add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+    add_key(hkey, "Subkey", &hsubkey);
+    close_key(hsubkey);
+    add_value(hkey, "Test1", REG_SZ, "Value1", 7);
+    dword = 0x123;
+    add_value(hkey, "Test2", REG_DWORD, &dword, sizeof(dword));
+
+    run_reg_exe("reg add HKCU\\" KEY_BASE " /f", &r);
+    ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+    verify_key(HKEY_CURRENT_USER, KEY_BASE);
+    verify_key(hkey, "Subkey");
+    verify_reg(hkey, "Test1", REG_SZ, "Value1", 7, 0);
+    verify_reg(hkey, "Test2", REG_DWORD, &dword, sizeof(dword), 0);
+
     delete_tree(HKEY_CURRENT_USER, KEY_BASE);
 }
 
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index decb94f0a0a..25cc2da3296 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: a87a380a75723e0aa0e257c7efcc3024b56fb49d
+  wine: 89251073c7b7a919ca7c3450d53744921ac2979c

Reply via email to