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) |
|
◆ IntLockWindowlessTimerBitmap
◆ IntUnlockWindowlessTimerBitmap
◆ NUM_WINDOW_LESS_TIMERS
#define NUM_WINDOW_LESS_TIMERS 32768 |
◆ TimerEnterExclusive
#define TimerEnterExclusive |
( |
| ) |
|
Value:{ \
KeEnterCriticalRegion(); \
}
Definition at line 35 of file timer.c.
◆ TimerLeave
Value:{ \
KeLeaveCriticalRegion(); \
}
Definition at line 41 of file timer.c.
◆ CreateTimer()
Definition at line 52 of file timer.c.
53{
56
58 if (Ret)
59 {
62 }
63
64 return Ret;
65}
#define InsertTailList(ListHead, Entry)
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 549 of file timer.c.
550{
554
556
558 {
561 if ((pTmr) && (pTmr->
pti == pti))
562 {
564 }
565 }
566
568
569 return TimersRemoved;
570}
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 96 of file timer.c.
99{
102
106 {
108
109 if ( pTmr->
nID == nID &&
112 {
113 RetTmr = pTmr;
114 break;
115 }
116
118 }
120
121 return RetTmr;
122}
Referenced by IntKillTimer(), and IntSetTimer().
◆ InitTimerImpl()
Definition at line 594 of file timer.c.
595{
597
598
601 {
603 }
604
606
610 {
612 }
613
616 BitmapBytes * 8);
617
618
620
623
625}
#define ALIGN_UP_BY(size, align)
#define ExAllocatePoolWithTag(hernya, size, tag)
NTSTATUS ExInitializeResourceLite(PULONG res)
#define InitializeListHead(ListHead)
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP)
#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 573 of file timer.c.
574{
576 TRACE(
"IntKillTimer Window %p id %uI systemtimer %s\n",
577 Window, IDEvent, SystemTimer ?
"TRUE" :
"FALSE");
578
581
582 if (pTmr)
583 {
585 }
587
589}
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 177 of file timer.c.
182{
187
188#if 0
189
191 {
192 TRACE(
"Adjusting uElapse\n");
193 Elapse = 1;
194 }
195#else
196
198 {
199 TRACE(
"Adjusting uElapse\n");
201 }
202#endif
203
204
206 {
207 TRACE(
"Adjusting uElapse\n");
209 }
210
211
212
213 if ((
Window) && (IDEvent == 0))
214 Ret = 1;
215
217
219 {
221
223
225 {
227 ERR(
"Unable to find a free window-less timer id\n");
230 return 0;
231 }
232
234 Ret = IDEvent;
235
237 }
238
239 if (!pTmr)
240 {
242 if (!pTmr) return 0;
243
245 pTmr->
pti =
Window->head.pti->pEThread->Tcb.Win32Thread;
246 else
247 {
250 else
252 }
253
257 pTmr->
pfn = TimerFunc;
260 }
261 else
262 {
265 }
266
268
271
272 return Ret;
273}
return pRequest CreateTimer()
NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP, ULONG, ULONG)
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 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 655 of file timer.c.
660{
663
664 TRACE(
"Enter NtUserKillTimer\n");
667
669
671
672 TRACE(
"Leave NtUserKillTimer, ret=%i\n",
ret);
674}
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 679 of file timer.c.
685{
687
689 TRACE(
"Enter NtUserSetSystemTimer\n");
690
692
694
695 TRACE(
"Leave NtUserSetSystemTimer, ret=%u\n",
ret);
697}
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Referenced by SetSystemTimer().
◆ NtUserSetTimer()
Definition at line 629 of file timer.c.
636{
639
640 TRACE(
"Enter NtUserSetTimer\n");
643
645
647 TRACE(
"Leave NtUserSetTimer, ret=%u\n",
ret);
648
650}
Referenced by SetTimer().
◆ NtUserValidateTimerCallback()
Definition at line 701 of file timer.c.
703{
705
707
709
711 return Ret;
712}
VOID FASTCALL UserEnterShared(VOID)
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Referenced by DispatchMessageA(), and DispatchMessageW().
◆ PostTimerMessages()
Definition at line 395 of file timer.c.
396{
402
404
408 {
411 (pTmr->
pti == pti) &&
413 {
419
421
423 pTmr->
flags &= ~TMRF_READY;
426
427
429 {
432 }
433 break;
434 }
435
437 }
438
440
441 return Hit;
442}
#define EngGetTickCount32()
#define RemoveEntryList(Entry)
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 446 of file timer.c.
447{
453
457
459
461 {
463 TimerCount++;
465 {
468 continue;
469 }
470
472 {
473 pTmr->
flags &= ~TMRF_INIT;
474 }
475 else
476 {
478 {
481 {
484
486 {
487
489 }
490 else
491 {
493
495 {
499 }
500 }
501 }
503 }
504 else
506 }
507
509 }
510
511
514
516
518 TRACE(
"TimerCount = %d\n", TimerCount);
519}
static PLARGE_INTEGER Time
VOID FASTCALL MsqWakeQueue(PTHREADINFO pti, DWORD MessageBits, BOOL KeyEvent)
PKEVENT pEventQueueServer
Referenced by RawInputThreadMain().
◆ RemoveTimer()
Definition at line 70 of file timer.c.
71{
73 if (pTmr)
74 {
75
78 {
80
85 }
88 }
89 if (!Ret)
ERR(
"Warning: Unable to delete timer\n");
90
91 return Ret;
92}
#define UserHMGetHandle(obj)
VOID NTAPI RtlClearBit(_In_ PRTL_BITMAP BitMapHeader, _In_ BITMAP_INDEX BitNumber)
BOOL FASTCALL UserDereferenceObject(PVOID Object)
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Referenced by DestroyTimersForThread(), DestroyTimersForWindow(), and IntKillTimer().
◆ StartTheTimers()
Definition at line 368 of file timer.c.
369{
370
371
373
374
375}
VOID CALLBACK HungAppSysTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Referenced by RawInputThreadMain().
◆ SystemTimerProc()
Definition at line 280 of file timer.c.
284{
287
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
307
309 {
313
317 {
320 {
322 {
325
327 {
329 }
330 else
333 }
334 else
335 {
338 }
339 TRACE(
"Generating WM_NCMOUSEHOVER\n");
342 break;
343 }
344 }
345 }
346 return;
347
349 {
350 FLASHWINFO fwi =
351 {sizeof(FLASHWINFO),
354
356 }
357 return;
358
359 default:
360 ERR(
"System Timer Proc invalid id %u!\n", idEvent);
361 break;
362 }
364}
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 379 of file timer.c.
383{
385 {
387 TRACE(
"SysemTimerSet: Access Denied!\n");
388 return 0;
389 }
391}
#define ERROR_ACCESS_DENIED
#define PsGetCurrentProcess
◆ ValidateTimerCallback()
◆ HintIndex
◆ Mutex
◆ TimeLast
◆ TimerLock
◆ TimersListHead
◆ WindowLessTimersBitMap
◆ WindowLessTimersBitMapBuffer
PVOID WindowLessTimersBitMapBuffer |
|
static |