From aea07215a8be8eba283784fb447251a427ca4cb4 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 3 Oct 2010 19:18:19 +0000 Subject: [PATCH] [Win32k] - Fixed ValidateTimerCallback, always returning true and just spinning in the loop. - Add one more process information flag with a point type and capturing the hit test in desktop structure. svn path=/trunk/; revision=48970 --- reactos/subsystems/win32/win32k/include/timer.h | 2 +- reactos/subsystems/win32/win32k/include/win32.h | 2 ++ reactos/subsystems/win32/win32k/ntuser/message.c | 14 ++++++++------ reactos/subsystems/win32/win32k/ntuser/ntstubs.c | 11 +---------- reactos/subsystems/win32/win32k/ntuser/timer.c | 16 +++++++--------- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/timer.h b/reactos/subsystems/win32/win32k/include/timer.h index 9b2b07f8c9d..e85740255c0 100644 --- a/reactos/subsystems/win32/win32k/include/timer.h +++ b/reactos/subsystems/win32/win32k/include/timer.h @@ -32,7 +32,7 @@ BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window); BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer); UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type); PTIMER FASTCALL FindSystemTimer(PMSG); -BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,PWINDOW_OBJECT,WPARAM,LPARAM); +BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,LPARAM); VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD); UINT_PTR FASTCALL SystemTimerSet(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC); BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT); diff --git a/reactos/subsystems/win32/win32k/include/win32.h b/reactos/subsystems/win32/win32k/include/win32.h index 5de6139e1d3..63dfba76fe2 100644 --- a/reactos/subsystems/win32/win32k/include/win32.h +++ b/reactos/subsystems/win32/win32k/include/win32.h @@ -25,6 +25,7 @@ #define W32PF_SCREENSAVER 0x00200000 #define W32PF_IDLESCREENSAVER 0x00400000 #define W32PF_ICONTITLEREGISTERED 0x10000000 +#define W32PF_DPIAWARE 0x20000000 // ReactOS #define W32PF_NOWINDOWGHOSTING (0x01000000) #define W32PF_MANUALGUICHECK (0x02000000) @@ -93,6 +94,7 @@ typedef struct _THREADINFO HANDLE hEventQueueClient; PKEVENT pEventQueueServer; LIST_ENTRY PtiLink; + POINT ptLast; CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL. /* ReactOS */ diff --git a/reactos/subsystems/win32/win32k/ntuser/message.c b/reactos/subsystems/win32/win32k/ntuser/message.c index 1d7a0b34171..efa88eb9f48 100644 --- a/reactos/subsystems/win32/win32k/ntuser/message.c +++ b/reactos/subsystems/win32/win32k/ntuser/message.c @@ -394,7 +394,7 @@ IntDispatchMessage(PMSG pMsg) { if (pMsg->message == WM_TIMER) { - if (ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),Window,pMsg->wParam,pMsg->lParam)) + if (ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),pMsg->lParam)) { KeQueryTickCount(&TickCount); Time = MsqCalculateMessageTime(&TickCount); @@ -963,13 +963,15 @@ MessageFound: } MsgExit: + pti->rpdesk->htEx = HitTest; /* Now set the capture hit. */ + if ( ISITHOOKED(WH_MOUSE) && IS_MOUSE_MESSAGE(Msg->Msg.message)) { - if(!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg)) - { - return FALSE; - } - } + if (!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg)) + { + return FALSE; + } + } if ( ISITHOOKED(WH_KEYBOARD) && IS_KBD_MESSAGE(Msg->Msg.message)) { diff --git a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c index 8c128fefda9..3219a953411 100644 --- a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c @@ -1125,20 +1125,11 @@ NtUserValidateTimerCallback( LPARAM lParam) { BOOL Ret = FALSE; - PWINDOW_OBJECT Window = NULL; UserEnterShared(); - if (hWnd) - { - Window = UserGetWindowObject(hWnd); - if (!Window || !Window->Wnd) - goto Exit; - } + Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), lParam); - Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), Window, wParam, lParam); - -Exit: UserLeave(); return Ret; } diff --git a/reactos/subsystems/win32/win32k/ntuser/timer.c b/reactos/subsystems/win32/win32k/ntuser/timer.c index 2f4e2189f3f..74bfe7641dd 100644 --- a/reactos/subsystems/win32/win32k/ntuser/timer.c +++ b/reactos/subsystems/win32/win32k/ntuser/timer.c @@ -167,11 +167,10 @@ FindSystemTimer(PMSG pMsg) BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, - PWINDOW_OBJECT Window, - WPARAM wParam, LPARAM lParam) { PLIST_ENTRY pLE; + BOOL Ret = FALSE; PTIMER pTmr = FirstpTmr; if (!pTmr) return FALSE; @@ -180,18 +179,18 @@ ValidateTimerCallback(PTHREADINFO pti, do { if ( (lParam == (LPARAM)pTmr->pfn) && - (pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) && + !(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) && (pTmr->pti->ppi == pti->ppi) ) + { + Ret = TRUE; break; - + } pLE = pTmr->ptmrList.Flink; pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); TimerLeave(); - if (!pTmr) return FALSE; - - return TRUE; + return Ret; } UINT_PTR FASTCALL @@ -616,8 +615,7 @@ NtUserSetSystemTimer( DPRINT("Enter NtUserSetSystemTimer\n"); - // This is wrong, lpTimerFunc is NULL! - RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM)); + RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM)); CLEANUP: DPRINT("Leave NtUserSetSystemTimer, ret=%i\n", _ret_); -- 2.17.1