Skip to content

Commit aea0721

Browse files
committed
[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
1 parent e14624d commit aea0721

File tree

5 files changed

+19
-26
lines changed

5 files changed

+19
-26
lines changed

reactos/subsystems/win32/win32k/include/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window);
3232
BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer);
3333
UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
3434
PTIMER FASTCALL FindSystemTimer(PMSG);
35-
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,PWINDOW_OBJECT,WPARAM,LPARAM);
35+
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,LPARAM);
3636
VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
3737
UINT_PTR FASTCALL SystemTimerSet(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC);
3838
BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT);

reactos/subsystems/win32/win32k/include/win32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define W32PF_SCREENSAVER 0x00200000
2626
#define W32PF_IDLESCREENSAVER 0x00400000
2727
#define W32PF_ICONTITLEREGISTERED 0x10000000
28+
#define W32PF_DPIAWARE 0x20000000
2829
// ReactOS
2930
#define W32PF_NOWINDOWGHOSTING (0x01000000)
3031
#define W32PF_MANUALGUICHECK (0x02000000)
@@ -93,6 +94,7 @@ typedef struct _THREADINFO
9394
HANDLE hEventQueueClient;
9495
PKEVENT pEventQueueServer;
9596
LIST_ENTRY PtiLink;
97+
POINT ptLast;
9698

9799
CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL.
98100
/* ReactOS */

reactos/subsystems/win32/win32k/ntuser/message.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ IntDispatchMessage(PMSG pMsg)
394394
{
395395
if (pMsg->message == WM_TIMER)
396396
{
397-
if (ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),Window,pMsg->wParam,pMsg->lParam))
397+
if (ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),pMsg->lParam))
398398
{
399399
KeQueryTickCount(&TickCount);
400400
Time = MsqCalculateMessageTime(&TickCount);
@@ -963,13 +963,15 @@ co_IntPeekMessage( PUSER_MESSAGE Msg,
963963
}
964964

965965
MsgExit:
966+
pti->rpdesk->htEx = HitTest; /* Now set the capture hit. */
967+
966968
if ( ISITHOOKED(WH_MOUSE) && IS_MOUSE_MESSAGE(Msg->Msg.message))
967969
{
968-
if(!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg))
969-
{
970-
return FALSE;
971-
}
972-
}
970+
if (!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg))
971+
{
972+
return FALSE;
973+
}
974+
}
973975

974976
if ( ISITHOOKED(WH_KEYBOARD) && IS_KBD_MESSAGE(Msg->Msg.message))
975977
{

reactos/subsystems/win32/win32k/ntuser/ntstubs.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,20 +1125,11 @@ NtUserValidateTimerCallback(
11251125
LPARAM lParam)
11261126
{
11271127
BOOL Ret = FALSE;
1128-
PWINDOW_OBJECT Window = NULL;
11291128

11301129
UserEnterShared();
11311130

1132-
if (hWnd)
1133-
{
1134-
Window = UserGetWindowObject(hWnd);
1135-
if (!Window || !Window->Wnd)
1136-
goto Exit;
1137-
}
1131+
Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), lParam);
11381132

1139-
Ret = ValidateTimerCallback(PsGetCurrentThreadWin32Thread(), Window, wParam, lParam);
1140-
1141-
Exit:
11421133
UserLeave();
11431134
return Ret;
11441135
}

reactos/subsystems/win32/win32k/ntuser/timer.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,10 @@ FindSystemTimer(PMSG pMsg)
167167
BOOL
168168
FASTCALL
169169
ValidateTimerCallback(PTHREADINFO pti,
170-
PWINDOW_OBJECT Window,
171-
WPARAM wParam,
172170
LPARAM lParam)
173171
{
174172
PLIST_ENTRY pLE;
173+
BOOL Ret = FALSE;
175174
PTIMER pTmr = FirstpTmr;
176175

177176
if (!pTmr) return FALSE;
@@ -180,18 +179,18 @@ ValidateTimerCallback(PTHREADINFO pti,
180179
do
181180
{
182181
if ( (lParam == (LPARAM)pTmr->pfn) &&
183-
(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
182+
!(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
184183
(pTmr->pti->ppi == pti->ppi) )
184+
{
185+
Ret = TRUE;
185186
break;
186-
187+
}
187188
pLE = pTmr->ptmrList.Flink;
188189
pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
189190
} while (pTmr != FirstpTmr);
190191
TimerLeave();
191192

192-
if (!pTmr) return FALSE;
193-
194-
return TRUE;
193+
return Ret;
195194
}
196195

197196
UINT_PTR FASTCALL
@@ -616,8 +615,7 @@ NtUserSetSystemTimer(
616615

617616
DPRINT("Enter NtUserSetSystemTimer\n");
618617

619-
// This is wrong, lpTimerFunc is NULL!
620-
RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM));
618+
RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM));
621619

622620
CLEANUP:
623621
DPRINT("Leave NtUserSetSystemTimer, ret=%i\n", _ret_);

0 commit comments

Comments
 (0)