From 7097556bf3d1cd4667a907dc27eb890643710ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 6 Sep 2008 11:45:36 +0000 Subject: [PATCH] Open registry entry with only the required rights Free memory with the right tag See issue #3713 for more details. svn path=/trunk/; revision=35981 --- reactos/subsystems/win32/win32k/objects/dc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index f8b1096e860..b07294b9dfb 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -3410,14 +3410,14 @@ IntChangeDisplaySettings( InitializeObjectAttributes(&ObjectAttributes, &RegistryKey, OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = ZwOpenKey(&DevInstRegKey, GENERIC_READ | GENERIC_WRITE, &ObjectAttributes); + Status = ZwOpenKey(&DevInstRegKey, KEY_SET_VALUE, &ObjectAttributes); if (!NT_SUCCESS(Status)) { DPRINT1("Unable to open registry key %wZ (Status 0x%08lx)\n", &RegistryKey, Status); - ExFreePoolWithTag(RegistryKey.Buffer, TAG_DC); + ExFreePoolWithTag(RegistryKey.Buffer, TAG_RTLREGISTRY); return DISP_CHANGE_FAILED; } - ExFreePoolWithTag(RegistryKey.Buffer, TAG_DC); + ExFreePoolWithTag(RegistryKey.Buffer, TAG_RTLREGISTRY); /* Update needed fields */ if (NT_SUCCESS(Status) && DevMode->dmFields & DM_BITSPERPEL)