Go to the source code of this file.
|
| DBG_DEFAULT_CHANNEL (UserTimer) |
|
static PTIMER FASTCALL | CreateTimer (VOID) |
|
static BOOL FASTCALL | RemoveTimer (PTIMER pTmr) |
|
PTIMER FASTCALL | FindTimer (PWND Window, UINT_PTR nID, UINT flags) |
|
PTIMER FASTCALL | FindSystemTimer (PMSG pMsg) |
|
BOOL FASTCALL | ValidateTimerCallback (PTHREADINFO pti, LPARAM lParam) |
|
UINT_PTR FASTCALL | IntSetTimer (PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type) |
|
VOID CALLBACK | SystemTimerProc (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) |
|
VOID FASTCALL | StartTheTimers (VOID) |
|
UINT_PTR FASTCALL | SystemTimerSet (PWND Window, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc) |
|
BOOL FASTCALL | PostTimerMessages (PWND Window) |
|
VOID FASTCALL | ProcessTimers (VOID) |
|
BOOL FASTCALL | DestroyTimersForWindow (PTHREADINFO pti, PWND Window) |
|
BOOL FASTCALL | DestroyTimersForThread (PTHREADINFO pti) |
|
BOOL FASTCALL | IntKillTimer (PWND Window, UINT_PTR IDEvent, BOOL SystemTimer) |
|
NTSTATUS NTAPI | InitTimerImpl (VOID) |
|
UINT_PTR APIENTRY | NtUserSetTimer (HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc) |
|
BOOL APIENTRY | NtUserKillTimer (HWND hWnd, UINT_PTR uIDEvent) |
|
UINT_PTR APIENTRY | NtUserSetSystemTimer (HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc) |
|
BOOL APIENTRY | NtUserValidateTimerCallback (LPARAM lParam) |
|
◆ HINTINDEX_BEGIN_VALUE
#define HINTINDEX_BEGIN_VALUE 0 |
◆ IntLockWindowlessTimerBitmap
◆ IntUnlockWindowlessTimerBitmap
◆ NUM_WINDOW_LESS_TIMERS
#define NUM_WINDOW_LESS_TIMERS 32768 |
◆ TimerEnterExclusive
#define TimerEnterExclusive |
( |
| ) |
|
Value:{ \
KeEnterCriticalRegion(); \
}
Definition at line 37 of file timer.c.
◆ TimerLeave
Value:{ \
KeLeaveCriticalRegion(); \
}
Definition at line 43 of file timer.c.
◆ CreateTimer()
Definition at line 54 of file timer.c.
55{
58
60 if (Ret)
61 {
64 }
65
66 return Ret;
67}
#define InsertTailList(ListHead, Entry)
#define UserHMSetHandle(obj, handle)
PUSER_HANDLE_TABLE gHandleTable
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
static LIST_ENTRY TimersListHead
◆ DBG_DEFAULT_CHANNEL()
DBG_DEFAULT_CHANNEL |
( |
UserTimer |
| ) |
|
◆ DestroyTimersForThread()
Definition at line 556 of file timer.c.
557{
561
563
565 {
568 if ((pTmr) && (pTmr->
pti == pti))
569 {
571 }
572 }
573
575
576 return TimersRemoved;
577}
struct _LIST_ENTRY * Flink
#define CONTAINING_RECORD(address, type, field)
static BOOL FASTCALL RemoveTimer(PTIMER pTmr)
#define TimerEnterExclusive()
Referenced by ExitThreadCallback().
◆ DestroyTimersForWindow()
◆ FindSystemTimer()
◆ FindTimer()
Definition at line 98 of file timer.c.
101{
104
108 {
110
111 if ( pTmr->
nID == nID &&
114 {
115 RetTmr = pTmr;
116 break;
117 }
118
120 }
122
123 return RetTmr;
124}
Referenced by IntKillTimer(), and IntSetTimer().
◆ InitTimerImpl()
Definition at line 601 of file timer.c.
602{
604
605
608 {
610 }
611
613
617 {
619 }
620
624
625
627
630
632}
#define ALIGN_UP_BY(size, align)
#define RtlInitializeBitMap
#define ExAllocatePoolWithTag(hernya, size, tag)
NTSTATUS ExInitializeResourceLite(PULONG res)
#define InitializeListHead(ListHead)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
#define NUM_WINDOW_LESS_TIMERS
static RTL_BITMAP WindowLessTimersBitMap
static PVOID WindowLessTimersBitMapBuffer
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Referenced by DriverEntry().
◆ IntKillTimer()
Definition at line 580 of file timer.c.
581{
583 TRACE(
"IntKillTimer Window %p id %uI systemtimer %s\n",
584 Window, IDEvent, SystemTimer ?
"TRUE" :
"FALSE");
585
588
589 if (pTmr)
590 {
592 }
594
596}
PTIMER FASTCALL FindTimer(PWND Window, UINT_PTR nID, UINT flags)
Referenced by co_UserHideCaret(), IntFlashWindowEx(), IntRemoveTrackMouseEvent(), IntTrackMouseEvent(), IntTrackMouseMove(), NtUserCallHwndParam(), NtUserCreateCaret(), NtUserKillTimer(), and SystemTimerProc().
◆ IntSetTimer()
Definition at line 179 of file timer.c.
184{
190
191#if 0
192
194 {
195 TRACE(
"Adjusting uElapse\n");
196 Elapse = 1;
197 }
198#else
199
201 {
202 TRACE(
"Adjusting uElapse\n");
204 }
205#endif
206
207
209 {
210 TRACE(
"Adjusting uElapse\n");
212 }
213
214
215
216 if ((
Window) && (IDEvent == 0))
217 Ret = 1;
218
220
222 {
224
227 {
230 }
232 {
234 ERR(
"Unable to find a free window-less timer id\n");
236 return 0;
237 }
238
241 Ret = IDEvent;
242
244 }
245
246 if (!pTmr)
247 {
249 if (!pTmr) return 0;
250
252 pTmr->
pti =
Window->head.pti->pEThread->Tcb.Win32Thread;
253 else
254 {
257 else
259 }
260
264 pTmr->
pfn = TimerFunc;
267 }
268 else
269 {
272 }
273
275
278
279 return Ret;
280}
#define RtlFindClearBitsAndSet
return pRequest CreateTimer()
unsigned __int3264 UINT_PTR
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
struct _LIST_ENTRY * Blink
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
_In_ WDFTIMER _In_ LONGLONG DueTime
#define HINTINDEX_BEGIN_VALUE
#define IntLockWindowlessTimerBitmap()
#define IntUnlockWindowlessTimerBitmap()
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
#define ERROR_NO_SYSTEM_RESOURCES
#define USER_TIMER_MAXIMUM
#define USER_TIMER_MINIMUM
Referenced by co_IntSetCaretPos(), co_UserShowCaret(), IntFlashWindowEx(), IntTrackMouseEvent(), IntTrackMouseMove(), NtUserCreateCaret(), NtUserSetSystemTimer(), NtUserSetTimer(), StartTheTimers(), and SystemTimerSet().
◆ NtUserKillTimer()
Definition at line 662 of file timer.c.
667{
670
671 TRACE(
"Enter NtUserKillTimer\n");
674
676
678
679 TRACE(
"Leave NtUserKillTimer, ret=%i\n",
ret);
681}
VOID FASTCALL UserLeave(VOID)
VOID FASTCALL UserEnterExclusive(VOID)
PWND FASTCALL UserGetWindowObject(HWND hWnd)
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Referenced by KillTimer().
◆ NtUserSetSystemTimer()
Definition at line 686 of file timer.c.
692{
694
696 TRACE(
"Enter NtUserSetSystemTimer\n");
697
699
701
702 TRACE(
"Leave NtUserSetSystemTimer, ret=%u\n",
ret);
704}
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Referenced by SetSystemTimer().
◆ NtUserSetTimer()
Definition at line 636 of file timer.c.
643{
646
647 TRACE(
"Enter NtUserSetTimer\n");
650
652
654 TRACE(
"Leave NtUserSetTimer, ret=%u\n",
ret);
655
657}
Referenced by SetTimer().
◆ NtUserValidateTimerCallback()
Definition at line 708 of file timer.c.
710{
712
714
716
718 return Ret;
719}
VOID FASTCALL UserEnterShared(VOID)
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Referenced by DispatchMessageA(), and DispatchMessageW().
◆ PostTimerMessages()
Definition at line 402 of file timer.c.
403{
409
411
415 {
418 (pTmr->
pti == pti) &&
420 {
426
428
430 pTmr->
flags &= ~TMRF_READY;
433
434
436 {
439 }
440 break;
441 }
442
444 }
445
447
448 return Hit;
449}
#define EngGetTickCount32()
#define RemoveEntryList(Entry)
#define UserHMGetHandle(obj)
VOID FASTCALL ClearMsgBitsMask(PTHREADINFO pti, UINT MessageBits)
VOID FASTCALL MsqPostMessage(PTHREADINFO pti, MSG *Msg, BOOLEAN HardwareMessage, DWORD MessageBits, DWORD dwQEvent, LONG_PTR ExtraInfo)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define QS_ALLPOSTMESSAGE
Referenced by co_IntPeekMessage().
◆ ProcessTimers()
Definition at line 453 of file timer.c.
454{
460
464
466
468 {
470 TimerCount++;
472 {
475 continue;
476 }
477
479 {
480 pTmr->
flags &= ~TMRF_INIT;
481 }
482 else
483 {
485 {
488 {
491
493 {
494
496 }
497 else
498 {
500
502 {
506 }
507 }
508 }
510 }
511 else
513 }
514
516 }
517
518
521
523
525 TRACE(
"TimerCount = %d\n", TimerCount);
526}
static PLARGE_INTEGER Time
VOID FASTCALL MsqWakeQueue(PTHREADINFO pti, DWORD MessageBits, BOOL KeyEvent)
PKEVENT pEventQueueServer
Referenced by RawInputThreadMain().
◆ RemoveTimer()
◆ StartTheTimers()
Definition at line 375 of file timer.c.
376{
377
378
380
381
382}
VOID CALLBACK HungAppSysTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Referenced by RawInputThreadMain().
◆ SystemTimerProc()
Definition at line 287 of file timer.c.
291{
294
296 {
298 if (!pWnd)
299 {
300 ERR(
"System Timer Proc has invalid window handle! %p Id: %u\n",
hwnd, idEvent);
301 return;
302 }
303 }
304 else
305 {
306 TRACE(
"Windowless Timer Running!\n" );
307 return;
308 }
309
310 switch (idEvent)
311 {
312
313
314
316 {
320
324 {
327 {
329 {
332
334 {
336 }
337 else
340 }
341 else
342 {
345 }
346 TRACE(
"Generating WM_NCMOUSEHOVER\n");
349 break;
350 }
351 }
352 }
353 return;
354
356 {
357 FLASHWINFO fwi =
358 {sizeof(FLASHWINFO),
361
363 }
364 return;
365
366 default:
367 ERR(
"System Timer Proc invalid id %u!\n", idEvent);
368 break;
369 }
371}
WPARAM FASTCALL MsqGetDownKeyState(PUSER_MESSAGE_QUEUE MessageQueue)
BOOL FASTCALL IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
FORCEINLINE BOOL RECTL_bPointInRect(_In_ const RECTL *prcl, _In_ INT x, _In_ INT y)
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
#define ID_EVENT_SYSTIMER_MOUSEHOVER
#define ID_EVENT_SYSTIMER_FLASHWIN
Referenced by IntFlashWindowEx(), IntTrackMouseEvent(), and IntTrackMouseMove().
◆ SystemTimerSet()
Definition at line 386 of file timer.c.
390{
392 {
394 TRACE(
"SysemTimerSet: Access Denied!\n");
395 return 0;
396 }
398}
#define ERROR_ACCESS_DENIED
#define PsGetCurrentProcess
◆ ValidateTimerCallback()
◆ HintIndex
◆ Mutex
◆ TimeLast
◆ TimerLock
◆ TimersListHead
◆ WindowLessTimersBitMap
◆ WindowLessTimersBitMapBuffer
PVOID WindowLessTimersBitMapBuffer |
|
static |