https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ded0675d6686c4d6127ce…
commit ded0675d6686c4d6127ce8b1f2994e9befde26fc
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Jan 17 18:43:11 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:36 2022 +0200
[WINESYNC] reg: Support recursion in the 'copy' command.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 8d9a228e99e1252a0d82c88e6a64635548c478a6 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/copy.c | 19 +++++++++++++++++++
modules/rostests/winetests/reg/copy.c | 4 ++--
sdk/tools/winesync/reg.cfg | 2 +-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/base/applications/cmdutils/reg/copy.c
b/base/applications/cmdutils/reg/copy.c
index 29ada63da56..34abf8ade18 100644
--- a/base/applications/cmdutils/reg/copy.c
+++ b/base/applications/cmdutils/reg/copy.c
@@ -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);
diff --git a/modules/rostests/winetests/reg/copy.c
b/modules/rostests/winetests/reg/copy.c
index ef4a5f6acb8..70f9496b149 100644
--- a/modules/rostests/winetests/reg/copy.c
+++ b/modules/rostests/winetests/reg/copy.c
@@ -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)
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 3c51e0300bd..351e3803ee8 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: b1ccb87d9debb1a07e35263a76b6e34a7dd6ee49
+ wine: 8d9a228e99e1252a0d82c88e6a64635548c478a6