mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:26:03 +00:00
Don't hardcode user to .DEFAULT when reading registry
svn path=/trunk/; revision=19669
This commit is contained in:
parent
a06e494e71
commit
589f2e1ef1
1 changed files with 19 additions and 6 deletions
|
@ -928,11 +928,14 @@ IntSystemParametersInfo(
|
|||
the current wallpaper bitmap */
|
||||
HBITMAP hOldBitmap, hNewBitmap;
|
||||
ASSERT(pvParam);
|
||||
UNICODE_STRING Key = RTL_CONSTANT_STRING(L"\\Registry\\User\\.Default\\Control Panel\\Desktop");
|
||||
UNICODE_STRING Key = RTL_CONSTANT_STRING(L"Control Panel\\Desktop");
|
||||
UNICODE_STRING Tile = RTL_CONSTANT_STRING(L"TileWallpaper");
|
||||
UNICODE_STRING Style = RTL_CONSTANT_STRING(L"WallpaperStyle");
|
||||
UNICODE_STRING KeyPath;
|
||||
OBJECT_ATTRIBUTES KeyAttributes;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
NTSTATUS Status;
|
||||
HANDLE CurrentUserKey = NULL;
|
||||
HANDLE KeyHandle = NULL;
|
||||
PKEY_VALUE_PARTIAL_INFORMATION KeyValuePartialInfo;
|
||||
ULONG Length = 0;
|
||||
|
@ -970,14 +973,24 @@ IntSystemParametersInfo(
|
|||
/*default value is center */
|
||||
WinStaObject->WallpaperMode = wmCenter;
|
||||
|
||||
/* find the tile value in the registry */
|
||||
InitializeObjectAttributes(&KeyAttributes, &Key, OBJ_CASE_INSENSITIVE,
|
||||
NULL, NULL);
|
||||
ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes);
|
||||
|
||||
|
||||
/* Get a handle to the current users settings */
|
||||
RtlFormatCurrentUserKeyPath(&KeyPath);
|
||||
InitializeObjectAttributes(&ObjectAttributes,&KeyPath,OBJ_CASE_INSENSITIVE,NULL,NULL);
|
||||
ZwOpenKey(&CurrentUserKey, KEY_READ, &ObjectAttributes);
|
||||
RtlFreeUnicodeString(&KeyPath);
|
||||
|
||||
/* open up the settings to read the values */
|
||||
InitializeObjectAttributes(&KeyAttributes, &Key, OBJ_CASE_INSENSITIVE,
|
||||
CurrentUserKey, NULL);
|
||||
ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes);
|
||||
NtClose(CurrentUserKey);
|
||||
|
||||
/* read the tile value in the registry */
|
||||
Status = ZwQueryValueKey(KeyHandle, &Tile, KeyValuePartialInformation,
|
||||
0, 0, &ResLength);
|
||||
|
||||
|
||||
ResLength += sizeof(KEY_VALUE_PARTIAL_INFORMATION);
|
||||
KeyValuePartialInfo = ExAllocatePoolWithTag(PagedPool, ResLength, TAG_STRING);
|
||||
Length = ResLength;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue