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
d90f2a55
Commit
d90f2a55
authored
Aug 18, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Delete registry values via the state machine.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db98cc4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
import.c
programs/reg/import.c
+19
-4
reg.c
programs/reg/tests/reg.c
+8
-8
No files found.
programs/reg/import.c
View file @
d90f2a55
...
...
@@ -69,6 +69,7 @@ enum parser_state
DEFAULT_VALUE_NAME
,
/* parsing a default value name */
QUOTED_VALUE_NAME
,
/* parsing a double-quoted value name */
DATA_START
,
/* preparing for data parsing operations */
DELETE_VALUE
,
/* deleting a registry value */
DATA_TYPE
,
/* parsing the registry data type */
STRING_DATA
,
/* parsing REG_SZ data */
DWORD_DATA
,
/* parsing DWORD data */
...
...
@@ -107,6 +108,7 @@ static WCHAR *key_name_state(struct parser *parser, WCHAR *pos);
static
WCHAR
*
default_value_name_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
static
WCHAR
*
quoted_value_name_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
static
WCHAR
*
data_start_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
static
WCHAR
*
delete_value_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
static
WCHAR
*
data_type_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
static
WCHAR
*
string_data_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
static
WCHAR
*
dword_data_state
(
struct
parser
*
parser
,
WCHAR
*
pos
);
...
...
@@ -125,6 +127,7 @@ static const parser_state_func parser_funcs[NB_PARSER_STATES] =
default_value_name_state
,
/* DEFAULT_VALUE_NAME */
quoted_value_name_state
,
/* QUOTED_VALUE_NAME */
data_start_state
,
/* DATA_START */
delete_value_state
,
/* DELETE_VALUE */
data_type_state
,
/* DATA_TYPE */
string_data_state
,
/* STRING_DATA */
dword_data_state
,
/* DWORD_DATA */
...
...
@@ -642,10 +645,7 @@ static WCHAR *data_start_state(struct parser *parser, WCHAR *pos)
p
[
len
]
=
0
;
if
(
*
p
==
'-'
)
{
FIXME
(
"value deletion not yet implemented
\n
"
);
goto
invalid
;
}
set_state
(
parser
,
DELETE_VALUE
);
else
set_state
(
parser
,
DATA_TYPE
);
return
p
;
...
...
@@ -655,6 +655,21 @@ invalid:
return
p
;
}
/* handler for parser DELETE_VALUE state */
static
WCHAR
*
delete_value_state
(
struct
parser
*
parser
,
WCHAR
*
pos
)
{
WCHAR
*
p
=
pos
+
1
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
*
p
&&
*
p
!=
';'
)
goto
done
;
RegDeleteValueW
(
parser
->
hkey
,
parser
->
value_name
);
done:
set_state
(
parser
,
LINE_START
);
return
p
;
}
/* handler for parser DATA_TYPE state */
static
WCHAR
*
data_type_state
(
struct
parser
*
parser
,
WCHAR
*
pos
)
{
...
...
programs/reg/tests/reg.c
View file @
d90f2a55
...
...
@@ -1758,11 +1758,11 @@ static void test_import(void)
"
\"
Wine46e
\"
=- ;comment
\n
"
"
\"
Wine46f
\"
=- #comment
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46b"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46c"
);
verify_reg_nonexist
(
hkey
,
"Wine46a"
);
verify_reg_nonexist
(
hkey
,
"Wine46b"
);
verify_reg_nonexist
(
hkey
,
"Wine46c"
);
verify_reg
(
hkey
,
"Wine46d"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
0
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46e"
);
verify_reg_nonexist
(
hkey
,
"Wine46e"
);
verify_reg
(
hkey
,
"Wine46f"
,
REG_NONE
,
"V
\0
a
\0
l
\0
u
\0
e
\0\0
"
,
12
,
0
);
/* Test the accepted range of the hex-based data types */
...
...
@@ -3215,11 +3215,11 @@ static void test_unicode_import(void)
"
\"
Wine46e
\"
=- ;comment
\n
"
"
\"
Wine46f
\"
=- #comment
\n\n
"
,
&
r
);
todo_wine
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46a"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46b"
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46c"
);
verify_reg_nonexist
(
hkey
,
"Wine46a"
);
verify_reg_nonexist
(
hkey
,
"Wine46b"
);
verify_reg_nonexist
(
hkey
,
"Wine46c"
);
verify_reg
(
hkey
,
"Wine46d"
,
REG_MULTI_SZ
,
"Line concatenation
\0
"
,
20
,
0
);
todo_wine
verify_reg_nonexist
(
hkey
,
"Wine46e"
);
verify_reg_nonexist
(
hkey
,
"Wine46e"
);
verify_reg
(
hkey
,
"Wine46f"
,
REG_NONE
,
"V
\0
a
\0
l
\0
u
\0
e
\0\0
"
,
12
,
0
);
/* Test the accepted range of the hex-based data types */
...
...
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