https://git.reactos.org/?p=reactos.git;a=commitdiff;h=00ef8711f9893b8e2351d…
commit 00ef8711f9893b8e2351db0c248d03be36ef482b
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 21:08:23 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:33 2022 +0200
[WINESYNC] reg/tests: Test key creation and initialization of the Default registry
value.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id e9412a8ae020fe614d96d20f20355d53593048cc by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
modules/rostests/winetests/reg/add.c | 41 ++++++++++++++++++++++++++++++++++++
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/winetests/reg/add.c b/modules/rostests/winetests/reg/add.c
index e62caeade01..36b5f821350 100644
--- a/modules/rostests/winetests/reg/add.c
+++ b/modules/rostests/winetests/reg/add.c
@@ -329,6 +329,46 @@ static void test_add(void)
open_key(HKEY_CURRENT_USER, KEY_BASE, KEY_WRITE, &hkey);
+ /* The Default value is initialized if no parameters are specified */
+ todo_wine verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
+ todo_wine delete_value(hkey, NULL);
+
+ /* This also occurs when specifying a registry type and passing data */
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /d 0x5 /f",
&r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ dword = 0x5;
+ verify_reg(hkey, NULL, REG_DWORD, &dword, sizeof(dword), 0);
+
+ /* The Default value can also be overwritten as an empty string */
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /f", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_reg(hkey, NULL, REG_SZ, "", 1,
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
+
+ close_key(hkey);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE);
+
+ /* Specifying a value name doesn't initialize the Default value in a new key */
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v Test /t REG_SZ /d
\"Just me here\" /f", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+
+ open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey);
+
+ verify_reg(hkey, "Test", REG_SZ, "Just me here", 13, 0);
+ verify_reg_nonexist(hkey, NULL);
+
+ close_key(hkey);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE);
+
+ /* Adding a registry key via WinAPI doesn't initialize the Default value... */
+ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+ verify_reg_nonexist(hkey, NULL);
+
+ /* ... but we can add it without passing [/f] to reg.exe */
+ run_reg_exe("reg add HKCU\\" KEY_BASE, &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ todo_wine verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
+ todo_wine delete_value(hkey, NULL);
+
/* Test whether overwriting a registry key modifies existing keys and values */
add_key(hkey, "Subkey", NULL);
add_value(hkey, "Test1", REG_SZ, "Value1", 7);
@@ -342,6 +382,7 @@ static void test_add(void)
verify_key(hkey, "Subkey");
verify_reg(hkey, "Test1", REG_SZ, "Value1", 7, 0);
verify_reg(hkey, "Test2", REG_DWORD, &dword, sizeof(dword), 0);
+ todo_wine verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
close_key(hkey);
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 2ecf20d8ee2..0ce4b38b11f 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: 559086af62254a1f82c25f4fd4c145d93c60b973
+ wine: e9412a8ae020fe614d96d20f20355d53593048cc