mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
fall back to .default values aren't found. ntclose -> zwclose thanks to thomas.
svn path=/trunk/; revision=19709
This commit is contained in:
parent
b915cad72c
commit
731c8ee507
1 changed files with 16 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue