https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f70f13ee78ce382d0d9c…
commit 9f70f13ee78ce382d0d9c9db869b9c39f9a9b429
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Jan 17 18:47:38 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:38 2022 +0200
[WINESYNC] reg: Support use of registry views in the 'import' command.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 0c71a9879d894e4b82de2909c9c44e36c0bbb35e by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/import.c | 11 ++++++--
modules/rostests/winetests/reg/import.c | 48 ++++++++++++++++-----------------
sdk/tools/winesync/reg.cfg | 2 +-
3 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/base/applications/cmdutils/reg/import.c
b/base/applications/cmdutils/reg/import.c
index 5750dbf0c79..36d148ca395 100644
--- a/base/applications/cmdutils/reg/import.c
+++ b/base/applications/cmdutils/reg/import.c
@@ -83,6 +83,7 @@ struct parser
WCHAR two_wchars[2]; /* first two characters from the encoding check
*/
BOOL is_unicode; /* parsing Unicode or ASCII data */
short int reg_version; /* registry file version */
+ REGSAM sam; /* 32-bit or 64-bit registry view (if set) */
HKEY hkey; /* current registry key */
WCHAR *key_name; /* current key name */
WCHAR *value_name; /* value name */
@@ -373,7 +374,7 @@ static LONG open_key(struct parser *parser, WCHAR *path)
return ERROR_INVALID_PARAMETER;
res = RegCreateKeyExW(key_class, key_path, 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_ALL_ACCESS, NULL, &parser->hkey, NULL);
+ KEY_ALL_ACCESS|parser->sam, NULL, &parser->hkey,
NULL);
if (res == ERROR_SUCCESS)
{
@@ -980,6 +981,8 @@ int reg_import(int argc, WCHAR *argvW[])
if (argc > 4) goto invalid;
+ parser.sam = 0;
+
if (argc == 4)
{
WCHAR *str = argvW[3];
@@ -989,7 +992,11 @@ int reg_import(int argc, WCHAR *argvW[])
str++;
- if (lstrcmpiW(str, L"reg:32") && lstrcmpiW(str,
L"reg:64"))
+ if (!lstrcmpiW(str, L"reg:32"))
+ parser.sam = KEY_WOW64_32KEY;
+ else if (!lstrcmpiW(str, L"reg:64"))
+ parser.sam = KEY_WOW64_64KEY;
+ else
goto invalid;
}
diff --git a/modules/rostests/winetests/reg/import.c
b/modules/rostests/winetests/reg/import.c
index edae8277eb3..976dd381f07 100644
--- a/modules/rostests/winetests/reg/import.c
+++ b/modules/rostests/winetests/reg/import.c
@@ -3728,20 +3728,20 @@ static void test_registry_view_win64(void)
run_reg_exe("reg import reg5.reg /reg:32", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- todo_wine open_key(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY, &hkey);
- todo_wine verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword),
0);
- todo_wine verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11,
0);
- todo_wine verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line
concatenation\0", 20, 0);
- todo_wine verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
- todo_wine verify_reg(hkey, "Wine4", REG_EXPAND_SZ, "%PATH%", 7,
0);
+ open_key(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY, &hkey);
+ verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword), 0);
+ verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11, 0);
+ verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line concatenation\0",
20, 0);
+ verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
+ verify_reg(hkey, "Wine4", REG_EXPAND_SZ, "%PATH%", 7, 0);
- todo_wine open_key(hkey, "subkey", KEY_WOW64_32KEY, &subkey);
- todo_wine verify_reg(subkey, "Empty string", REG_SZ, "", 1, 0);
- todo_wine verify_reg(subkey, NULL, REG_SZ, "Default registry value", 23,
0);
- todo_wine close_key(subkey);
- todo_wine close_key(hkey);
+ open_key(hkey, "subkey", KEY_WOW64_32KEY, &subkey);
+ verify_reg(subkey, "Empty string", REG_SZ, "", 1, 0);
+ verify_reg(subkey, NULL, REG_SZ, "Default registry value", 23, 0);
+ close_key(subkey);
+ close_key(hkey);
- todo_wine verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY);
+ verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY);
delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
@@ -3819,20 +3819,20 @@ static void test_registry_view_wow64(void)
run_reg_exe("reg import reg5.reg /reg:64", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- todo_wine open_key(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY, &hkey);
- todo_wine verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword),
0);
- todo_wine verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11,
0);
- todo_wine verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line
concatenation\0", 20, 0);
- todo_wine verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
- todo_wine verify_reg(hkey, "Wine4", REG_EXPAND_SZ, "%PATH%", 7,
0);
+ open_key(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY, &hkey);
+ verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword), 0);
+ verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11, 0);
+ verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line concatenation\0",
20, 0);
+ verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
+ verify_reg(hkey, "Wine4", REG_EXPAND_SZ, "%PATH%", 7, 0);
- todo_wine open_key(hkey, "subkey", KEY_WOW64_64KEY, &subkey);
- todo_wine verify_reg(subkey, "Empty string", REG_SZ, "", 1, 0);
- todo_wine verify_reg(subkey, NULL, REG_SZ, "Default registry value", 23,
0);
- todo_wine close_key(subkey);
- todo_wine close_key(hkey);
+ open_key(hkey, "subkey", KEY_WOW64_64KEY, &subkey);
+ verify_reg(subkey, "Empty string", REG_SZ, "", 1, 0);
+ verify_reg(subkey, NULL, REG_SZ, "Default registry value", 23, 0);
+ close_key(subkey);
+ close_key(hkey);
- todo_wine verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
+ verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY);
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 23f9a809e0f..9ea9c85f23d 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: f2ce614d85091500c071f9b7234f17d5d6418727
+ wine: 0c71a9879d894e4b82de2909c9c44e36c0bbb35e