Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8d9a228e
Commit
8d9a228e
authored
May 31, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
May 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Support recursion in the 'copy' command.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1ccb87d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
copy.c
programs/reg/copy.c
+19
-0
copy.c
programs/reg/tests/copy.c
+2
-2
No files found.
programs/reg/copy.c
View file @
8d9a228e
...
...
@@ -90,6 +90,25 @@ static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force)
}
}
for
(
i
=
0
;
recurse
;
i
++
)
{
struct
key
subkey_src
,
subkey_dest
;
name_len
=
max_name_len
;
rc
=
RegEnumKeyExW
(
src
->
hkey
,
i
,
name
,
&
name_len
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
rc
)
break
;
subkey_src
.
root
=
src
->
hkey
;
subkey_src
.
subkey
=
name
;
subkey_dest
.
root
=
dest
->
hkey
;
subkey_dest
.
subkey
=
name
;
rc
=
run_copy
(
&
subkey_src
,
&
subkey_dest
,
TRUE
,
force
);
if
(
rc
)
goto
cleanup
;
}
cleanup:
free
(
name
);
free
(
data
);
...
...
programs/reg/tests/copy.c
View file @
8d9a228e
...
...
@@ -322,7 +322,7 @@ static void test_copy_complex_data(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
complex_data_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
ok
(
compare_export
(
"file.reg"
,
complex_data_test
,
0
),
"compare_export() failed
\n
"
);
}
static
void
test_copy_key_order
(
void
)
...
...
@@ -347,7 +347,7 @@ static void test_copy_key_order(void)
run_reg_exe
(
"reg export HKCU
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
key_order_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
ok
(
compare_export
(
"file.reg"
,
key_order_test
,
0
),
"compare_export() failed
\n
"
);
}
static
void
test_copy_value_order
(
void
)
...
...
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