https://git.reactos.org/?p=reactos.git;a=commitdiff;h=252e8fd1c787677f201e3…
commit 252e8fd1c787677f201e32c488335fbacfd50f9a
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 20:10:05 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:29 2022 +0200
[WINESYNC] reg/tests: Try exporting registry values with escaped null characters.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 53fd4df85f004597161a26d86333755e7cbff0ff by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
modules/rostests/winetests/reg/export.c | 25 +++++++++++++++++++++++++
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/winetests/reg/export.c
b/modules/rostests/winetests/reg/export.c
index 32c99e36376..2c7ba88fb59 100644
--- a/modules/rostests/winetests/reg/export.c
+++ b/modules/rostests/winetests/reg/export.c
@@ -168,6 +168,16 @@ static void test_export(void)
"\"\\\\foo\\\\bar\"=\"\"\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE
"\\https://winehq.org]\r\n\r\n";
+ const char *escaped_null_test =
+ "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
+ "[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
+ "\"Wine5a\"=\"\\\\0\"\r\n"
+ "\"Wine5b\"=\"\\\\0\\\\0\"\r\n"
+ "\"Wine5c\"=\"Value1\\\\0\"\r\n"
+ "\"Wine5d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\r\n"
+ "\"Wine5e\"=\"Value3\\\\0Value4\"\r\n"
+ "\"Wine5f\"=\"\\\\0Value5\"\r\n\r\n";
+
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
@@ -402,6 +412,21 @@ static void test_export(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", slashes_test, TODO_REG_COMPARE),
"compare_export() failed\n");
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
+
+ /* Test escaped null characters */
+ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
+ add_value(hkey, "Wine5a", REG_SZ, "\\0", 3);
+ add_value(hkey, "Wine5b", REG_SZ, "\\0\\0", 5);
+ add_value(hkey, "Wine5c", REG_SZ, "Value1\\0", 9);
+ add_value(hkey, "Wine5d", REG_SZ, "Value2\\0\\0\\0\\0", 15);
+ add_value(hkey, "Wine5e", REG_SZ, "Value3\\0Value4", 15);
+ add_value(hkey, "Wine5f", REG_SZ, "\\0Value5", 9);
+ close_key(hkey);
+
+ run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg
/y", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ ok(compare_export("file.reg", escaped_null_test, 0), "compare_export()
failed\n");
+ delete_tree(HKEY_CURRENT_USER, KEY_BASE);
}
START_TEST(export)
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index e3965809336..74acd6bb4d9 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: 1c2b96699973e198e72a01a969af0876387f08e1
+ wine: 53fd4df85f004597161a26d86333755e7cbff0ff