Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e3234f6e
Commit
e3234f6e
authored
Jun 20, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use a generic data type to correctly process all data types.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8fd6c63b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
18 deletions
+14
-18
regproc.c
programs/regedit/regproc.c
+6
-10
regedit.c
programs/regedit/tests/regedit.c
+8
-8
No files found.
programs/regedit/regproc.c
View file @
e3234f6e
...
...
@@ -160,10 +160,10 @@ struct parser
HKEY
hkey
;
/* current registry key */
WCHAR
*
key_name
;
/* current key name */
WCHAR
*
value_name
;
/* value name */
DWORD
parse_type
;
/* generic data type for parsing */
DWORD
data_type
;
/* data type */
void
*
data
;
/* value data */
DWORD
data_size
;
/* size of the data (in bytes) */
BOOL
hex_type
;
/* parsing a hex data type */
enum
parser_state
state
;
/* current parser state */
};
...
...
@@ -309,6 +309,7 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
if
(
strncmpW
(
ptr
->
tag
,
*
line
,
ptr
->
len
))
continue
;
parser
->
parse_type
=
ptr
->
parse_type
;
parser
->
data_type
=
ptr
->
parse_type
;
*
line
+=
ptr
->
len
;
...
...
@@ -323,7 +324,6 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
return
FALSE
;
parser
->
data_type
=
val
;
parser
->
hex_type
=
TRUE
;
*
line
=
end
+
2
;
}
return
TRUE
;
...
...
@@ -720,7 +720,7 @@ static WCHAR *data_type_state(struct parser *parser, WCHAR *pos)
return
line
;
}
switch
(
parser
->
data
_type
)
switch
(
parser
->
parse
_type
)
{
case
REG_SZ
:
set_state
(
parser
,
STRING_DATA
);
...
...
@@ -728,10 +728,7 @@ static WCHAR *data_type_state(struct parser *parser, WCHAR *pos)
case
REG_DWORD
:
set_state
(
parser
,
DWORD_DATA
);
break
;
case
REG_NONE
:
case
REG_EXPAND_SZ
:
case
REG_BINARY
:
case
REG_MULTI_SZ
:
case
REG_BINARY
:
/* all hex data types, including undefined */
set_state
(
parser
,
HEX_DATA
);
break
;
default:
...
...
@@ -828,11 +825,10 @@ static WCHAR *set_value_state(struct parser *parser, WCHAR *pos)
RegSetValueExW
(
parser
->
hkey
,
parser
->
value_name
,
0
,
parser
->
data_type
,
parser
->
data
,
parser
->
data_size
);
if
(
parser
->
data_type
==
REG_DWORD
||
parser
->
hex_type
)
if
(
parser
->
parse_type
==
REG_DWORD
||
parser
->
parse_type
==
REG_BINARY
)
{
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
parser
->
data
=
NULL
;
parser
->
hex_type
=
FALSE
;
}
if
(
parser
->
reg_version
==
REG_VERSION_31
)
...
...
@@ -1469,10 +1465,10 @@ BOOL import_registry_file(FILE *reg_file)
parser
.
hkey
=
NULL
;
parser
.
key_name
=
NULL
;
parser
.
value_name
=
NULL
;
parser
.
parse_type
=
0
;
parser
.
data_type
=
0
;
parser
.
data
=
NULL
;
parser
.
data_size
=
0
;
parser
.
hex_type
=
FALSE
;
parser
.
state
=
HEADER
;
pos
=
parser
.
two_wchars
;
...
...
programs/regedit/tests/regedit.c
View file @
e3234f6e
...
...
@@ -457,14 +457,14 @@ static void test_basic_import(void)
"
\"
Wine13h
\"
=hex(ffffffff):56,61,6c,75,65,00
\n
"
"
\"
Wine13i
\"
=hex(100000000):56,61,6c,75,65,00
\n\n
"
);
verify_reg
(
hkey
,
"Wine13a"
,
REG_NONE
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13b"
,
0x10
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13c"
,
0x100
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13d"
,
0x1000
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13e"
,
0x7fff
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13f"
,
0xffff
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13g"
,
0x7fffffff
,
"Value"
,
6
,
0
);
todo_wine
verify_reg
(
hkey
,
"Wine13h"
,
0xffffffff
,
"Value"
,
6
,
0
);
verify_reg_nonexist
(
hkey
,
"Wine13i"
);
verify_reg
(
hkey
,
"Wine13b"
,
0x10
,
"Value"
,
6
,
0
);
verify_reg
(
hkey
,
"Wine13c"
,
0x100
,
"Value"
,
6
,
0
);
verify_reg
(
hkey
,
"Wine13d"
,
0x1000
,
"Value"
,
6
,
0
);
verify_reg
(
hkey
,
"Wine13e"
,
0x7fff
,
"Value"
,
6
,
0
);
verify_reg
(
hkey
,
"Wine13f"
,
0xffff
,
"Value"
,
6
,
0
);
verify_reg
(
hkey
,
"Wine13g"
,
0x7fffffff
,
"Value"
,
6
,
0
);
verify_reg
(
hkey
,
"Wine13h"
,
0xffffffff
,
"Value"
,
6
,
0
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine13i"
);
RegCloseKey
(
hkey
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment