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
49180106
Commit
49180106
authored
Dec 03, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Dec 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Export REG_DWORD values.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b31f1688
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
export.c
programs/reg/export.c
+15
-0
reg.c
programs/reg/tests/reg.c
+2
-2
No files found.
programs/reg/export.c
View file @
49180106
...
...
@@ -118,6 +118,14 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size)
heap_free
(
str
);
}
static
void
export_dword_data
(
WCHAR
**
buf
,
DWORD
*
data
)
{
static
const
WCHAR
fmt
[]
=
{
'd'
,
'w'
,
'o'
,
'r'
,
'd'
,
':'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
*
buf
=
heap_xalloc
(
15
*
sizeof
(
WCHAR
));
sprintfW
(
*
buf
,
fmt
,
*
data
);
}
static
size_t
export_hex_data_type
(
HANDLE
hFile
,
DWORD
type
)
{
static
const
WCHAR
hex
[]
=
{
'h'
,
'e'
,
'x'
,
':'
,
0
};
...
...
@@ -192,6 +200,13 @@ static void export_data(HANDLE hFile, WCHAR *value_name, DWORD value_len,
case
REG_SZ
:
export_string_data
(
&
buf
,
data
,
size
);
break
;
case
REG_DWORD
:
if
(
size
)
{
export_dword_data
(
&
buf
,
data
);
break
;
}
/* fall through */
case
REG_NONE
:
case
REG_EXPAND_SZ
:
case
REG_BINARY
:
...
...
programs/reg/tests/reg.c
View file @
49180106
...
...
@@ -4451,7 +4451,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
simple_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
ok
(
compare_export
(
"file.reg"
,
simple_test
,
0
),
"compare_export() failed
\n
"
);
/* Test registry export with a complex data structure */
add_key
(
hkey
,
"Subkey1"
,
&
subkey
);
...
...
@@ -4573,7 +4573,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
hex_types_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
ok
(
compare_export
(
"file.reg"
,
hex_types_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
}
...
...
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