mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 05:45:41 +00:00
[win32k]
- Don't store SYSTEM_CURSORINFO inside WINSTATION_OBJECT. Use a global variable instead - Remove IntGetCursorLocation. Use directly gpsi->ptCursor svn path=/trunk/; revision=44655
This commit is contained in:
parent
3fc3ac5c8c
commit
5416a90f26
11 changed files with 95 additions and 305 deletions
|
@ -69,21 +69,20 @@ typedef struct _SYSTEM_CURSORINFO
|
||||||
BOOL ScreenSaverRunning;
|
BOOL ScreenSaverRunning;
|
||||||
} SYSTEM_CURSORINFO, *PSYSTEM_CURSORINFO;
|
} SYSTEM_CURSORINFO, *PSYSTEM_CURSORINFO;
|
||||||
|
|
||||||
HCURSOR FASTCALL IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL ForceChange);
|
BOOL FASTCALL InitCursorImpl();
|
||||||
BOOL FASTCALL IntSetupCurIconHandles(PWINSTATION_OBJECT WinStaObject);
|
PCURICON_OBJECT FASTCALL IntCreateCurIconHandle();
|
||||||
PCURICON_OBJECT FASTCALL IntCreateCurIconHandle(PWINSTATION_OBJECT WinStaObject);
|
|
||||||
VOID FASTCALL IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
|
VOID FASTCALL IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
|
||||||
|
|
||||||
BOOL FASTCALL IntGetCursorLocation(PWINSTATION_OBJECT WinStaObject, POINT *loc);
|
|
||||||
|
|
||||||
BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth,
|
BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth,
|
||||||
INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
|
INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
|
||||||
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon);
|
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon);
|
||||||
|
|
||||||
|
BOOL FASTCALL UserSetCursorPos( INT x, INT y);
|
||||||
|
|
||||||
int APIENTRY UserShowCursor(BOOL bShow);
|
int APIENTRY UserShowCursor(BOOL bShow);
|
||||||
|
|
||||||
#define IntGetSysCursorInfo(WinStaObj) \
|
PSYSTEM_CURSORINFO FASTCALL
|
||||||
(PSYSTEM_CURSORINFO)((WinStaObj)->SystemCursor)
|
IntGetSysCursorInfo();
|
||||||
|
|
||||||
#define IntReleaseCurIconObject(CurIconObj) \
|
#define IntReleaseCurIconObject(CurIconObj) \
|
||||||
UserDereferenceObject(CurIconObj)
|
UserDereferenceObject(CurIconObj)
|
||||||
|
|
|
@ -29,7 +29,6 @@ typedef struct _WINSTATION_OBJECT
|
||||||
LIST_ENTRY DesktopListHead;
|
LIST_ENTRY DesktopListHead;
|
||||||
PRTL_ATOM_TABLE AtomTable;
|
PRTL_ATOM_TABLE AtomTable;
|
||||||
HANDLE SystemMenuTemplate;
|
HANDLE SystemMenuTemplate;
|
||||||
PVOID SystemCursor;
|
|
||||||
UINT CaretBlinkRate;
|
UINT CaretBlinkRate;
|
||||||
HANDLE ShellWindow;
|
HANDLE ShellWindow;
|
||||||
HANDLE ShellListView;
|
HANDLE ShellListView;
|
||||||
|
|
|
@ -44,15 +44,38 @@
|
||||||
static PAGED_LOOKASIDE_LIST gProcessLookasideList;
|
static PAGED_LOOKASIDE_LIST gProcessLookasideList;
|
||||||
static LIST_ENTRY gCurIconList;
|
static LIST_ENTRY gCurIconList;
|
||||||
|
|
||||||
|
SYSTEM_CURSORINFO gSysCursorInfo;
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntGetCursorLocation(PWINSTATION_OBJECT WinSta, POINT *loc)
|
InitCursorImpl()
|
||||||
{
|
{
|
||||||
loc->x = gpsi->ptCursor.x;
|
ExInitializePagedLookasideList(&gProcessLookasideList,
|
||||||
loc->y = gpsi->ptCursor.y;
|
NULL,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
sizeof(CURICON_PROCESS),
|
||||||
|
TAG_DIB,
|
||||||
|
128);
|
||||||
|
InitializeListHead(&gCurIconList);
|
||||||
|
|
||||||
|
gSysCursorInfo.Enabled = FALSE;
|
||||||
|
gSysCursorInfo.ButtonsDown = 0;
|
||||||
|
gSysCursorInfo.CursorClipInfo.IsClipped = FALSE;
|
||||||
|
gSysCursorInfo.LastBtnDown = 0;
|
||||||
|
gSysCursorInfo.CurrentCursorObject = NULL;
|
||||||
|
gSysCursorInfo.ShowingCursor = 0;
|
||||||
|
gSysCursorInfo.ClickLockActive = FALSE;
|
||||||
|
gSysCursorInfo.ClickLockTime = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PSYSTEM_CURSORINFO FASTCALL
|
||||||
|
IntGetSysCursorInfo()
|
||||||
|
{
|
||||||
|
return &gSysCursorInfo;
|
||||||
|
}
|
||||||
|
|
||||||
/* This function creates a reference for the object! */
|
/* This function creates a reference for the object! */
|
||||||
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
|
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
|
||||||
{
|
{
|
||||||
|
@ -78,8 +101,7 @@ PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
|
||||||
|
|
||||||
HCURSOR
|
HCURSOR
|
||||||
FASTCALL
|
FASTCALL
|
||||||
IntSetCursor(
|
UserSetCursor(
|
||||||
PWINSTATION_OBJECT WinSta,
|
|
||||||
PCURICON_OBJECT NewCursor,
|
PCURICON_OBJECT NewCursor,
|
||||||
BOOL ForceChange)
|
BOOL ForceChange)
|
||||||
{
|
{
|
||||||
|
@ -88,8 +110,9 @@ IntSetCursor(
|
||||||
HCURSOR hOldCursor = (HCURSOR)0;
|
HCURSOR hOldCursor = (HCURSOR)0;
|
||||||
HDC hdcScreen;
|
HDC hdcScreen;
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
|
|
||||||
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
|
||||||
OldCursor = CurInfo->CurrentCursorObject;
|
OldCursor = CurInfo->CurrentCursorObject;
|
||||||
if (OldCursor)
|
if (OldCursor)
|
||||||
{
|
{
|
||||||
|
@ -152,22 +175,6 @@ IntSetCursor(
|
||||||
return hOldCursor;
|
return hOldCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL FASTCALL
|
|
||||||
IntSetupCurIconHandles(PWINSTATION_OBJECT WinSta)
|
|
||||||
{
|
|
||||||
ExInitializePagedLookasideList(&gProcessLookasideList,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
sizeof(CURICON_PROCESS),
|
|
||||||
TAG_DIB,
|
|
||||||
128);
|
|
||||||
InitializeListHead(&gCurIconList);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have to register that this object is in use by the current
|
* We have to register that this object is in use by the current
|
||||||
* process. The only way to do that seems to be to walk the list
|
* process. The only way to do that seems to be to walk the list
|
||||||
|
@ -207,7 +214,7 @@ ReferenceCurIconByProcess(PCURICON_OBJECT CurIcon)
|
||||||
}
|
}
|
||||||
|
|
||||||
PCURICON_OBJECT FASTCALL
|
PCURICON_OBJECT FASTCALL
|
||||||
IntFindExistingCurIconObject(PWINSTATION_OBJECT WinSta, HMODULE hModule,
|
IntFindExistingCurIconObject(HMODULE hModule,
|
||||||
HRSRC hRsrc, LONG cx, LONG cy)
|
HRSRC hRsrc, LONG cx, LONG cy)
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
|
@ -241,7 +248,7 @@ IntFindExistingCurIconObject(PWINSTATION_OBJECT WinSta, HMODULE hModule,
|
||||||
}
|
}
|
||||||
|
|
||||||
PCURICON_OBJECT FASTCALL
|
PCURICON_OBJECT FASTCALL
|
||||||
IntCreateCurIconHandle(PWINSTATION_OBJECT WinSta)
|
IntCreateCurIconHandle()
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
HANDLE hCurIcon;
|
HANDLE hCurIcon;
|
||||||
|
@ -271,7 +278,7 @@ IntCreateCurIconHandle(PWINSTATION_OBJECT WinSta)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN FASTCALL
|
BOOLEAN FASTCALL
|
||||||
IntDestroyCurIconObject(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT CurIcon, BOOL ProcessCleanup)
|
IntDestroyCurIconObject(PCURICON_OBJECT CurIcon, BOOL ProcessCleanup)
|
||||||
{
|
{
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
HBITMAP bmpMask, bmpColor;
|
HBITMAP bmpMask, bmpColor;
|
||||||
|
@ -321,12 +328,12 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT CurIcon, BOOL
|
||||||
RemoveEntryList(&CurIcon->ListEntry);
|
RemoveEntryList(&CurIcon->ListEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
if (CurInfo->CurrentCursorObject == CurIcon)
|
if (CurInfo->CurrentCursorObject == CurIcon)
|
||||||
{
|
{
|
||||||
/* Hide the cursor if we're destroying the current cursor */
|
/* Hide the cursor if we're destroying the current cursor */
|
||||||
IntSetCursor(WinSta, NULL, TRUE);
|
UserSetCursor(NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bmpMask = CurIcon->IconInfo.hbmMask;
|
bmpMask = CurIcon->IconInfo.hbmMask;
|
||||||
|
@ -356,16 +363,9 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT CurIcon, BOOL
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
|
IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
|
||||||
{
|
{
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
PCURICON_OBJECT CurIcon, tmp;
|
PCURICON_OBJECT CurIcon, tmp;
|
||||||
PCURICON_PROCESS ProcessData;
|
PCURICON_PROCESS ProcessData;
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LIST_FOR_EACH_SAFE(CurIcon, tmp, &gCurIconList, CURICON_OBJECT, ListEntry)
|
LIST_FOR_EACH_SAFE(CurIcon, tmp, &gCurIconList, CURICON_OBJECT, ListEntry)
|
||||||
{
|
{
|
||||||
UserReferenceObject(CurIcon);
|
UserReferenceObject(CurIcon);
|
||||||
|
@ -376,7 +376,7 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
|
||||||
if (Win32Process == ProcessData->Process)
|
if (Win32Process == ProcessData->Process)
|
||||||
{
|
{
|
||||||
RemoveEntryList(&CurIcon->ListEntry);
|
RemoveEntryList(&CurIcon->ListEntry);
|
||||||
IntDestroyCurIconObject(WinSta, CurIcon, TRUE);
|
IntDestroyCurIconObject(CurIcon, TRUE);
|
||||||
CurIcon = NULL;
|
CurIcon = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +391,6 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -402,7 +401,6 @@ APIENTRY
|
||||||
NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect)
|
NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect)
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
PSURFACE psurfBmp;
|
PSURFACE psurfBmp;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE Ret;
|
HANDLE Ret;
|
||||||
|
@ -411,16 +409,9 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect)
|
||||||
DPRINT("Enter NtUserCreateCursorIconHandle\n");
|
DPRINT("Enter NtUserCreateCursorIconHandle\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
if (!(CurIcon = IntCreateCurIconHandle()))
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN((HANDLE)0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(CurIcon = IntCreateCurIconHandle(WinSta)))
|
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN((HANDLE)0);
|
RETURN((HANDLE)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,7 +464,6 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect)
|
||||||
}
|
}
|
||||||
|
|
||||||
UserDereferenceObject(CurIcon);
|
UserDereferenceObject(CurIcon);
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -643,7 +633,6 @@ NtUserGetCursorInfo(
|
||||||
{
|
{
|
||||||
CURSORINFO SafeCi;
|
CURSORINFO SafeCi;
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
@ -652,20 +641,14 @@ NtUserGetCursorInfo(
|
||||||
DPRINT("Enter NtUserGetCursorInfo\n");
|
DPRINT("Enter NtUserGetCursorInfo\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
CurInfo = IntGetSysCursorInfo();
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
|
||||||
CurIcon = (PCURICON_OBJECT)CurInfo->CurrentCursorObject;
|
CurIcon = (PCURICON_OBJECT)CurInfo->CurrentCursorObject;
|
||||||
|
|
||||||
SafeCi.cbSize = sizeof(CURSORINFO);
|
SafeCi.cbSize = sizeof(CURSORINFO);
|
||||||
SafeCi.flags = ((CurInfo->ShowingCursor && CurIcon) ? CURSOR_SHOWING : 0);
|
SafeCi.flags = ((CurInfo->ShowingCursor && CurIcon) ? CURSOR_SHOWING : 0);
|
||||||
SafeCi.hCursor = (CurIcon ? (HCURSOR)CurIcon->Self : (HCURSOR)0);
|
SafeCi.hCursor = (CurIcon ? (HCURSOR)CurIcon->Self : (HCURSOR)0);
|
||||||
|
|
||||||
IntGetCursorLocation(WinSta, &SafeCi.ptScreenPos);
|
SafeCi.ptScreenPos = gpsi->ptCursor;
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
@ -690,7 +673,6 @@ NtUserGetCursorInfo(
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -709,35 +691,23 @@ NtUserClipCursor(
|
||||||
RECTL *UnsafeRect)
|
RECTL *UnsafeRect)
|
||||||
{
|
{
|
||||||
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
|
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
|
||||||
|
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
RECTL Rect;
|
RECTL Rect;
|
||||||
PWINDOW_OBJECT DesktopWindow = NULL;
|
PWINDOW_OBJECT DesktopWindow = NULL;
|
||||||
POINT MousePos = {0};
|
|
||||||
DECLARE_RETURN(BOOL);
|
DECLARE_RETURN(BOOL);
|
||||||
|
|
||||||
DPRINT("Enter NtUserClipCursor\n");
|
DPRINT("Enter NtUserClipCursor\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NULL != UnsafeRect && ! NT_SUCCESS(MmCopyFromCaller(&Rect, UnsafeRect, sizeof(RECT))))
|
if (NULL != UnsafeRect && ! NT_SUCCESS(MmCopyFromCaller(&Rect, UnsafeRect, sizeof(RECT))))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
CurInfo = IntGetSysCursorInfo();
|
||||||
IntGetCursorLocation(WinSta, &MousePos);
|
|
||||||
|
|
||||||
if (WinSta->ActiveDesktop)
|
DesktopWindow = UserGetDesktopWindow();
|
||||||
DesktopWindow = UserGetWindowObject(WinSta->ActiveDesktop->DesktopWindow);
|
|
||||||
|
|
||||||
if ((Rect.right > Rect.left) && (Rect.bottom > Rect.top)
|
if ((Rect.right > Rect.left) && (Rect.bottom > Rect.top)
|
||||||
&& DesktopWindow && UnsafeRect != NULL)
|
&& DesktopWindow && UnsafeRect != NULL)
|
||||||
|
@ -750,8 +720,8 @@ NtUserClipCursor(
|
||||||
CurInfo->CursorClipInfo.Right = min(Rect.right - 1, DesktopWindow->Wnd->rcWindow.right - 1);
|
CurInfo->CursorClipInfo.Right = min(Rect.right - 1, DesktopWindow->Wnd->rcWindow.right - 1);
|
||||||
CurInfo->CursorClipInfo.Bottom = min(Rect.bottom - 1, DesktopWindow->Wnd->rcWindow.bottom - 1);
|
CurInfo->CursorClipInfo.Bottom = min(Rect.bottom - 1, DesktopWindow->Wnd->rcWindow.bottom - 1);
|
||||||
|
|
||||||
mi.dx = MousePos.x;
|
mi.dx = gpsi->ptCursor.x;
|
||||||
mi.dy = MousePos.y;
|
mi.dy = gpsi->ptCursor.y;
|
||||||
mi.mouseData = 0;
|
mi.mouseData = 0;
|
||||||
mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
|
mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
|
||||||
mi.time = 0;
|
mi.time = 0;
|
||||||
|
@ -762,8 +732,6 @@ NtUserClipCursor(
|
||||||
}
|
}
|
||||||
|
|
||||||
CurInfo->CursorClipInfo.IsClipped = FALSE;
|
CurInfo->CursorClipInfo.IsClipped = FALSE;
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
|
|
||||||
RETURN(TRUE);
|
RETURN(TRUE);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -782,7 +750,6 @@ NtUserDestroyCursor(
|
||||||
HANDLE hCurIcon,
|
HANDLE hCurIcon,
|
||||||
DWORD Unknown)
|
DWORD Unknown)
|
||||||
{
|
{
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
DECLARE_RETURN(BOOL);
|
DECLARE_RETURN(BOOL);
|
||||||
|
@ -790,22 +757,14 @@ NtUserDestroyCursor(
|
||||||
DPRINT("Enter NtUserDestroyCursorIcon\n");
|
DPRINT("Enter NtUserDestroyCursorIcon\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
|
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = IntDestroyCurIconObject(WinSta, CurIcon, FALSE);
|
ret = IntDestroyCurIconObject(CurIcon, FALSE);
|
||||||
/* Note: IntDestroyCurIconObject will remove our reference for us! */
|
/* Note: IntDestroyCurIconObject will remove our reference for us! */
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -827,31 +786,22 @@ NtUserFindExistingCursorIcon(
|
||||||
LONG cy)
|
LONG cy)
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
HANDLE Ret = (HANDLE)0;
|
HANDLE Ret = (HANDLE)0;
|
||||||
DECLARE_RETURN(HICON);
|
DECLARE_RETURN(HICON);
|
||||||
|
|
||||||
DPRINT("Enter NtUserFindExistingCursorIcon\n");
|
DPRINT("Enter NtUserFindExistingCursorIcon\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
CurIcon = IntFindExistingCurIconObject(hModule, hRsrc, cx, cy);
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(Ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
CurIcon = IntFindExistingCurIconObject(WinSta, hModule, hRsrc, cx, cy);
|
|
||||||
if (CurIcon)
|
if (CurIcon)
|
||||||
{
|
{
|
||||||
Ret = CurIcon->Self;
|
Ret = CurIcon->Self;
|
||||||
|
|
||||||
// IntReleaseCurIconObject(CurIcon);//faxme: is this correct? does IntFindExistingCurIconObject add a ref?
|
// IntReleaseCurIconObject(CurIcon);//faxme: is this correct? does IntFindExistingCurIconObject add a ref?
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastWin32Error(ERROR_INVALID_CURSOR_HANDLE);
|
SetLastWin32Error(ERROR_INVALID_CURSOR_HANDLE);
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN((HANDLE)0);
|
RETURN((HANDLE)0);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -871,7 +821,6 @@ NtUserGetClipCursor(
|
||||||
{
|
{
|
||||||
/* FIXME - check if process has WINSTA_READATTRIBUTES */
|
/* FIXME - check if process has WINSTA_READATTRIBUTES */
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
RECTL Rect;
|
RECTL Rect;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
DECLARE_RETURN(BOOL);
|
DECLARE_RETURN(BOOL);
|
||||||
|
@ -882,13 +831,7 @@ NtUserGetClipCursor(
|
||||||
if (!lpRect)
|
if (!lpRect)
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
CurInfo = IntGetSysCursorInfo();
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
|
||||||
if (CurInfo->CursorClipInfo.IsClipped)
|
if (CurInfo->CursorClipInfo.IsClipped)
|
||||||
{
|
{
|
||||||
Rect.left = CurInfo->CursorClipInfo.Left;
|
Rect.left = CurInfo->CursorClipInfo.Left;
|
||||||
|
@ -907,13 +850,10 @@ NtUserGetClipCursor(
|
||||||
Status = MmCopyToCaller(lpRect, &Rect, sizeof(RECT));
|
Status = MmCopyToCaller(lpRect, &Rect, sizeof(RECT));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
|
|
||||||
RETURN(TRUE);
|
RETURN(TRUE);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -933,23 +873,15 @@ NtUserSetCursor(
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
HICON OldCursor;
|
HICON OldCursor;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
DECLARE_RETURN(HCURSOR);
|
DECLARE_RETURN(HCURSOR);
|
||||||
|
|
||||||
DPRINT("Enter NtUserSetCursor\n");
|
DPRINT("Enter NtUserSetCursor\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hCursor)
|
if (hCursor)
|
||||||
{
|
{
|
||||||
if (!(CurIcon = UserGetCurIconObject(hCursor)))
|
if (!(CurIcon = UserGetCurIconObject(hCursor)))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(NULL);
|
RETURN(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -958,13 +890,12 @@ NtUserSetCursor(
|
||||||
CurIcon = NULL;
|
CurIcon = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
OldCursor = IntSetCursor(WinSta, CurIcon, FALSE);
|
OldCursor = UserSetCursor(CurIcon, FALSE);
|
||||||
|
|
||||||
if (CurIcon)
|
if (CurIcon)
|
||||||
{
|
{
|
||||||
UserDereferenceObject(CurIcon);
|
UserDereferenceObject(CurIcon);
|
||||||
}
|
}
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
|
|
||||||
RETURN(OldCursor);
|
RETURN(OldCursor);
|
||||||
|
|
||||||
|
@ -987,7 +918,6 @@ NtUserSetCursorContents(
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
ICONINFO IconInfo;
|
ICONINFO IconInfo;
|
||||||
PSURFACE psurfBmp;
|
PSURFACE psurfBmp;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
DECLARE_RETURN(BOOL);
|
DECLARE_RETURN(BOOL);
|
||||||
|
@ -995,15 +925,8 @@ NtUserSetCursorContents(
|
||||||
DPRINT("Enter NtUserSetCursorContents\n");
|
DPRINT("Enter NtUserSetCursorContents\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
|
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1057,7 +980,6 @@ done:
|
||||||
{
|
{
|
||||||
UserDereferenceObject(CurIcon);
|
UserDereferenceObject(CurIcon);
|
||||||
}
|
}
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -1080,7 +1002,6 @@ NtUserSetCursorIconData(
|
||||||
PICONINFO pIconInfo)
|
PICONINFO pIconInfo)
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
PSURFACE psurfBmp;
|
PSURFACE psurfBmp;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
@ -1089,15 +1010,8 @@ NtUserSetCursorIconData(
|
||||||
DPRINT("Enter NtUserSetCursorIconData\n");
|
DPRINT("Enter NtUserSetCursorIconData\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(CurIcon = UserGetCurIconObject(Handle)))
|
if (!(CurIcon = UserGetCurIconObject(Handle)))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,7 +1063,6 @@ NtUserSetCursorIconData(
|
||||||
Ret = TRUE;
|
Ret = TRUE;
|
||||||
|
|
||||||
UserDereferenceObject(CurIcon);
|
UserDereferenceObject(CurIcon);
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
@ -1169,7 +1082,6 @@ NtUserSetCursorIconData(
|
||||||
HRSRC hGroupRsrc)
|
HRSRC hGroupRsrc)
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
POINT SafeHotspot;
|
POINT SafeHotspot;
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
@ -1178,15 +1090,8 @@ NtUserSetCursorIconData(
|
||||||
DPRINT("Enter NtUserSetCursorIconData\n");
|
DPRINT("Enter NtUserSetCursorIconData\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
|
||||||
if (WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
|
if (!(CurIcon = UserGetCurIconObject(hCurIcon)))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1231,7 +1136,6 @@ NtUserSetCursorIconData(
|
||||||
|
|
||||||
done:
|
done:
|
||||||
UserDereferenceObject(CurIcon);
|
UserDereferenceObject(CurIcon);
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1608,10 +1512,7 @@ int
|
||||||
APIENTRY
|
APIENTRY
|
||||||
UserShowCursor(BOOL bShow)
|
UserShowCursor(BOOL bShow)
|
||||||
{
|
{
|
||||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
|
||||||
PWINSTATION_OBJECT WinSta = pti->Desktop->WindowStation;
|
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
|
|
||||||
HDC Screen;
|
HDC Screen;
|
||||||
PDC dc;
|
PDC dc;
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
|
@ -1619,6 +1520,8 @@ UserShowCursor(BOOL bShow)
|
||||||
PDEVOBJ *ppdev;
|
PDEVOBJ *ppdev;
|
||||||
GDIPOINTER *pgp;
|
GDIPOINTER *pgp;
|
||||||
int showpointer=0;
|
int showpointer=0;
|
||||||
|
|
||||||
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
if (!(Screen = IntGetScreenDC()))
|
if (!(Screen = IntGetScreenDC()))
|
||||||
{
|
{
|
||||||
|
@ -1657,8 +1560,6 @@ UserShowCursor(BOOL bShow)
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
|
||||||
|
|
||||||
if (bShow == FALSE)
|
if (bShow == FALSE)
|
||||||
{
|
{
|
||||||
pgp->ShowPointer--;
|
pgp->ShowPointer--;
|
||||||
|
|
|
@ -1684,18 +1684,23 @@ NtUserSwitchDesktop(HDESK hDesktop)
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Fail if the desktop belong to an invisible window station */
|
if(DesktopObject->WindowStation != InputWindowStation)
|
||||||
|
{
|
||||||
|
ObDereferenceObject(DesktopObject);
|
||||||
|
DPRINT1("Switching desktop 0x%x denied because desktop doesn't belong to the interactive winsta!\n", hDesktop);
|
||||||
|
RETURN(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: Fail if the process is associated with a secured
|
/* FIXME: Fail if the process is associated with a secured
|
||||||
desktop such as Winlogon or Screen-Saver */
|
desktop such as Winlogon or Screen-Saver */
|
||||||
/* FIXME: Connect to input device */
|
/* FIXME: Connect to input device */
|
||||||
|
|
||||||
/* Set the active desktop in the desktop's window station. */
|
/* Set the active desktop in the desktop's window station. */
|
||||||
DesktopObject->WindowStation->ActiveDesktop = DesktopObject;
|
InputWindowStation->ActiveDesktop = DesktopObject;
|
||||||
|
|
||||||
/* Set the global state. */
|
/* Set the global state. */
|
||||||
InputDesktop = DesktopObject;
|
InputDesktop = DesktopObject;
|
||||||
InputDesktopHandle = hDesktop;
|
InputDesktopHandle = hDesktop;
|
||||||
InputWindowStation = DesktopObject->WindowStation;
|
|
||||||
|
|
||||||
ObDereferenceObject(DesktopObject);
|
ObDereferenceObject(DesktopObject);
|
||||||
|
|
||||||
|
|
|
@ -1095,7 +1095,7 @@ IntMouseInput(MOUSEINPUT *mi)
|
||||||
|
|
||||||
ASSERT(WinSta);
|
ASSERT(WinSta);
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinSta);
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
if(!mi->time)
|
if(!mi->time)
|
||||||
{
|
{
|
||||||
|
@ -1107,9 +1107,7 @@ IntMouseInput(MOUSEINPUT *mi)
|
||||||
SwapButtons = gspv.bMouseBtnSwap;
|
SwapButtons = gspv.bMouseBtnSwap;
|
||||||
DoMove = FALSE;
|
DoMove = FALSE;
|
||||||
|
|
||||||
IntGetCursorLocation(WinSta, &MousePos);
|
OrgPos = MousePos = gpsi->ptCursor;
|
||||||
OrgPos.x = MousePos.x;
|
|
||||||
OrgPos.y = MousePos.y;
|
|
||||||
|
|
||||||
if(mi->dwFlags & MOUSEEVENTF_MOVE)
|
if(mi->dwFlags & MOUSEEVENTF_MOVE)
|
||||||
{
|
{
|
||||||
|
@ -1410,8 +1408,7 @@ IntKeyboardInput(KEYBDINPUT *ki)
|
||||||
|
|
||||||
/* All messages have to contain the cursor point. */
|
/* All messages have to contain the cursor point. */
|
||||||
pti = PsGetCurrentThreadWin32Thread();
|
pti = PsGetCurrentThreadWin32Thread();
|
||||||
IntGetCursorLocation(pti->Desktop->WindowStation,
|
Msg.pt = gpsi->ptCursor;
|
||||||
&Msg.pt);
|
|
||||||
|
|
||||||
DPRINT1("Kbd Hook msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n",
|
DPRINT1("Kbd Hook msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n",
|
||||||
Msg.message, vk_hook, Msg.lParam);
|
Msg.message, vk_hook, Msg.lParam);
|
||||||
|
@ -1464,8 +1461,8 @@ IntKeyboardInput(KEYBDINPUT *ki)
|
||||||
|
|
||||||
FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
|
FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
|
||||||
|
|
||||||
IntGetCursorLocation(FocusMessageQueue->Desktop->WindowStation,
|
Msg.pt = gpsi->ptCursor;
|
||||||
&Msg.pt);
|
|
||||||
MsqPostMessage(FocusMessageQueue, &Msg, FALSE, QS_KEY);
|
MsqPostMessage(FocusMessageQueue, &Msg, FALSE, QS_KEY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -441,8 +441,7 @@ IntTranslateKbdMessage(LPMSG lpMsg,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* All messages have to contain the cursor point. */
|
/* All messages have to contain the cursor point. */
|
||||||
IntGetCursorLocation(pti->Desktop->WindowStation,
|
NewMsg.pt = gpsi->ptCursor;
|
||||||
&NewMsg.pt);
|
|
||||||
|
|
||||||
switch (lpMsg->wParam)
|
switch (lpMsg->wParam)
|
||||||
{
|
{
|
||||||
|
|
|
@ -454,14 +454,9 @@ co_IntSendHitTestMessages(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg)
|
||||||
{
|
{
|
||||||
WPARAM wParam;
|
WPARAM wParam;
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
if(!IntGetWindowStationObject(InputWindowStation))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
CurInfo = IntGetSysCursorInfo(InputWindowStation);
|
|
||||||
wParam = (WPARAM)(CurInfo->ButtonsDown);
|
wParam = (WPARAM)(CurInfo->ButtonsDown);
|
||||||
ObDereferenceObject(InputWindowStation);
|
|
||||||
|
|
||||||
co_IntSendMessage(Msg->hwnd, WM_MOUSEMOVE, wParam, Msg->lParam);
|
co_IntSendMessage(Msg->hwnd, WM_MOUSEMOVE, wParam, Msg->lParam);
|
||||||
co_IntSendMessage(Msg->hwnd, WM_SETCURSOR, (WPARAM)Msg->hwnd, MAKELPARAM(HTCLIENT, Msg->message));
|
co_IntSendMessage(Msg->hwnd, WM_SETCURSOR, (WPARAM)Msg->hwnd, MAKELPARAM(HTCLIENT, Msg->message));
|
||||||
|
@ -1094,7 +1089,8 @@ UserPostThreadMessage( DWORD idThread,
|
||||||
Message.message = Msg;
|
Message.message = Msg;
|
||||||
Message.wParam = wParam;
|
Message.wParam = wParam;
|
||||||
Message.lParam = lParam;
|
Message.lParam = lParam;
|
||||||
IntGetCursorLocation(pThread->Desktop->WindowStation, &Message.pt);
|
Message.pt = gpsi->ptCursor;
|
||||||
|
|
||||||
KeQueryTickCount(&LargeTickCount);
|
KeQueryTickCount(&LargeTickCount);
|
||||||
pThread->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
|
pThread->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
|
||||||
MsqPostMessage(pThread->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
|
MsqPostMessage(pThread->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
|
||||||
|
@ -1180,7 +1176,7 @@ UserPostMessage( HWND Wnd,
|
||||||
Message.message = Msg;
|
Message.message = Msg;
|
||||||
Message.wParam = wParam;
|
Message.wParam = wParam;
|
||||||
Message.lParam = lParam;
|
Message.lParam = lParam;
|
||||||
IntGetCursorLocation(pti->Desktop->WindowStation, &Message.pt);
|
Message.pt = gpsi->ptCursor;
|
||||||
KeQueryTickCount(&LargeTickCount);
|
KeQueryTickCount(&LargeTickCount);
|
||||||
pti->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
|
pti->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
|
||||||
MsqPostMessage(Window->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
|
MsqPostMessage(Window->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
|
||||||
|
|
|
@ -23,27 +23,10 @@ BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
InitMetrics(VOID)
|
InitMetrics(VOID)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
|
||||||
PWINSTATION_OBJECT WinStaObject;
|
|
||||||
ULONG Width = 640, Height = 480;
|
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
|
||||||
INT *piSysMet;
|
INT *piSysMet;
|
||||||
|
|
||||||
Width = pPrimarySurface->gdiinfo.ulHorzRes;
|
ULONG Width = pPrimarySurface->gdiinfo.ulHorzRes;
|
||||||
Height = pPrimarySurface->gdiinfo.ulVertRes;
|
ULONG Height = pPrimarySurface->gdiinfo.ulVertRes;
|
||||||
|
|
||||||
Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
|
|
||||||
KernelMode,
|
|
||||||
0,
|
|
||||||
&WinStaObject);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CurInfo = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
piSysMet = gpsi->aiSysMet;
|
piSysMet = gpsi->aiSysMet;
|
||||||
|
|
||||||
|
@ -175,11 +158,6 @@ InitMetrics(VOID)
|
||||||
gpsi->dwSRVIFlags |= SRVINFO_METRICS;
|
gpsi->dwSRVIFlags |= SRVINFO_METRICS;
|
||||||
Setup = TRUE;
|
Setup = TRUE;
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
ObDereferenceObject(WinStaObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,6 @@ BOOL FASTCALL
|
||||||
MsqIsClkLck(LPMSG Msg, BOOL Remove)
|
MsqIsClkLck(LPMSG Msg, BOOL Remove)
|
||||||
{
|
{
|
||||||
PTHREADINFO pti;
|
PTHREADINFO pti;
|
||||||
PWINSTATION_OBJECT WinStaObject;
|
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
BOOL Res = FALSE;
|
BOOL Res = FALSE;
|
||||||
|
|
||||||
|
@ -246,9 +245,7 @@ MsqIsClkLck(LPMSG Msg, BOOL Remove)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WinStaObject = pti->Desktop->WindowStation;
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
|
||||||
|
|
||||||
switch (Msg->message)
|
switch (Msg->message)
|
||||||
{
|
{
|
||||||
|
@ -279,7 +276,6 @@ BOOL FASTCALL
|
||||||
MsqIsDblClk(LPMSG Msg, BOOL Remove)
|
MsqIsDblClk(LPMSG Msg, BOOL Remove)
|
||||||
{
|
{
|
||||||
PTHREADINFO pti;
|
PTHREADINFO pti;
|
||||||
PWINSTATION_OBJECT WinStaObject;
|
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
LONG dX, dY;
|
LONG dX, dY;
|
||||||
BOOL Res;
|
BOOL Res;
|
||||||
|
@ -290,9 +286,7 @@ MsqIsDblClk(LPMSG Msg, BOOL Remove)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WinStaObject = pti->Desktop->WindowStation;
|
CurInfo = IntGetSysCursorInfo();
|
||||||
|
|
||||||
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
|
||||||
Res = (Msg->hwnd == (HWND)CurInfo->LastClkWnd) &&
|
Res = (Msg->hwnd == (HWND)CurInfo->LastClkWnd) &&
|
||||||
((Msg->time - CurInfo->LastBtnDown) < gspv.iDblClickTime);
|
((Msg->time - CurInfo->LastBtnDown) < gspv.iDblClickTime);
|
||||||
if(Res)
|
if(Res)
|
||||||
|
@ -841,8 +835,7 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
|
FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
|
||||||
|
|
||||||
IntGetCursorLocation(FocusMessageQueue->Desktop->WindowStation,
|
Msg.pt = gpsi->ptCursor;
|
||||||
&Msg.pt);
|
|
||||||
MsqPostMessage(FocusMessageQueue, &Msg, FALSE, QS_KEY);
|
MsqPostMessage(FocusMessageQueue, &Msg, FALSE, QS_KEY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -859,7 +852,6 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT Window;
|
PWINDOW_OBJECT Window;
|
||||||
PTHREADINFO Win32Thread;
|
PTHREADINFO Win32Thread;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
MSG Mesg;
|
MSG Mesg;
|
||||||
LARGE_INTEGER LargeTickCount;
|
LARGE_INTEGER LargeTickCount;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -878,7 +870,6 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WinSta = Win32Thread->Desktop->WindowStation;
|
|
||||||
Window = IntGetWindowObject(hWnd);
|
Window = IntGetWindowObject(hWnd);
|
||||||
if (!Window)
|
if (!Window)
|
||||||
{
|
{
|
||||||
|
@ -892,7 +883,7 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
Mesg.lParam = lParam;
|
Mesg.lParam = lParam;
|
||||||
KeQueryTickCount(&LargeTickCount);
|
KeQueryTickCount(&LargeTickCount);
|
||||||
Mesg.time = MsqCalculateMessageTime(&LargeTickCount);
|
Mesg.time = MsqCalculateMessageTime(&LargeTickCount);
|
||||||
IntGetCursorLocation(WinSta, &Mesg.pt);
|
Mesg.pt = gpsi->ptCursor;
|
||||||
MsqPostMessage(Window->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
|
MsqPostMessage(Window->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
|
||||||
UserDereferenceObject(Window);
|
UserDereferenceObject(Window);
|
||||||
ObDereferenceObject (Thread);
|
ObDereferenceObject (Thread);
|
||||||
|
@ -1876,7 +1867,6 @@ MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
LARGE_INTEGER LargeTickCount;
|
LARGE_INTEGER LargeTickCount;
|
||||||
PLIST_ENTRY EnumEntry;
|
PLIST_ENTRY EnumEntry;
|
||||||
BOOLEAN GotMessage;
|
BOOLEAN GotMessage;
|
||||||
PTHREADINFO pti;
|
|
||||||
|
|
||||||
DPRINT("MsqGetTimerMessage queue %p msg %p restart %s\n",
|
DPRINT("MsqGetTimerMessage queue %p msg %p restart %s\n",
|
||||||
MessageQueue, Msg, Restart ? "TRUE" : "FALSE");
|
MessageQueue, Msg, Restart ? "TRUE" : "FALSE");
|
||||||
|
@ -1928,9 +1918,7 @@ MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
Msg->lParam = (LPARAM) Timer->TimerFunc;
|
Msg->lParam = (LPARAM) Timer->TimerFunc;
|
||||||
KeQueryTickCount(&LargeTickCount);
|
KeQueryTickCount(&LargeTickCount);
|
||||||
Msg->time = MsqCalculateMessageTime(&LargeTickCount);
|
Msg->time = MsqCalculateMessageTime(&LargeTickCount);
|
||||||
pti = PsGetCurrentThreadWin32Thread();
|
Msg->pt = gpsi->ptCursor;
|
||||||
IntGetCursorLocation(pti->Desktop->WindowStation,
|
|
||||||
&Msg->pt);
|
|
||||||
|
|
||||||
if (Restart)
|
if (Restart)
|
||||||
{
|
{
|
||||||
|
|
|
@ -203,54 +203,34 @@ NtUserCallOneParam(
|
||||||
case ONEPARAM_ROUTINE_CREATECURICONHANDLE:
|
case ONEPARAM_ROUTINE_CREATECURICONHANDLE:
|
||||||
{
|
{
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
PWINSTATION_OBJECT WinSta;
|
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
if (!(CurIcon = IntCreateCurIconHandle()))
|
||||||
if(WinSta == NULL)
|
|
||||||
{
|
|
||||||
RETURN(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(CurIcon = IntCreateCurIconHandle(WinSta)))
|
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
RETURN((DWORD)CurIcon->Self);
|
RETURN((DWORD)CurIcon->Self);
|
||||||
}
|
}
|
||||||
|
|
||||||
case ONEPARAM_ROUTINE_GETCURSORPOSITION:
|
case ONEPARAM_ROUTINE_GETCURSORPOSITION:
|
||||||
{
|
{
|
||||||
PWINSTATION_OBJECT WinSta;
|
BOOL ret = TRUE;
|
||||||
NTSTATUS Status;
|
|
||||||
POINT Pos;
|
|
||||||
|
|
||||||
if(!Param)
|
|
||||||
RETURN( (DWORD)FALSE);
|
|
||||||
Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
|
|
||||||
KernelMode,
|
|
||||||
0,
|
|
||||||
&WinSta);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
RETURN( (DWORD)FALSE);
|
|
||||||
|
|
||||||
/* FIXME - check if process has WINSTA_READATTRIBUTES */
|
_SEH2_TRY
|
||||||
IntGetCursorLocation(WinSta, &Pos);
|
|
||||||
|
|
||||||
Status = MmCopyToCaller((PPOINT)Param, &Pos, sizeof(POINT));
|
|
||||||
if(!NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
ProbeForWrite((POINT*)Param,sizeof(POINT),1);
|
||||||
SetLastNtError(Status);
|
RtlCopyMemory((POINT*)Param,&gpsi->ptCursor,sizeof(POINT));
|
||||||
RETURN( FALSE);
|
|
||||||
}
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
SetLastNtError(_SEH2_GetExceptionCode());
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
RETURN (ret);
|
||||||
|
|
||||||
RETURN( (DWORD)TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
|
case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
|
||||||
|
|
|
@ -395,7 +395,6 @@ NtUserCreateWindowStation(
|
||||||
DWORD Unknown5,
|
DWORD Unknown5,
|
||||||
DWORD Unknown6)
|
DWORD Unknown6)
|
||||||
{
|
{
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
|
||||||
UNICODE_STRING WindowStationName;
|
UNICODE_STRING WindowStationName;
|
||||||
UNICODE_STRING FullWindowStationName;
|
UNICODE_STRING FullWindowStationName;
|
||||||
PWINSTATION_OBJECT WindowStationObject;
|
PWINSTATION_OBJECT WindowStationObject;
|
||||||
|
@ -522,61 +521,16 @@ NtUserCreateWindowStation(
|
||||||
|
|
||||||
WindowStationObject->FlatMenu = FALSE;
|
WindowStationObject->FlatMenu = FALSE;
|
||||||
|
|
||||||
if(!(CurInfo = ExAllocatePool(PagedPool, sizeof(SYSTEM_CURSORINFO))))
|
|
||||||
{
|
|
||||||
ExFreePool(FullWindowStationName.Buffer);
|
|
||||||
/* FIXME - Delete window station object */
|
|
||||||
ObDereferenceObject(WindowStationObject);
|
|
||||||
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CurInfo->Enabled = FALSE;
|
|
||||||
CurInfo->ButtonsDown = 0;
|
|
||||||
CurInfo->CursorClipInfo.IsClipped = FALSE;
|
|
||||||
CurInfo->LastBtnDown = 0;
|
|
||||||
CurInfo->CurrentCursorObject = NULL;
|
|
||||||
CurInfo->ShowingCursor = 0;
|
|
||||||
CurInfo->ClickLockActive = FALSE;
|
|
||||||
CurInfo->ClickLockTime = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
// not used anymore
|
|
||||||
CurInfo->WheelScroLines = gspv.iWheelScrollLines;
|
|
||||||
#if (_WIN32_WINNT >= 0x0600)
|
|
||||||
CurInfo->WheelScroChars = gspv.iWheelScrollChars;
|
|
||||||
#endif
|
|
||||||
CurInfo->SwapButtons = gspv.bMouseBtnSwap;
|
|
||||||
CurInfo->DblClickSpeed = gspv.iDblClickTime;
|
|
||||||
CurInfo->DblClickWidth = gspv.iDblClickWidth;
|
|
||||||
CurInfo->DblClickHeight = gspv.iDblClickHeight;
|
|
||||||
|
|
||||||
CurInfo->MouseSpeed = gspv.iMouseSpeed;
|
|
||||||
CurInfo->CursorAccelerationInfo.FirstThreshold = gspv.caiMouse.FirstThreshold;
|
|
||||||
CurInfo->CursorAccelerationInfo.SecondThreshold = gspv.caiMouse.SecondThreshold;
|
|
||||||
CurInfo->CursorAccelerationInfo.Acceleration = gspv.caiMouse.Acceleration;
|
|
||||||
|
|
||||||
CurInfo->MouseHoverTime = gspv.iMouseHoverTime;
|
|
||||||
CurInfo->MouseHoverWidth = gspv.iMouseHoverWidth;
|
|
||||||
CurInfo->MouseHoverHeight = gspv.iMouseHoverHeight;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// WindowStationObject->ScreenSaverActive = FALSE;
|
|
||||||
// WindowStationObject->ScreenSaverTimeOut = 10;
|
|
||||||
WindowStationObject->SystemCursor = CurInfo;
|
|
||||||
|
|
||||||
/* END FIXME loading from register */
|
|
||||||
|
|
||||||
if (!IntSetupClipboard(WindowStationObject))
|
if (!IntSetupClipboard(WindowStationObject))
|
||||||
{
|
{
|
||||||
DPRINT1("WindowStation: Error Setting up the clipboard!!!\n");
|
DPRINT1("WindowStation: Error Setting up the clipboard!!!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IntSetupCurIconHandles(WindowStationObject))
|
if (InputWindowStation == NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("Setting up the Cursor/Icon Handle table failed!\n");
|
InputWindowStation = WindowStationObject;
|
||||||
/* FIXME: Complain more loudly? */
|
|
||||||
ExFreePool(FullWindowStationName.Buffer);
|
InitCursorImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Window station successfully created (%wZ)\n", &FullWindowStationName);
|
DPRINT("Window station successfully created (%wZ)\n", &FullWindowStationName);
|
||||||
|
@ -709,12 +663,6 @@ NtUserCloseWindowStation(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* FIXME - free the cursor information when actually deleting the object!! */
|
|
||||||
ASSERT(Object->SystemCursor);
|
|
||||||
ExFreePool(Object->SystemCursor);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ObDereferenceObject(Object);
|
ObDereferenceObject(Object);
|
||||||
|
|
||||||
DPRINT("Closing window station handle (0x%X)\n", hWinSta);
|
DPRINT("Closing window station handle (0x%X)\n", hWinSta);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue