mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
- Check for same intput desktop with GetCursorPos. Cleanup GetCursorInfo.
svn path=/trunk/; revision=38343
This commit is contained in:
parent
d120bf4591
commit
af2f0d64d5
|
@ -778,37 +778,14 @@ NtUserGetCursorInfo(
|
||||||
CURSORINFO SafeCi;
|
CURSORINFO SafeCi;
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
PWINSTATION_OBJECT WinSta;
|
PWINSTATION_OBJECT WinSta;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status = STATUS_SUCCESS;;
|
||||||
PCURICON_OBJECT CurIcon;
|
PCURICON_OBJECT CurIcon;
|
||||||
HDC hDC;
|
BOOL Ret = FALSE;
|
||||||
DECLARE_RETURN(BOOL);
|
DECLARE_RETURN(BOOL);
|
||||||
|
|
||||||
DPRINT("Enter NtUserGetCursorInfo\n");
|
DPRINT("Enter NtUserGetCursorInfo\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
|
|
||||||
/* FIXME - get the screen dc from the window station or desktop */
|
|
||||||
if (!(hDC = IntGetScreenDC()))
|
|
||||||
{
|
|
||||||
RETURN( FALSE);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Status = MmCopyFromCaller(&SafeCi.cbSize, pci, sizeof(DWORD));
|
|
||||||
if(!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
SetLastNtError(Status);
|
|
||||||
RETURN( FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(SafeCi.cbSize != sizeof(CURSORINFO))
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
|
||||||
RETURN( FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
WinSta = IntGetWinStaObj();
|
WinSta = IntGetWinStaObj();
|
||||||
if (WinSta == NULL)
|
if (WinSta == NULL)
|
||||||
{
|
{
|
||||||
|
@ -823,16 +800,31 @@ NtUserGetCursorInfo(
|
||||||
|
|
||||||
IntGetCursorLocation(WinSta, &SafeCi.ptScreenPos);
|
IntGetCursorLocation(WinSta, &SafeCi.ptScreenPos);
|
||||||
|
|
||||||
Status = MmCopyToCaller(pci, &SafeCi, sizeof(CURSORINFO));
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
if (pci->cbSize == sizeof(CURSORINFO))
|
||||||
|
{
|
||||||
|
ProbeForWrite(pci, sizeof(CURSORINFO), 1);
|
||||||
|
RtlCopyMemory(pci, &SafeCi, sizeof(CURSORINFO));
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
Status = _SEH2_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinSta);
|
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
RETURN( FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ObDereferenceObject(WinSta);
|
ObDereferenceObject(WinSta);
|
||||||
RETURN( TRUE);
|
RETURN(Ret);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
DPRINT("Leave NtUserGetCursorInfo, ret=%i\n",_ret_);
|
DPRINT("Leave NtUserGetCursorInfo, ret=%i\n",_ret_);
|
||||||
|
|
|
@ -404,6 +404,8 @@ NtUserCallOneParam(
|
||||||
{
|
{
|
||||||
BOOL Ret = TRUE;
|
BOOL Ret = TRUE;
|
||||||
PPOINTL pptl;
|
PPOINTL pptl;
|
||||||
|
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
||||||
|
if (pti->hDesktop != InputDesktopHandle) RETURN(FALSE);
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
pptl = (PPOINTL)Param;
|
pptl = (PPOINTL)Param;
|
||||||
|
|
Loading…
Reference in a new issue