https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aae71dcb755e72b7c5f7e…
commit aae71dcb755e72b7c5f7e26604fdf1bea97f1fda
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 20:51:04 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:31 2022 +0200
[WINESYNC] reg: Use wide-char string literals in import.c.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 1fadcf240997f77b4bf31f708893051c94e299b2 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/import.c | 36 +++++++++++----------------------
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 13 insertions(+), 25 deletions(-)
diff --git a/base/applications/cmdutils/reg/import.c
b/base/applications/cmdutils/reg/import.c
index 93d6d46aef9..3ce8fce7394 100644
--- a/base/applications/cmdutils/reg/import.c
+++ b/base/applications/cmdutils/reg/import.c
@@ -245,18 +245,13 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
{
struct data_type { const WCHAR *tag; int len; int type; int parse_type; };
- static const WCHAR quote[] = {'"'};
- static const WCHAR hex[] = {'h','e','x',':'};
- static const WCHAR dword[] =
{'d','w','o','r','d',':'};
- static const WCHAR hexp[] = {'h','e','x','('};
-
static const struct data_type data_types[] = {
- /* tag len type parse type */
- { quote, 1, REG_SZ, REG_SZ },
- { hex, 4, REG_BINARY, REG_BINARY },
- { dword, 6, REG_DWORD, REG_DWORD },
- { hexp, 4, -1, REG_BINARY }, /* REG_NONE, REG_EXPAND_SZ, REG_MULTI_SZ
*/
- { NULL, 0, 0, 0 }
+ /* tag len type parse type */
+ { L"\"", 1, REG_SZ, REG_SZ },
+ { L"hex:", 4, REG_BINARY, REG_BINARY },
+ { L"dword:", 6, REG_DWORD, REG_DWORD },
+ { L"hex(", 4, -1, REG_BINARY }, /* REG_NONE, REG_EXPAND_SZ,
REG_MULTI_SZ */
+ { NULL, 0, 0, 0 }
};
const struct data_type *ptr;
@@ -443,21 +438,17 @@ enum reg_versions {
static enum reg_versions parse_file_header(const WCHAR *s)
{
- static const WCHAR header_31[] =
{'R','E','G','E','D','I','T',0};
- static const WCHAR header_40[] =
{'R','E','G','E','D','I','T','4',0};
- static const WCHAR header_50[] =
{'W','i','n','d','o','w','s','
',
-
'R','e','g','i','s','t','r','y','
','E','d','i','t','o','r','
',
-
'V','e','r','s','i','o','n','
','5','.','0','0',0};
+ static const WCHAR *header_31 = L"REGEDIT";
while (*s == ' ' || *s == '\t') s++;
if (!lstrcmpW(s, header_31))
return REG_VERSION_31;
- if (!lstrcmpW(s, header_40))
+ if (!lstrcmpW(s, L"REGEDIT4"))
return REG_VERSION_40;
- if (!lstrcmpW(s, header_50))
+ if (!lstrcmpW(s, L"Windows Registry Editor Version 5.00"))
return REG_VERSION_50;
/* The Windows version accepts registry file headers beginning with
"REGEDIT" and ending
@@ -511,13 +502,12 @@ static WCHAR *header_state(struct parser *parser, WCHAR *pos)
static WCHAR *parse_win31_line_state(struct parser *parser, WCHAR *pos)
{
WCHAR *line, *value;
- static WCHAR hkcr[] =
{'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T'};
unsigned int key_end = 0;
if (!(line = get_line(parser->file)))
return NULL;
- if (wcsncmp(line, hkcr, ARRAY_SIZE(hkcr)))
+ if (wcsncmp(line, L"HKEY_CLASSES_ROOT", 17)) /*
"HKEY_CLASSES_ROOT" without NUL */
return line;
/* get key name */
@@ -948,8 +938,7 @@ static WCHAR *get_lineW(FILE *fp)
while (next)
{
- static const WCHAR line_endings[] = {'\r','\n',0};
- WCHAR *p = wcspbrk(line, line_endings);
+ WCHAR *p = wcspbrk(line, L"\r\n");
if (!p)
{
size_t len, count;
@@ -986,7 +975,6 @@ int reg_import(int argc, WCHAR *argvW[])
{
WCHAR *filename, *pos;
FILE *fp;
- static const WCHAR rb_mode[] = {'r','b',0};
BYTE s[2];
struct parser parser;
@@ -999,7 +987,7 @@ int reg_import(int argc, WCHAR *argvW[])
filename = argvW[2];
- fp = _wfopen(filename, rb_mode);
+ fp = _wfopen(filename, L"rb");
if (!fp)
{
output_message(STRING_FILE_NOT_FOUND, filename);
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 247a1e9f0d9..7da30342ea8 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: 0c73f95b336ba2ae4b49fa7f652c622ce47038c5
+ wine: 1fadcf240997f77b4bf31f708893051c94e299b2