#include <w32k.h>
-#define NDEBUG
+//#define NDEBUG
+#undef NDEBUG
#include <debug.h>
/* registered Logon process */
END_CLEANUP;
}
+
/*
* @implemented
*/
DECLARE_RETURN(DWORD);
DPRINT("Enter NtUserCallOneParam\n");
+
+
+ if (Routine == ONEPARAM_ROUTINE_SHOWCURSOR)
+ {
+ PWINSTATION_OBJECT WinSta = PsGetWin32Thread()->Desktop->WindowStation;
+ PSYSTEM_CURSORINFO CurInfo;
+
+ HDC Screen;
+ HBITMAP dcbmp;
+ SURFOBJ *SurfObj;
+ BITMAPOBJ *BitmapObj;
+ GDIDEVICE *ppdev;
+ GDIPOINTER *pgp;
+
+ if(!(Screen = IntGetScreenDC()))
+ {
+ return 1; /* No mouse */
+ }
+
+ PDC dc = DC_LockDc(Screen);
+
+ if (!dc)
+ {
+ return 1; /* No mouse */
+ }
+
+ dcbmp = dc->w.hBitmap;
+ DC_UnlockDc(dc);
+
+ BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
+ if ( !BitmapObj )
+ {
+ BITMAPOBJ_UnlockBitmap(BitmapObj);
+ return 1; /* No Mouse */
+ }
+
+ SurfObj = &BitmapObj->SurfObj;
+ if (SurfObj == NULL)
+ {
+ BITMAPOBJ_UnlockBitmap(BitmapObj);
+ return 1; /* No mouse */
+ }
+
+ ppdev = GDIDEV(SurfObj);
+
+ if(ppdev == NULL)
+ {
+ BITMAPOBJ_UnlockBitmap(BitmapObj);
+ return 1; /* No mouse */
+ }
+
+ pgp = &ppdev->Pointer;
+
+ CurInfo = IntGetSysCursorInfo(WinSta);
+
+ if (Param == FALSE)
+ {
+ if (CurInfo->ShowingCursor != 0)
+ {
+ pgp->ShowPointer = 1;
+ //ppdev->SafetyRemoveCount = 1;
+ //ppdev->SafetyRemoveLevel = 1;
+ EngMovePointer(SurfObj,-1,-1,NULL);
+ CurInfo->ShowingCursor = 0;
+ }
+
+ }
+ else
+ {
+ /* Show Cursor */
+ pgp->ShowPointer = 0;
+ //ppdev->SafetyRemoveCount = 0;
+ //ppdev->SafetyRemoveLevel = 0;
+ EngMovePointer(SurfObj,-1,-1,NULL);
+ CurInfo->ShowingCursor = CURSOR_SHOWING;
+ }
+
+ BITMAPOBJ_UnlockBitmap(BitmapObj);
+ return 0;
+ }
+
+
UserEnterExclusive();
switch(Routine)
- {
+ {
case ONEPARAM_ROUTINE_GETMENU:
{
PWINDOW_OBJECT Window;
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;
(PVOID)KeyValuePartialInfo, Length, &ResLength);
if(!NT_SUCCESS(Status) || (KeyValuePartialInfo->Type != REG_SZ))
{
- NtClose(KeyHandle);
+ ZwClose(KeyHandle);
ExFreePool(KeyValuePartialInfo);
return 0;
}
if(!KeyValuePartialInfo)
{
- NtClose(KeyHandle);
+ ZwClose(KeyHandle);
return 0;
}
(PVOID)KeyValuePartialInfo, Length, &ResLength);
if(!NT_SUCCESS(Status) || (KeyValuePartialInfo->Type != REG_SZ))
{
- NtClose(KeyHandle);
+ ZwClose(KeyHandle);
ExFreePool(KeyValuePartialInfo);
return 0;
}
WinStaObject->WallpaperMode = wmStretch;
}
- NtClose(KeyHandle);
+ ZwClose(KeyHandle);
break;
}
case SPI_GETDESKWALLPAPER: