From 731c8ee5076fa8dabec9e0b87ab362e228e043e6 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Sun, 27 Nov 2005 23:15:07 +0000 Subject: [PATCH] fall back to .default values aren't found. ntclose -> zwclose thanks to thomas. svn path=/trunk/; revision=19709 --- reactos/subsys/win32k/ntuser/misc.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/misc.c b/reactos/subsys/win32k/ntuser/misc.c index 4eaff9f4c5c..e2aced2afae 100644 --- a/reactos/subsys/win32k/ntuser/misc.c +++ b/reactos/subsys/win32k/ntuser/misc.c @@ -985,12 +985,23 @@ IntSystemParametersInfo( InitializeObjectAttributes(&KeyAttributes, &Key, OBJ_CASE_INSENSITIVE, CurrentUserKey, NULL); ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes); - NtClose(CurrentUserKey); + ZwClose(CurrentUserKey); /* read the tile value in the registry */ Status = ZwQueryValueKey(KeyHandle, &Tile, KeyValuePartialInformation, 0, 0, &ResLength); + /* fall back to .DEFAULT if we didnt find values */ + if(Status == STATUS_INVALID_HANDLE) + { + RtlInitUnicodeString (&KeyPath,L"\\Registry\\User\\.Default\\Control Panel\\Desktop"); + InitializeObjectAttributes(&KeyAttributes, &KeyPath, OBJ_CASE_INSENSITIVE, + NULL, NULL); + ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes); + ZwQueryValueKey(KeyHandle, &Tile, KeyValuePartialInformation, + 0, 0, &ResLength); + } + ResLength += sizeof(KEY_VALUE_PARTIAL_INFORMATION); KeyValuePartialInfo = ExAllocatePoolWithTag(PagedPool, ResLength, TAG_STRING); Length = ResLength; @@ -1005,7 +1016,7 @@ IntSystemParametersInfo( (PVOID)KeyValuePartialInfo, Length, &ResLength); if(!NT_SUCCESS(Status) || (KeyValuePartialInfo->Type != REG_SZ)) { - NtClose(KeyHandle); + ZwClose(KeyHandle); ExFreePool(KeyValuePartialInfo); return 0; } @@ -1032,7 +1043,7 @@ IntSystemParametersInfo( if(!KeyValuePartialInfo) { - NtClose(KeyHandle); + ZwClose(KeyHandle); return 0; } @@ -1040,7 +1051,7 @@ IntSystemParametersInfo( (PVOID)KeyValuePartialInfo, Length, &ResLength); if(!NT_SUCCESS(Status) || (KeyValuePartialInfo->Type != REG_SZ)) { - NtClose(KeyHandle); + ZwClose(KeyHandle); ExFreePool(KeyValuePartialInfo); return 0; } @@ -1066,7 +1077,7 @@ IntSystemParametersInfo( WinStaObject->WallpaperMode = wmStretch; } - NtClose(KeyHandle); + ZwClose(KeyHandle); break; } case SPI_GETDESKWALLPAPER: