https://git.reactos.org/?p=reactos.git;a=commitdiff;h=61d4db3fde45889ccd388…
commit 61d4db3fde45889ccd388272f28ab6ef770c1ae6
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 21:17:20 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:35 2022 +0200
[WINESYNC] reg: Fail if access is denied when adding registry data.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id d433d1f122a85b7902b48bae1930eef503a239a5 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/add.c | 12 ++++++++++--
sdk/tools/winesync/reg.cfg | 2 +-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/base/applications/cmdutils/reg/add.c b/base/applications/cmdutils/reg/add.c
index 897c6f60621..258e3e8cb25 100644
--- a/base/applications/cmdutils/reg/add.c
+++ b/base/applications/cmdutils/reg/add.c
@@ -156,6 +156,7 @@ static int run_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL
value_empty,
HKEY hkey;
DWORD data_type, data_size;
BYTE *reg_data = NULL;
+ LONG rc;
if (RegCreateKeyExW(root, path, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ|KEY_WRITE, NULL, &hkey, NULL))
@@ -199,10 +200,17 @@ static int run_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL
value_empty,
return 1;
}
- RegSetValueExW(hkey, value_name, 0, data_type, reg_data, data_size);
- free(reg_data);
+ rc = RegSetValueExW(hkey, value_name, 0, data_type, reg_data, data_size);
+ free(reg_data);
RegCloseKey(hkey);
+
+ if (rc)
+ {
+ output_message(STRING_ACCESS_DENIED);
+ return 1;
+ }
+
output_message(STRING_SUCCESS);
return 0;
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index e1768046759..6fa89b8a5d4 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: a0dc4d7ce37fa8cc515cd4c908245d12fc07cfae
+ wine: d433d1f122a85b7902b48bae1930eef503a239a5