mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
only create handles with access rights needed for the operation
svn path=/trunk/; revision=14983
This commit is contained in:
parent
7a3fb8af07
commit
079656c5c4
1 changed files with 9 additions and 9 deletions
|
@ -407,7 +407,7 @@ CreateNestedKey(PHKEY KeyHandle,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Status = NtCreateKey (&LocalKeyHandle,
|
Status = NtCreateKey (&LocalKeyHandle,
|
||||||
KEY_ALL_ACCESS,
|
KEY_CREATE_SUB_KEY,
|
||||||
&LocalObjectAttributes,
|
&LocalObjectAttributes,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -575,7 +575,7 @@ RegCreateKeyA (HKEY hKey,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
MAXIMUM_ALLOWED,
|
||||||
NULL,
|
NULL,
|
||||||
phkResult,
|
phkResult,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -597,7 +597,7 @@ RegCreateKeyW (HKEY hKey,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
MAXIMUM_ALLOWED,
|
||||||
NULL,
|
NULL,
|
||||||
phkResult,
|
phkResult,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -1653,7 +1653,7 @@ RegOpenKeyA (HKEY hKey,
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RegOpenKeyExA( hKey, lpSubKey, 0, KEY_ALL_ACCESS, phkResult);
|
return RegOpenKeyExA( hKey, lpSubKey, 0, MAXIMUM_ALLOWED, phkResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1678,7 +1678,7 @@ RegOpenKeyW (HKEY hKey,
|
||||||
*phkResult = hKey;
|
*phkResult = hKey;
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
return RegOpenKeyExW(hKey, lpSubKey, 0, KEY_ALL_ACCESS, phkResult);
|
return RegOpenKeyExW(hKey, lpSubKey, 0, MAXIMUM_ALLOWED, phkResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2214,7 +2214,7 @@ RegQueryValueExW (HKEY hKey,
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = NtQueryValueKey (hKey,
|
Status = NtQueryValueKey (KeyHandle,
|
||||||
&ValueName,
|
&ValueName,
|
||||||
KeyValuePartialInformation,
|
KeyValuePartialInformation,
|
||||||
ValueInfo,
|
ValueInfo,
|
||||||
|
@ -2526,7 +2526,7 @@ RegQueryValueW (HKEY hKey,
|
||||||
KeyHandle,
|
KeyHandle,
|
||||||
NULL);
|
NULL);
|
||||||
Status = NtOpenKey (&RealKey,
|
Status = NtOpenKey (&RealKey,
|
||||||
KEY_ALL_ACCESS,
|
KEY_QUERY_VALUE,
|
||||||
&ObjectAttributes);
|
&ObjectAttributes);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -2641,7 +2641,7 @@ RegReplaceKeyW (HKEY hKey,
|
||||||
KeyHandle,
|
KeyHandle,
|
||||||
NULL);
|
NULL);
|
||||||
Status = NtOpenKey (&RealKeyHandle,
|
Status = NtOpenKey (&RealKeyHandle,
|
||||||
KEY_ALL_ACCESS,
|
MAXIMUM_ALLOWED,
|
||||||
&KeyObjectAttributes);
|
&KeyObjectAttributes);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -3205,7 +3205,7 @@ RegSetValueW (HKEY hKey,
|
||||||
KeyHandle,
|
KeyHandle,
|
||||||
NULL);
|
NULL);
|
||||||
Status = NtOpenKey (&RealKey,
|
Status = NtOpenKey (&RealKey,
|
||||||
KEY_ALL_ACCESS,
|
KEY_SET_VALUE,
|
||||||
&ObjectAttributes);
|
&ObjectAttributes);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue