ReactOS 0.4.15-dev-7907-g95bf896
timer.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Window timers messages
5 * FILE: win32ss/user/ntuser/timer.c
6 * PROGRAMER: Gunnar
7 * Thomas Weidenmueller (w3seek@users.sourceforge.net)
8 * Michael Martin (michael.martin@reactos.org)
9 */
10
11#include <win32k.h>
13
14/* GLOBALS *******************************************************************/
15
17static LONG TimeLast = 0;
18
19/* Windows 2000 has room for 32768 window-less timers */
20#define NUM_WINDOW_LESS_TIMERS 32768
21
25static ULONG HintIndex = 1;
26
28
29#define IntLockWindowlessTimerBitmap() \
30 ExEnterCriticalRegionAndAcquireFastMutexUnsafe(Mutex)
31
32#define IntUnlockWindowlessTimerBitmap() \
33 ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(Mutex)
34
35#define TimerEnterExclusive() \
36{ \
37 KeEnterCriticalRegion(); \
38 ExAcquireResourceExclusiveLite(&TimerLock, TRUE); \
39}
40
41#define TimerLeave() \
42{ \
43 ExReleaseResourceLite(&TimerLock); \
44 KeLeaveCriticalRegion(); \
45}
46
47
48/* FUNCTIONS *****************************************************************/
49static
53{
55 PTIMER Ret = NULL;
56
58 if (Ret)
59 {
62 }
63
64 return Ret;
65}
66
67static
68BOOL
71{
72 BOOL Ret = FALSE;
73 if (pTmr)
74 {
75 /* Set the flag, it will be removed when ready */
77 if ((pTmr->pWnd == NULL) && (!(pTmr->flags & TMRF_SYSTEM))) // System timers are reusable.
78 {
79 UINT_PTR IDEvent;
80
81 IDEvent = NUM_WINDOW_LESS_TIMERS - pTmr->nID;
85 }
88 }
89 if (!Ret) ERR("Warning: Unable to delete timer\n");
90
91 return Ret;
92}
93
97 UINT_PTR nID,
98 UINT flags)
99{
100 PLIST_ENTRY pLE;
101 PTIMER pTmr, RetTmr = NULL;
102
104 pLE = TimersListHead.Flink;
105 while (pLE != &TimersListHead)
106 {
107 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
108
109 if ( pTmr->nID == nID &&
110 pTmr->pWnd == Window &&
111 (pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) == (flags & (TMRF_SYSTEM|TMRF_RIT)))
112 {
113 RetTmr = pTmr;
114 break;
115 }
116
117 pLE = pLE->Flink;
118 }
119 TimerLeave();
120
121 return RetTmr;
122}
123
124PTIMER
127{
128 PLIST_ENTRY pLE;
129 PTIMER pTmr = NULL;
130
132 pLE = TimersListHead.Flink;
133 while (pLE != &TimersListHead)
134 {
135 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
136
137 if ( pMsg->lParam == (LPARAM)pTmr->pfn &&
138 (pTmr->flags & TMRF_SYSTEM) )
139 break;
140
141 pLE = pLE->Flink;
142 }
143 TimerLeave();
144
145 return pTmr;
146}
147
148BOOL
152{
153 PLIST_ENTRY pLE;
154 BOOL Ret = FALSE;
155 PTIMER pTmr;
156
158 pLE = TimersListHead.Flink;
159 while (pLE != &TimersListHead)
160 {
161 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
162 if ( (lParam == (LPARAM)pTmr->pfn) &&
163 !(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
164 (pTmr->pti->ppi == pti->ppi) )
165 {
166 Ret = TRUE;
167 break;
168 }
169 pLE = pLE->Flink;
170 }
171 TimerLeave();
172
173 return Ret;
174}
175
178 UINT_PTR IDEvent,
179 UINT Elapse,
180 TIMERPROC TimerFunc,
181 INT Type)
182{
183 PTIMER pTmr;
184 UINT Ret = IDEvent;
186 DueTime.QuadPart = (LONGLONG)(-97656); // 1024hz .9765625 ms set to 10.0 ms
187
188#if 0
189 /* Windows NT/2k/XP behaviour */
190 if (Elapse > USER_TIMER_MAXIMUM)
191 {
192 TRACE("Adjusting uElapse\n");
193 Elapse = 1;
194 }
195#else
196 /* Windows XP SP2 and Windows Server 2003 behaviour */
197 if (Elapse > USER_TIMER_MAXIMUM)
198 {
199 TRACE("Adjusting uElapse\n");
200 Elapse = USER_TIMER_MAXIMUM;
201 }
202#endif
203
204 /* Windows 2k/XP and Windows Server 2003 SP1 behaviour */
205 if (Elapse < USER_TIMER_MINIMUM)
206 {
207 TRACE("Adjusting uElapse\n");
208 Elapse = USER_TIMER_MINIMUM; // 1024hz .9765625 ms, set to 10.0 ms (+/-)1 ms
209 }
210
211 /* Passing an IDEvent of 0 and the SetTimer returns 1.
212 It will create the timer with an ID of 0 */
213 if ((Window) && (IDEvent == 0))
214 Ret = 1;
215
216 pTmr = FindTimer(Window, IDEvent, Type);
217
218 if ((!pTmr) && (Window == NULL) && (!(Type & TMRF_SYSTEM)))
219 {
221
223
224 if (IDEvent == (UINT_PTR) -1)
225 {
227 ERR("Unable to find a free window-less timer id\n");
229 ASSERT(FALSE);
230 return 0;
231 }
232
233 IDEvent = NUM_WINDOW_LESS_TIMERS - IDEvent;
234 Ret = IDEvent;
235
237 }
238
239 if (!pTmr)
240 {
241 pTmr = CreateTimer();
242 if (!pTmr) return 0;
243
244 if (Window && (Type & TMRF_TIFROMWND))
245 pTmr->pti = Window->head.pti->pEThread->Tcb.Win32Thread;
246 else
247 {
248 if (Type & TMRF_RIT)
249 pTmr->pti = ptiRawInput;
250 else
252 }
253
254 pTmr->pWnd = Window;
255 pTmr->cmsCountdown = Elapse;
256 pTmr->cmsRate = Elapse;
257 pTmr->pfn = TimerFunc;
258 pTmr->nID = IDEvent;
259 pTmr->flags = Type|TMRF_INIT;
260 }
261 else
262 {
263 pTmr->cmsCountdown = Elapse;
264 pTmr->cmsRate = Elapse;
265 }
266
268 // Start the timer thread!
269 if (TimersListHead.Flink == TimersListHead.Blink) // There is only one timer
271
272 return Ret;
273}
274
275//
276// Process win32k system timers.
277//
278VOID
281 UINT uMsg,
282 UINT_PTR idEvent,
284{
285 PDESKTOP pDesk;
286 PWND pWnd = NULL;
287
288 if (hwnd)
289 {
291 if (!pWnd)
292 {
293 ERR("System Timer Proc has invalid window handle! %p Id: %u\n", hwnd, idEvent);
294 return;
295 }
296 }
297 else
298 {
299 TRACE( "Windowless Timer Running!\n" );
300 return;
301 }
302
303 switch (idEvent)
304 {
305/*
306 Used in NtUserTrackMouseEvent.
307 */
309 {
310 POINT Point;
311 UINT Msg;
313
314 pDesk = pWnd->head.rpdesk;
315 if ( pDesk->dwDTFlags & DF_TME_HOVER &&
316 pWnd == pDesk->spwndTrack )
317 {
318 Point = gpsi->ptCursor;
319 if ( RECTL_bPointInRect(&pDesk->rcMouseHover, Point.x, Point.y) )
320 {
321 if (pDesk->htEx == HTCLIENT) // In a client area.
322 {
323 wParam = MsqGetDownKeyState(pWnd->head.pti->MessageQueue);
325
326 if (pWnd->ExStyle & WS_EX_LAYOUTRTL)
327 {
328 Point.x = pWnd->rcClient.right - Point.x - 1;
329 }
330 else
331 Point.x -= pWnd->rcClient.left;
332 Point.y -= pWnd->rcClient.top;
333 }
334 else
335 {
336 wParam = pDesk->htEx; // Need to support all HTXYZ hits.
338 }
339 TRACE("Generating WM_NCMOUSEHOVER\n");
341 pDesk->dwDTFlags &= ~DF_TME_HOVER;
342 break; // Kill this timer.
343 }
344 }
345 }
346 return; // Not this window so just return.
347
349 {
350 FLASHWINFO fwi =
351 {sizeof(FLASHWINFO),
352 UserHMGetHandle(pWnd),
353 FLASHW_SYSTIMER,0,0};
354
355 IntFlashWindowEx(pWnd, &fwi);
356 }
357 return;
358
359 default:
360 ERR("System Timer Proc invalid id %u!\n", idEvent);
361 break;
362 }
363 IntKillTimer(pWnd, idEvent, TRUE);
364}
365
366VOID
369{
370 // Need to start gdi syncro timers then start timer with Hang App proc
371 // that calles Idle process so the screen savers will know to run......
373// Test Timers
374// IntSetTimer(NULL, 0, 1000, SystemTimerProc, TMRF_RIT);
375}
376
380 UINT_PTR nIDEvent,
381 UINT uElapse,
382 TIMERPROC lpTimerFunc)
383{
384 if (Window && Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
385 {
387 TRACE("SysemTimerSet: Access Denied!\n");
388 return 0;
389 }
390 return IntSetTimer( Window, nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM);
391}
392
393BOOL
396{
397 PLIST_ENTRY pLE;
398 MSG Msg;
399 PTHREADINFO pti;
400 BOOL Hit = FALSE;
401 PTIMER pTmr;
402
404
406 pLE = TimersListHead.Flink;
407 while(pLE != &TimersListHead)
408 {
409 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
410 if ( (pTmr->flags & TMRF_READY) &&
411 (pTmr->pti == pti) &&
412 ((pTmr->pWnd == Window) || (Window == NULL)) )
413 {
414 Msg.hwnd = (pTmr->pWnd ? UserHMGetHandle(pTmr->pWnd) : NULL);
415 Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
416 Msg.wParam = (WPARAM) pTmr->nID;
417 Msg.lParam = (LPARAM) pTmr->pfn;
418 Msg.time = EngGetTickCount32();
419 // Fix all wine win:test_GetMessagePos WM_TIMER tests. See CORE-10867.
420 Msg.pt = gpsi->ptCursor;
421
423 pTmr->flags &= ~TMRF_READY;
425 Hit = TRUE;
426 // Now move this entry to the end of the list so it will not be
427 // called again in the next msg loop.
428 if (pLE != &TimersListHead)
429 {
432 }
433 break;
434 }
435
436 pLE = pLE->Flink;
437 }
438
439 TimerLeave();
440
441 return Hit;
442}
443
444VOID
447{
449 LONG Time;
450 PLIST_ENTRY pLE;
451 PTIMER pTmr;
452 LONG TimerCount = 0;
453
455 pLE = TimersListHead.Flink;
457
458 DueTime.QuadPart = (LONGLONG)(-97656); // 1024hz .9765625 ms set to 10.0 ms
459
460 while(pLE != &TimersListHead)
461 {
462 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
463 TimerCount++;
464 if (pTmr->flags & TMRF_WAITING)
465 {
466 pLE = pTmr->ptmrList.Flink;
467 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
468 continue;
469 }
470
471 if (pTmr->flags & TMRF_INIT)
472 {
473 pTmr->flags &= ~TMRF_INIT; // Skip this run.
474 }
475 else
476 {
477 if (pTmr->cmsCountdown < 0)
478 {
479 ASSERT(pTmr->pti);
480 if ((!(pTmr->flags & TMRF_READY)) && (!(pTmr->pti->TIF_flags & TIF_INCLEANUP)))
481 {
482 if (pTmr->flags & TMRF_ONESHOT)
483 pTmr->flags |= TMRF_WAITING;
484
485 if (pTmr->flags & TMRF_RIT)
486 {
487 // Hard coded call here, inside raw input thread.
488 pTmr->pfn(NULL, WM_SYSTIMER, pTmr->nID, (LPARAM)pTmr);
489 }
490 else
491 {
492 pTmr->flags |= TMRF_READY; // Set timer ready to be ran.
493 // Set thread message queue for this timer.
494 if (pTmr->pti)
495 { // Wakeup thread
496 pTmr->pti->cTimersReady++;
497 ASSERT(pTmr->pti->pEventQueueServer != NULL);
498 MsqWakeQueue(pTmr->pti, QS_TIMER, TRUE);
499 }
500 }
501 }
502 pTmr->cmsCountdown = pTmr->cmsRate;
503 }
504 else
505 pTmr->cmsCountdown -= Time - TimeLast;
506 }
507
508 pLE = pLE->Flink;
509 }
510
511 // Restart the timer thread!
514
515 TimeLast = Time;
516
517 TimerLeave();
518 TRACE("TimerCount = %d\n", TimerCount);
519}
520
523{
524 PLIST_ENTRY pLE;
525 PTIMER pTmr;
526 BOOL TimersRemoved = FALSE;
527
528 if (Window == NULL)
529 return FALSE;
530
532 pLE = TimersListHead.Flink;
533 while(pLE != &TimersListHead)
534 {
535 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
536 pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
537 if ((pTmr) && (pTmr->pti == pti) && (pTmr->pWnd == Window))
538 {
539 TimersRemoved = RemoveTimer(pTmr);
540 }
541 }
542
543 TimerLeave();
544
545 return TimersRemoved;
546}
547
550{
552 PTIMER pTmr;
553 BOOL TimersRemoved = FALSE;
554
556
557 while(pLE != &TimersListHead)
558 {
559 pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
560 pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
561 if ((pTmr) && (pTmr->pti == pti))
562 {
563 TimersRemoved = RemoveTimer(pTmr);
564 }
565 }
566
567 TimerLeave();
568
569 return TimersRemoved;
570}
571
573IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
574{
575 PTIMER pTmr = NULL;
576 TRACE("IntKillTimer Window %p id %uI systemtimer %s\n",
577 Window, IDEvent, SystemTimer ? "TRUE" : "FALSE");
578
580 pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0);
581
582 if (pTmr)
583 {
584 RemoveTimer(pTmr);
585 }
586 TimerLeave();
587
588 return pTmr ? TRUE : FALSE;
589}
590
591CODE_SEG("INIT")
593NTAPI
595{
596 ULONG BitmapBytes;
597
598 /* Allocate FAST_MUTEX from non paged pool */
600 if (!Mutex)
601 {
603 }
604
606
607 BitmapBytes = ALIGN_UP_BY(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
610 {
611 return STATUS_UNSUCCESSFUL;
612 }
613
616 BitmapBytes * 8);
617
618 /* Yes we need this, since ExAllocatePoolWithTag isn't supposed to zero out allocated memory */
620
623
624 return STATUS_SUCCESS;
625}
626
630(
631 HWND hWnd,
632 UINT_PTR nIDEvent,
633 UINT uElapse,
634 TIMERPROC lpTimerFunc
635)
636{
637 PWND Window = NULL;
639
640 TRACE("Enter NtUserSetTimer\n");
643
644 ret = IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND);
645
646 UserLeave();
647 TRACE("Leave NtUserSetTimer, ret=%u\n", ret);
648
649 return ret;
650}
651
652
653BOOL
656(
657 HWND hWnd,
658 UINT_PTR uIDEvent
659)
660{
661 PWND Window = NULL;
662 BOOL ret;
663
664 TRACE("Enter NtUserKillTimer\n");
667
668 ret = IntKillTimer(Window, uIDEvent, FALSE);
669
670 UserLeave();
671
672 TRACE("Leave NtUserKillTimer, ret=%i\n", ret);
673 return ret;
674}
675
676
680 HWND hWnd,
681 UINT_PTR nIDEvent,
682 UINT uElapse,
683 TIMERPROC lpTimerFunc
684)
685{
687
689 TRACE("Enter NtUserSetSystemTimer\n");
690
691 ret = IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM);
692
693 UserLeave();
694
695 TRACE("Leave NtUserSetSystemTimer, ret=%u\n", ret);
696 return ret;
697}
698
699BOOL
703{
704 BOOL Ret = FALSE;
705
707
709
710 UserLeave();
711 return Ret;
712}
713
714/* EOF */
#define CODE_SEG(...)
#define ALIGN_UP_BY(size, align)
Type
Definition: Type.h:7
HWND hWnd
Definition: settings.c:17
LONG NTSTATUS
Definition: precomp.h:26
#define ERR(fmt,...)
Definition: debug.h:110
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:103
Definition: Mutex.h:16
struct @1632 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define WM_SYSTIMER
Definition: comctl32.h:119
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APIENTRY
Definition: api.h:79
#define CALLBACK
Definition: compat.h:35
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
PSERVERINFO gpsi
Definition: imm.c:18
#define EngGetTickCount32()
Definition: eng.h:43
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
#define NonPagedPool
Definition: env_spec_w32.h:307
ULONG ERESOURCE
Definition: env_spec_w32.h:594
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
return pRequest CreateTimer()
ULONG Handle
Definition: gdb_input.c:15
GLbitfield flags
Definition: glext.h:7161
#define TIF_INCLEANUP
Definition: ntuser.h:263
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
@ TYPE_TIMER
Definition: ntuser.h:56
#define UserHMSetHandle(obj, handle)
Definition: ntuser.h:231
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP)
NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP, ULONG, ULONG)
#define ASSERT(a)
Definition: mode.c:44
static PLARGE_INTEGER Time
Definition: time.c:105
VOID FASTCALL ClearMsgBitsMask(PTHREADINFO pti, UINT MessageBits)
Definition: msgqueue.c:445
WPARAM FASTCALL MsqGetDownKeyState(PUSER_MESSAGE_QUEUE MessageQueue)
Definition: msgqueue.c:338
VOID FASTCALL MsqPostMessage(PTHREADINFO pti, MSG *Msg, BOOLEAN HardwareMessage, DWORD MessageBits, DWORD dwQEvent, LONG_PTR ExtraInfo)
Definition: msgqueue.c:1337
VOID CALLBACK HungAppSysTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: msgqueue.c:2181
VOID FASTCALL MsqWakeQueue(PTHREADINFO pti, DWORD MessageBits, BOOL KeyEvent)
Definition: msgqueue.c:412
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define FASTCALL
Definition: nt_native.h:50
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:251
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:235
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:242
#define FLASHW_SYSTIMER
Definition: painting.h:4
long LONG
Definition: pedump.c:60
#define WM_MOUSEHOVER
Definition: commctrl.h:4974
VOID NTAPI RtlClearBit(_In_ PRTL_BITMAP BitMapHeader, _In_ BITMAP_INDEX BitNumber)
Definition: bitmap.c:294
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwTime
Definition: solitaire.cpp:27
Definition: window.c:28
PWND spwndTrack
Definition: desktop.h:31
DWORD htEx
Definition: desktop.h:32
RECT rcMouseHover
Definition: desktop.h:33
DWORD dwDTFlags
Definition: desktop.h:12
Definition: typedefs.h:120
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
struct _DESKTOP * rpdesk
Definition: ntuser.h:194
PPROCESSINFO ppi
Definition: win32.h:88
PKEVENT pEventQueueServer
Definition: win32.h:125
UINT cTimersReady
Definition: win32.h:110
FLONG TIF_flags
Definition: win32.h:95
Definition: timer.h:4
INT cmsRate
Definition: timer.h:11
TIMERPROC pfn
Definition: timer.h:13
UINT_PTR nID
Definition: timer.h:9
PWND pWnd
Definition: timer.h:8
LIST_ENTRY ptmrList
Definition: timer.h:6
INT cmsCountdown
Definition: timer.h:10
PTHREADINFO pti
Definition: timer.h:7
FLONG flags
Definition: timer.h:12
Definition: ntuser.h:694
DWORD ExStyle
Definition: ntuser.h:704
THRDESKHEAD head
Definition: ntuser.h:695
RECT rcClient
Definition: ntuser.h:717
LPARAM lParam
Definition: winuser.h:3117
LONG right
Definition: windef.h:308
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
Definition: timerobj.c:281
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
BOOL FASTCALL IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
Definition: painting.c:1304
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:122
int ret
_In_ WDFTIMER _In_ LONGLONG DueTime
Definition: wdftimer.h:190
FORCEINLINE BOOL RECTL_bPointInRect(_In_ const RECTL *prcl, _In_ INT x, _In_ INT y)
Definition: rect.h:52
#define DF_TME_HOVER
Definition: desktop.h:47
PTHREADINFO ptiRawInput
Definition: input.c:15
PKTIMER MasterTimer
Definition: input.c:16
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1345
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:717
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
Definition: object.c:568
#define TAG_INTERNAL_SYNC
Definition: tags.h:18
#define TAG_TIMERBMP
Definition: tags.h:10
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Definition: timer.c:150
BOOL FASTCALL PostTimerMessages(PWND Window)
Definition: timer.c:395
VOID CALLBACK SystemTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: timer.c:280
#define IntLockWindowlessTimerBitmap()
Definition: timer.c:29
static PFAST_MUTEX Mutex
Definition: timer.c:22
PTIMER FASTCALL FindSystemTimer(PMSG pMsg)
Definition: timer.c:126
UINT_PTR APIENTRY NtUserSetSystemTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc)
Definition: timer.c:679
NTSTATUS NTAPI InitTimerImpl(VOID)
Definition: timer.c:594
#define TimerLeave()
Definition: timer.c:41
#define IntUnlockWindowlessTimerBitmap()
Definition: timer.c:32
static LIST_ENTRY TimersListHead
Definition: timer.c:16
UINT_PTR FASTCALL SystemTimerSet(PWND Window, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc)
Definition: timer.c:379
static BOOL FASTCALL RemoveTimer(PTIMER pTmr)
Definition: timer.c:70
BOOL APIENTRY NtUserValidateTimerCallback(LPARAM lParam)
Definition: timer.c:701
static LONG TimeLast
Definition: timer.c:17
static ULONG HintIndex
Definition: timer.c:25
UINT_PTR APIENTRY NtUserSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc)
Definition: timer.c:630
VOID FASTCALL ProcessTimers(VOID)
Definition: timer.c:446
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:573
PTIMER FASTCALL FindTimer(PWND Window, UINT_PTR nID, UINT flags)
Definition: timer.c:96
BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
Definition: timer.c:522
#define NUM_WINDOW_LESS_TIMERS
Definition: timer.c:20
BOOL APIENTRY NtUserKillTimer(HWND hWnd, UINT_PTR uIDEvent)
Definition: timer.c:656
static RTL_BITMAP WindowLessTimersBitMap
Definition: timer.c:23
#define TimerEnterExclusive()
Definition: timer.c:35
static PVOID WindowLessTimersBitMapBuffer
Definition: timer.c:24
VOID FASTCALL StartTheTimers(VOID)
Definition: timer.c:368
BOOL FASTCALL DestroyTimersForThread(PTHREADINFO pti)
Definition: timer.c:549
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
ERESOURCE TimerLock
Definition: timer.c:27
#define TMRF_SYSTEM
Definition: timer.h:20
#define TMRF_READY
Definition: timer.h:19
#define TMRF_INIT
Definition: timer.h:22
#define TMRF_RIT
Definition: timer.h:21
#define TMRF_TIFROMWND
Definition: timer.h:25
#define ID_EVENT_SYSTIMER_MOUSEHOVER
Definition: timer.h:27
#define TMRF_WAITING
Definition: timer.h:24
#define TMRF_ONESHOT
Definition: timer.h:23
#define ID_EVENT_SYSTIMER_FLASHWIN
Definition: timer.h:28
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define ERROR_NO_SYSTEM_RESOURCES
Definition: winerror.h:931
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
#define QS_TIMER
Definition: winuser.h:878
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:882
#define USER_TIMER_MAXIMUM
Definition: winuser.h:905
#define WM_TIMER
Definition: winuser.h:1742
#define HTCLIENT
Definition: winuser.h:2475
#define USER_TIMER_MINIMUM
Definition: winuser.h:906
#define QS_POSTMESSAGE
Definition: winuser.h:877
VOID(CALLBACK * TIMERPROC)(HWND, UINT, UINT_PTR, DWORD)
Definition: winuser.h:2897
#define WM_NCMOUSEHOVER
Definition: winuser.h:1841
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
* PFAST_MUTEX
Definition: extypes.h:17
FAST_MUTEX
Definition: extypes.h:17
#define PsGetCurrentProcess
Definition: psfuncs.h:17