https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b6bc8e137107abe8efa41…
commit b6bc8e137107abe8efa4135b5975332b7579e66e
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 21:06:06 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:32 2022 +0200
[WINESYNC] reg: Allow /reg:32 and /reg:64 switches to be passed via the command line.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=44755
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 2b900e1c38d9bed0901ea036488e896e6df0cbe9 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
manual adjustment needed
---
base/applications/cmdutils/reg/add.c | 2 ++
base/applications/cmdutils/reg/delete.c | 2 ++
base/applications/cmdutils/reg/export.c | 2 ++
base/applications/cmdutils/reg/import.c | 21 +++++++++++++++++----
base/applications/cmdutils/reg/lang/en-US.rc | 4 ++++
base/applications/cmdutils/reg/query.c | 2 ++
base/applications/cmdutils/reg/reg.c | 1 +
base/applications/cmdutils/reg/resource.h | 1 +
sdk/tools/winesync/reg.cfg | 2 +-
9 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/base/applications/cmdutils/reg/add.c b/base/applications/cmdutils/reg/add.c
index 4b50a13b975..de22874b901 100644
--- a/base/applications/cmdutils/reg/add.c
+++ b/base/applications/cmdutils/reg/add.c
@@ -235,6 +235,8 @@ int reg_add(int argc, WCHAR *argvW[])
value_empty = TRUE;
continue;
}
+ else if (!lstrcmpiW(str, L"reg:32") || !lstrcmpiW(str,
L"reg:64"))
+ continue;
else if (!str[0] || str[1])
goto invalid;
diff --git a/base/applications/cmdutils/reg/delete.c
b/base/applications/cmdutils/reg/delete.c
index f1b29e6f3a2..db1ed0f5337 100644
--- a/base/applications/cmdutils/reg/delete.c
+++ b/base/applications/cmdutils/reg/delete.c
@@ -137,6 +137,8 @@ int reg_delete(int argc, WCHAR *argvW[])
value_empty = TRUE;
continue;
}
+ else if (!lstrcmpiW(str, L"reg:32") || !lstrcmpiW(str,
L"reg:64"))
+ continue;
else if (!str[0] || str[1])
goto invalid;
diff --git a/base/applications/cmdutils/reg/export.c
b/base/applications/cmdutils/reg/export.c
index 8abecf1f595..49991c06ee3 100644
--- a/base/applications/cmdutils/reg/export.c
+++ b/base/applications/cmdutils/reg/export.c
@@ -368,6 +368,8 @@ int reg_export(int argc, WCHAR *argvW[])
if (is_char(*str, 'y') && !str[1])
overwrite_file = TRUE;
+ else if (!lstrcmpiW(str, L"reg:32") || !lstrcmpiW(str,
L"reg:64"))
+ continue;
else
goto invalid;
}
diff --git a/base/applications/cmdutils/reg/import.c
b/base/applications/cmdutils/reg/import.c
index 223e7db0e48..5750dbf0c79 100644
--- a/base/applications/cmdutils/reg/import.c
+++ b/base/applications/cmdutils/reg/import.c
@@ -978,11 +978,19 @@ int reg_import(int argc, WCHAR *argvW[])
BYTE s[2];
struct parser parser;
- if (argc > 3)
+ if (argc > 4) goto invalid;
+
+ if (argc == 4)
{
- output_message(STRING_INVALID_SYNTAX);
- output_message(STRING_FUNC_HELP, wcsupr(argvW[1]));
- return 1;
+ WCHAR *str = argvW[3];
+
+ if (*str != '/' && *str != '-')
+ goto invalid;
+
+ str++;
+
+ if (lstrcmpiW(str, L"reg:32") && lstrcmpiW(str,
L"reg:64"))
+ goto invalid;
}
filename = argvW[2];
@@ -1032,4 +1040,9 @@ int reg_import(int argc, WCHAR *argvW[])
error:
fclose(fp);
return 1;
+
+invalid:
+ output_message(STRING_INVALID_SYNTAX);
+ output_message(STRING_FUNC_HELP, wcsupr(argvW[1]));
+ return 1;
}
diff --git a/base/applications/cmdutils/reg/lang/en-US.rc
b/base/applications/cmdutils/reg/lang/en-US.rc
index 3457b10bc12..97064f2522b 100644
--- a/base/applications/cmdutils/reg/lang/en-US.rc
+++ b/base/applications/cmdutils/reg/lang/en-US.rc
@@ -148,4 +148,8 @@ STRINGTABLE
STRING_OVERWRITE_FILE, "The file '%1' already exists. Do you want to
overwrite it?"
STRING_KEY_NONEXIST, "reg: Unable to find the specified registry key\n"
STRING_KEY_IMPORT_FAILED, "reg: Unable to import the registry key
'%1'\n"
+ STRING_REG_VIEW_USAGE, " /reg:32\n\
+\ Access the registry using the 32-bit view.\n\n\
+\ /reg:64\n\
+\ Access the registry using the 64-bit view.\n\n"
}
diff --git a/base/applications/cmdutils/reg/query.c
b/base/applications/cmdutils/reg/query.c
index d2a7968fa0b..9d840c8947d 100644
--- a/base/applications/cmdutils/reg/query.c
+++ b/base/applications/cmdutils/reg/query.c
@@ -347,6 +347,8 @@ int reg_query(int argc, WCHAR *argvW[])
value_empty = TRUE;
continue;
}
+ else if (!lstrcmpiW(str, L"reg:32") || !lstrcmpiW(str,
L"reg:64"))
+ continue;
else if (!str[0] || str[1])
goto invalid;
diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c
index 1230d261d8e..2303df81823 100644
--- a/base/applications/cmdutils/reg/reg.c
+++ b/base/applications/cmdutils/reg/reg.c
@@ -338,6 +338,7 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
if (is_help_switch(argvW[2]))
{
output_message(op_help);
+ output_message(STRING_REG_VIEW_USAGE);
return 0;
}
diff --git a/base/applications/cmdutils/reg/resource.h
b/base/applications/cmdutils/reg/resource.h
index 6768aaf595e..c1698e91c7e 100644
--- a/base/applications/cmdutils/reg/resource.h
+++ b/base/applications/cmdutils/reg/resource.h
@@ -63,3 +63,4 @@
#define STRING_OVERWRITE_FILE 138
#define STRING_KEY_NONEXIST 139
#define STRING_KEY_IMPORT_FAILED 140
+#define STRING_REG_VIEW_USAGE 141
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index af152700ed8..6a3b21ef417 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: 010cb1b4057550b2eb6c371db5ba5a8d11ef337e
+ wine: 2b900e1c38d9bed0901ea036488e896e6df0cbe9