https://git.reactos.org/?p=reactos.git;a=commitdiff;h=129ed8f5fb523ae0cae40…
commit 129ed8f5fb523ae0cae40affd4625697c356c139
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Jan 17 18:47:36 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:37 2022 +0200
[WINESYNC] reg: Support use of registry views when deleting registry keys.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 31f070f7d3e312942d72e774a4a7dbd21b655a31 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/delete.c | 18 +++++++++++-------
modules/rostests/winetests/reg/delete.c | 18 +++++++++---------
sdk/tools/winesync/reg.cfg | 2 +-
3 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/base/applications/cmdutils/reg/delete.c
b/base/applications/cmdutils/reg/delete.c
index f6965493faa..cf0108664fd 100644
--- a/base/applications/cmdutils/reg/delete.c
+++ b/base/applications/cmdutils/reg/delete.c
@@ -59,25 +59,29 @@ static int run_delete(HKEY root, WCHAR *path, REGSAM sam, WCHAR
*key_name, WCHAR
}
}
+ if ((rc = RegOpenKeyExW(root, path, 0, KEY_READ|KEY_SET_VALUE|sam, &hkey)))
+ {
+ output_error(rc);
+ return 1;
+ }
+
/* Delete registry key if no /v* option is given */
if (!value_name && !value_empty && !value_all)
{
- if ((rc = RegDeleteTreeW(root, path)))
+ if ((rc = RegDeleteTreeW(hkey, NULL)))
{
+ RegCloseKey(hkey);
output_error(rc);
return 1;
}
+ RegDeleteKeyW(hkey, L"");
+ RegCloseKey(hkey);
+
output_message(STRING_SUCCESS);
return 0;
}
- if ((rc = RegOpenKeyExW(root, path, 0, KEY_READ|KEY_SET_VALUE|sam, &hkey)))
- {
- output_error(rc);
- return 1;
- }
-
op_delete_key = FALSE;
if (value_all)
diff --git a/modules/rostests/winetests/reg/delete.c
b/modules/rostests/winetests/reg/delete.c
index 102fc0d788a..0c313c12a31 100644
--- a/modules/rostests/winetests/reg/delete.c
+++ b/modules/rostests/winetests/reg/delete.c
@@ -284,19 +284,19 @@ static void test_registry_view_win64(void)
verify_key(hkey, "Subkey", KEY_WOW64_32KEY);
run_reg_exe("reg delete HKLM\\" KEY_BASE "\\Subkey /f /reg:32",
&r);
- todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- todo_wine verify_key_nonexist(hkey, "Subkey", KEY_WOW64_32KEY);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_key_nonexist(hkey, "Subkey", KEY_WOW64_32KEY);
close_key(hkey);
run_reg_exe("reg delete HKLM\\" KEY_BASE " /f /reg:32", &r);
- todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- todo_wine verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
/* Test deletion from the 64-bit registry view (64-bit Windows) */
create_test_key(KEY_WOW64_64KEY);
- todo_wine verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
+ verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY);
open_key(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY, &hkey);
@@ -394,14 +394,14 @@ static void test_registry_view_wow64(void)
verify_key(hkey, "Subkey", KEY_WOW64_64KEY);
run_reg_exe("reg delete HKLM\\" KEY_BASE "\\Subkey /f /reg:64",
&r);
- todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- todo_wine verify_key_nonexist(hkey, "Subkey", KEY_WOW64_64KEY);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_key_nonexist(hkey, "Subkey", KEY_WOW64_64KEY);
close_key(hkey);
run_reg_exe("reg delete HKLM\\" KEY_BASE " /f /reg:64", &r);
- todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- todo_wine verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY);
}
START_TEST(delete)
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index c8796ab5481..7f559185a17 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: 8d42cb9c1ca72e02b8961d6703aaa2e3ddfda5e2
+ wine: 31f070f7d3e312942d72e774a4a7dbd21b655a31