Author: hpoussin
Date: Sun Aug 23 10:29:23 2009
New Revision: 42874
URL:
http://svn.reactos.org/svn/reactos?rev=42874&view=rev
Log:
Limit usage of KEY_ALL_ACCESS when opening registry keys
Modified:
trunk/reactos/base/setup/usetup/interface/devinst.c
trunk/reactos/base/setup/usetup/mui.c
trunk/reactos/base/setup/usetup/settings.c
trunk/reactos/dll/win32/shell32/shellpath.c
Modified: trunk/reactos/base/setup/usetup/interface/devinst.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/devinst.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/devinst.c [iso-8859-1] Sun Aug 23 10:29:23
2009
@@ -311,7 +311,7 @@
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);
Modified: trunk/reactos/base/setup/usetup/mui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/mui.c?re…
==============================================================================
--- trunk/reactos/base/setup/usetup/mui.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/mui.c [iso-8859-1] Sun Aug 23 10:29:23 2009
@@ -235,7 +235,7 @@
NULL);
Status = NtCreateKey(&KeyHandle,
- KEY_ALL_ACCESS,
+ KEY_SET_VALUE,
&ObjectAttributes,
0,
NULL,
@@ -326,7 +326,7 @@
NULL);
Status = NtCreateKey(&KeyHandle,
- KEY_ALL_ACCESS,
+ KEY_CREATE_SUB_KEY,
&ObjectAttributes,
0,
NULL,
@@ -358,7 +358,7 @@
NULL);
Status = NtCreateKey(&KeyHandle,
- KEY_ALL_ACCESS,
+ KEY_SET_VALUE,
&ObjectAttributes,
0,
NULL,
@@ -379,7 +379,7 @@
NULL);
Status = NtCreateKey(&SubKeyHandle,
- KEY_ALL_ACCESS,
+ KEY_SET_VALUE,
&ObjectAttributes,
0,
NULL,
Modified: trunk/reactos/base/setup/usetup/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings…
==============================================================================
--- trunk/reactos/base/setup/usetup/settings.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/settings.c [iso-8859-1] Sun Aug 23 10:29:23 2009
@@ -241,7 +241,7 @@
NULL);
Status = NtOpenKey(&BusKey,
- KEY_ALL_ACCESS,
+ KEY_ENUMERATE_SUB_KEYS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
@@ -262,7 +262,7 @@
NULL);
Status = NtOpenKey(&BusInstanceKey,
- KEY_ALL_ACCESS,
+ KEY_ENUMERATE_SUB_KEYS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
@@ -281,7 +281,7 @@
NULL);
Status = NtOpenKey(&ControllerKey,
- KEY_ALL_ACCESS,
+ KEY_ENUMERATE_SUB_KEYS,
&ObjectAttributes);
if (NT_SUCCESS(Status))
{
@@ -300,7 +300,7 @@
NULL);
Status = NtOpenKey(&ControllerInstanceKey,
- KEY_ALL_ACCESS,
+ KEY_QUERY_VALUE,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
@@ -648,7 +648,7 @@
NULL);
Status = NtOpenKey(&KeyHandle,
- KEY_ALL_ACCESS,
+ KEY_SET_VALUE,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
@@ -976,7 +976,7 @@
NULL);
Status = NtOpenKey(&KeyHandle,
- KEY_ALL_ACCESS,
+ KEY_SET_VALUE,
&ObjectAttributes);
if(!NT_SUCCESS(Status))
{
Modified: trunk/reactos/dll/win32/shell32/shellpath.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellpat…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellpath.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellpath.c [iso-8859-1] Sun Aug 23 10:29:23 2009
@@ -947,14 +947,14 @@
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));