mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 04:13:32 +00:00
Limit usage of KEY_ALL_ACCESS when opening registry keys
svn path=/trunk/; revision=42874
This commit is contained in:
@@ -311,7 +311,7 @@ EventThread(IN LPVOID lpParameter)
|
||||
hInf = *(HINF *)lpParameter;
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes, &EnumU, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||
Status = NtOpenKey(&hEnum, 0, &ObjectAttributes);
|
||||
Status = NtOpenKey(&hEnum, KEY_QUERY_VALUE, &ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtOpenKey('%wZ') failed with status 0x%08lx\n", &EnumU, Status);
|
||||
|
||||
@@ -235,7 +235,7 @@ AddHotkeySettings(IN LPCWSTR Hotkey, IN LPCWSTR LangHotkey, IN LPCWSTR LayoutHot
|
||||
NULL);
|
||||
|
||||
Status = NtCreateKey(&KeyHandle,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_SET_VALUE,
|
||||
&ObjectAttributes,
|
||||
0,
|
||||
NULL,
|
||||
@@ -326,7 +326,7 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
|
||||
NULL);
|
||||
|
||||
Status = NtCreateKey(&KeyHandle,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_CREATE_SUB_KEY,
|
||||
&ObjectAttributes,
|
||||
0,
|
||||
NULL,
|
||||
@@ -358,7 +358,7 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
|
||||
NULL);
|
||||
|
||||
Status = NtCreateKey(&KeyHandle,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_SET_VALUE,
|
||||
&ObjectAttributes,
|
||||
0,
|
||||
NULL,
|
||||
@@ -379,7 +379,7 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
|
||||
NULL);
|
||||
|
||||
Status = NtCreateKey(&SubKeyHandle,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_SET_VALUE,
|
||||
&ObjectAttributes,
|
||||
0,
|
||||
NULL,
|
||||
|
||||
@@ -241,7 +241,7 @@ GetDisplayIdentifier(PWSTR Identifier,
|
||||
NULL);
|
||||
|
||||
Status = NtOpenKey(&BusKey,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_ENUMERATE_SUB_KEYS,
|
||||
&ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
@@ -262,7 +262,7 @@ GetDisplayIdentifier(PWSTR Identifier,
|
||||
NULL);
|
||||
|
||||
Status = NtOpenKey(&BusInstanceKey,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_ENUMERATE_SUB_KEYS,
|
||||
&ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
@@ -281,7 +281,7 @@ GetDisplayIdentifier(PWSTR Identifier,
|
||||
NULL);
|
||||
|
||||
Status = NtOpenKey(&ControllerKey,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_ENUMERATE_SUB_KEYS,
|
||||
&ObjectAttributes);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
@@ -300,7 +300,7 @@ GetDisplayIdentifier(PWSTR Identifier,
|
||||
NULL);
|
||||
|
||||
Status = NtOpenKey(&ControllerInstanceKey,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_QUERY_VALUE,
|
||||
&ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
@@ -648,7 +648,7 @@ ProcessLocaleRegistry(PGENERIC_LIST List)
|
||||
NULL);
|
||||
|
||||
Status = NtOpenKey(&KeyHandle,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_SET_VALUE,
|
||||
&ObjectAttributes);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
@@ -976,7 +976,7 @@ SetGeoID(PWCHAR Id)
|
||||
NULL);
|
||||
|
||||
Status = NtOpenKey(&KeyHandle,
|
||||
KEY_ALL_ACCESS,
|
||||
KEY_SET_VALUE,
|
||||
&ObjectAttributes);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
||||
@@ -947,14 +947,14 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
|
||||
pShellFolderPath = szSHFolders;
|
||||
}
|
||||
|
||||
if (RegCreateKeyExW(rootKey, pShellFolderPath, 0, NULL, 0, KEY_ALL_ACCESS,
|
||||
if (RegCreateKeyExW(rootKey, pShellFolderPath, 0, NULL, 0, KEY_SET_VALUE,
|
||||
NULL, &shellFolderKey, &dwDisp))
|
||||
{
|
||||
TRACE("Failed to create %s\n", debugstr_w(pShellFolderPath));
|
||||
return E_FAIL;
|
||||
}
|
||||
if (RegCreateKeyExW(rootKey, pUserShellFolderPath, 0, NULL, 0,
|
||||
KEY_ALL_ACCESS, NULL, &userShellFolderKey, &dwDisp))
|
||||
KEY_QUERY_VALUE, NULL, &userShellFolderKey, &dwDisp))
|
||||
{
|
||||
TRACE("Failed to create %s\n",
|
||||
debugstr_w(pUserShellFolderPath));
|
||||
|
||||
Reference in New Issue
Block a user