2003-06-03 22:26:52 +00:00
|
|
|
#undef WIN32_LEAN_AND_MEAN
|
2003-08-24 23:52:29 +00:00
|
|
|
#include <ddk/ntddk.h>
|
|
|
|
#include <ddk/ntddmou.h>
|
2003-08-24 01:12:16 +00:00
|
|
|
#include <win32k/win32k.h>
|
2003-06-03 22:26:52 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <win32k/cursoricon.h>
|
|
|
|
#include <win32k/bitmaps.h>
|
2003-08-24 01:12:16 +00:00
|
|
|
#include <include/winsta.h>
|
|
|
|
#include <include/error.h>
|
2003-08-24 23:52:29 +00:00
|
|
|
#include <include/mouse.h>
|
2003-09-09 20:10:38 +00:00
|
|
|
#include <include/window.h>
|
|
|
|
#include <internal/safe.h>
|
2003-06-03 22:26:52 +00:00
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <win32k/debug1.h>
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
/*
|
2003-10-06 16:25:53 +00:00
|
|
|
* @unimplemented
|
2003-08-23 20:59:08 +00:00
|
|
|
*/
|
2003-06-03 22:26:52 +00:00
|
|
|
DWORD
|
|
|
|
STDCALL
|
|
|
|
NtUserGetIconInfo(
|
|
|
|
HICON hIcon,
|
|
|
|
PBOOL fIcon,
|
|
|
|
PDWORD xHotspot,
|
|
|
|
PDWORD yHotspot,
|
|
|
|
HBITMAP *hbmMask,
|
|
|
|
HBITMAP *hbmColor)
|
|
|
|
{
|
2003-10-06 16:25:53 +00:00
|
|
|
UNIMPLEMENTED
|
2003-06-03 22:26:52 +00:00
|
|
|
|
2003-10-06 16:25:53 +00:00
|
|
|
return FALSE;
|
2003-06-03 22:26:52 +00:00
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
2003-10-06 16:25:53 +00:00
|
|
|
* @unimplemented
|
2003-08-23 20:59:08 +00:00
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserGetIconSize(
|
2003-08-23 20:59:08 +00:00
|
|
|
HICON hIcon,
|
|
|
|
BOOL *fIcon,
|
|
|
|
LONG *Width,
|
|
|
|
LONG *Height)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
2003-10-06 16:25:53 +00:00
|
|
|
UNIMPLEMENTED
|
2003-06-03 22:26:52 +00:00
|
|
|
|
2003-10-06 16:25:53 +00:00
|
|
|
return FALSE;
|
2003-06-03 22:26:52 +00:00
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2003-06-03 22:26:52 +00:00
|
|
|
DWORD
|
|
|
|
STDCALL
|
|
|
|
NtUserGetCursorFrameInfo(
|
|
|
|
DWORD Unknown0,
|
|
|
|
DWORD Unknown1,
|
|
|
|
DWORD Unknown2,
|
|
|
|
DWORD Unknown3)
|
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserGetCursorInfo(
|
2003-08-23 20:59:08 +00:00
|
|
|
PCURSORINFO pci)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
2003-08-24 01:12:16 +00:00
|
|
|
* @implemented
|
2003-08-23 20:59:08 +00:00
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserClipCursor(
|
2003-09-09 20:10:38 +00:00
|
|
|
RECT *UnsafeRect)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
2003-08-24 18:52:18 +00:00
|
|
|
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
|
|
|
|
|
2003-08-24 01:12:16 +00:00
|
|
|
PWINSTATION_OBJECT WinStaObject;
|
2003-08-24 23:52:29 +00:00
|
|
|
PSYSTEM_CURSORINFO CurInfo;
|
2003-09-09 20:10:38 +00:00
|
|
|
RECT Rect;
|
2003-09-21 16:00:24 +00:00
|
|
|
PWINDOW_OBJECT DesktopWindow = NULL;
|
2003-06-03 22:26:52 +00:00
|
|
|
|
2003-08-24 01:12:16 +00:00
|
|
|
NTSTATUS Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
|
|
|
|
KernelMode,
|
|
|
|
0,
|
|
|
|
&WinStaObject);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
2003-09-09 20:10:38 +00:00
|
|
|
DPRINT1("Validation of window station handle (0x%X) failed\n",
|
2003-08-24 01:12:16 +00:00
|
|
|
PROCESS_WINDOW_STATION());
|
|
|
|
SetLastWin32Error(Status);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2003-09-09 20:10:38 +00:00
|
|
|
|
|
|
|
if (NULL != UnsafeRect && ! NT_SUCCESS(MmCopyFromCaller(&Rect, UnsafeRect, sizeof(RECT))))
|
|
|
|
{
|
|
|
|
ObDereferenceObject(WinStaObject);
|
|
|
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2003-08-24 23:52:29 +00:00
|
|
|
|
|
|
|
CurInfo = &WinStaObject->SystemCursor;
|
2003-09-21 16:00:24 +00:00
|
|
|
if(WinStaObject->ActiveDesktop)
|
|
|
|
DesktopWindow = IntGetWindowObject(WinStaObject->ActiveDesktop->DesktopWindow);
|
|
|
|
|
|
|
|
if((Rect.right > Rect.left) && (Rect.bottom > Rect.top)
|
|
|
|
&& DesktopWindow)
|
2003-08-24 01:12:16 +00:00
|
|
|
{
|
2003-09-21 16:00:24 +00:00
|
|
|
CurInfo->CursorClipInfo.IsClipped = TRUE;
|
|
|
|
CurInfo->CursorClipInfo.Left = max(Rect.left, DesktopWindow->WindowRect.left);
|
|
|
|
CurInfo->CursorClipInfo.Top = max(Rect.top, DesktopWindow->WindowRect.top);
|
|
|
|
CurInfo->CursorClipInfo.Right = min(Rect.right - 1, DesktopWindow->WindowRect.right - 1);
|
|
|
|
CurInfo->CursorClipInfo.Bottom = min(Rect.bottom - 1, DesktopWindow->WindowRect.bottom - 1);
|
|
|
|
IntReleaseWindowObject(DesktopWindow);
|
2003-08-24 23:52:29 +00:00
|
|
|
|
2003-09-21 16:00:24 +00:00
|
|
|
MouseMoveCursor(CurInfo->x, CurInfo->y);
|
2003-08-24 01:12:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
WinStaObject->SystemCursor.CursorClipInfo.IsClipped = FALSE;
|
|
|
|
|
|
|
|
ObDereferenceObject(WinStaObject);
|
|
|
|
|
|
|
|
return TRUE;
|
2003-06-03 22:26:52 +00:00
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserDestroyCursor(
|
2003-08-23 20:59:08 +00:00
|
|
|
HCURSOR hCursor,
|
|
|
|
DWORD Unknown)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2003-06-03 22:26:52 +00:00
|
|
|
DWORD
|
|
|
|
STDCALL
|
|
|
|
NtUserFindExistingCursorIcon(
|
|
|
|
DWORD Unknown0,
|
|
|
|
DWORD Unknown1,
|
|
|
|
DWORD Unknown2)
|
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
2003-08-24 01:12:16 +00:00
|
|
|
* @implemented
|
2003-08-23 20:59:08 +00:00
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserGetClipCursor(
|
2003-08-23 20:59:08 +00:00
|
|
|
RECT *lpRect)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
2003-08-24 18:52:18 +00:00
|
|
|
/* FIXME - check if process has WINSTA_READATTRIBUTES */
|
|
|
|
|
2003-08-24 01:12:16 +00:00
|
|
|
PWINSTATION_OBJECT WinStaObject;
|
2003-09-24 21:09:22 +00:00
|
|
|
RECT Rect;
|
|
|
|
NTSTATUS Status;
|
2003-08-24 01:12:16 +00:00
|
|
|
|
|
|
|
if(!lpRect)
|
|
|
|
return FALSE;
|
2003-06-03 22:26:52 +00:00
|
|
|
|
2003-09-24 21:09:22 +00:00
|
|
|
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
|
|
|
|
KernelMode,
|
|
|
|
0,
|
|
|
|
&WinStaObject);
|
2003-08-24 01:12:16 +00:00
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT("Validation of window station handle (0x%X) failed\n",
|
|
|
|
PROCESS_WINDOW_STATION());
|
2003-10-04 22:36:37 +00:00
|
|
|
SetLastNtError(Status);
|
2003-08-24 01:12:16 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(WinStaObject->SystemCursor.CursorClipInfo.IsClipped)
|
|
|
|
{
|
2003-09-24 21:09:22 +00:00
|
|
|
Rect.left = WinStaObject->SystemCursor.CursorClipInfo.Left;
|
|
|
|
Rect.top = WinStaObject->SystemCursor.CursorClipInfo.Top;
|
|
|
|
Rect.right = WinStaObject->SystemCursor.CursorClipInfo.Right;
|
|
|
|
Rect.bottom = WinStaObject->SystemCursor.CursorClipInfo.Bottom;
|
2003-08-24 01:12:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-09-24 21:09:22 +00:00
|
|
|
Rect.left = 0;
|
|
|
|
Rect.top = 0;
|
|
|
|
Rect.right = NtUserGetSystemMetrics(SM_CXSCREEN);
|
|
|
|
Rect.bottom = NtUserGetSystemMetrics(SM_CYSCREEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
Status = MmCopyToCaller((PRECT)lpRect, &Rect, sizeof(RECT));
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
ObDereferenceObject(WinStaObject);
|
|
|
|
SetLastNtError(Status);
|
|
|
|
return FALSE;
|
2003-08-24 01:12:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ObDereferenceObject(WinStaObject);
|
|
|
|
|
|
|
|
return TRUE;
|
2003-06-03 22:26:52 +00:00
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
HCURSOR
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserSetCursor(
|
2003-08-23 20:59:08 +00:00
|
|
|
HCURSOR hCursor)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserSetCursorContents(
|
2003-08-23 20:59:08 +00:00
|
|
|
HCURSOR hCursor,
|
|
|
|
DWORD Unknown)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserSetCursorIconData(
|
2003-08-23 20:59:08 +00:00
|
|
|
HICON hIcon,
|
|
|
|
PBOOL fIcon,
|
|
|
|
PDWORD xHotspot,
|
|
|
|
PDWORD yHotspot)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
|
|
|
UNIMPLEMENTED
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-23 20:59:08 +00:00
|
|
|
|
|
|
|
/*
|
2003-08-29 00:24:42 +00:00
|
|
|
* @implemented
|
2003-08-23 20:59:08 +00:00
|
|
|
*/
|
|
|
|
BOOL
|
2003-06-03 22:26:52 +00:00
|
|
|
STDCALL
|
|
|
|
NtUserSetSystemCursor(
|
2003-08-23 20:59:08 +00:00
|
|
|
HCURSOR hcur,
|
|
|
|
DWORD id)
|
2003-06-03 22:26:52 +00:00
|
|
|
{
|
2003-08-29 00:24:42 +00:00
|
|
|
BOOL res = FALSE;
|
2003-06-03 22:26:52 +00:00
|
|
|
|
2003-08-29 00:24:42 +00:00
|
|
|
return res;
|
2003-06-03 22:26:52 +00:00
|
|
|
}
|