mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 09:43:04 +00:00
[WINESYNC] reg: Fail if access is denied when adding registry data.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d433d1f122a85b7902b48bae1930eef503a239a5 by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
39593a1e16
commit
61d4db3fde
2 changed files with 11 additions and 3 deletions
|
@ -156,6 +156,7 @@ static int run_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty,
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
DWORD data_type, data_size;
|
DWORD data_type, data_size;
|
||||||
BYTE *reg_data = NULL;
|
BYTE *reg_data = NULL;
|
||||||
|
LONG rc;
|
||||||
|
|
||||||
if (RegCreateKeyExW(root, path, 0, NULL, REG_OPTION_NON_VOLATILE,
|
if (RegCreateKeyExW(root, path, 0, NULL, REG_OPTION_NON_VOLATILE,
|
||||||
KEY_READ|KEY_WRITE, NULL, &hkey, NULL))
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegSetValueExW(hkey, value_name, 0, data_type, reg_data, data_size);
|
rc = RegSetValueExW(hkey, value_name, 0, data_type, reg_data, data_size);
|
||||||
free(reg_data);
|
|
||||||
|
|
||||||
|
free(reg_data);
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
|
||||||
|
if (rc)
|
||||||
|
{
|
||||||
|
output_message(STRING_ACCESS_DENIED);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
output_message(STRING_SUCCESS);
|
output_message(STRING_SUCCESS);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -4,4 +4,4 @@ directories:
|
||||||
files:
|
files:
|
||||||
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
||||||
tags:
|
tags:
|
||||||
wine: a0dc4d7ce37fa8cc515cd4c908245d12fc07cfae
|
wine: d433d1f122a85b7902b48bae1930eef503a239a5
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue