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
◆ MAX_WINDOW_LESS_TIMER_ID
#define MAX_WINDOW_LESS_TIMER_ID (32768 - 1) |
◆ NUM_WINDOW_LESS_TIMERS
#define NUM_WINDOW_LESS_TIMERS (32768 - 256) |
◆ TimerEnterExclusive
#define TimerEnterExclusive |
( |
| ) |
|
Value:{ \
KeEnterCriticalRegion(); \
}
Definition at line 39 of file timer.c.
◆ TimerLeave
Value:{ \
KeLeaveCriticalRegion(); \
}
Definition at line 45 of file timer.c.
◆ CreateTimer()
Definition at line 56 of file timer.c.
57{
60
62 if (Ret)
63 {
66 }
67
68 return Ret;
69}
#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 555 of file timer.c.
556{
560
562
564 {
567 if ((pTmr) && (pTmr->
pti == pti))
568 {
570 }
571 }
572
574
575 return TimersRemoved;
576}
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 101 of file timer.c.
104{
107
111 {
113
114 if ( pTmr->
nID == nID &&
117 {
118 RetTmr = pTmr;
119 break;
120 }
121
123 }
125
126 return RetTmr;
127}
Referenced by IntKillTimer(), and IntSetTimer().
◆ InitTimerImpl()
Definition at line 600 of file timer.c.
601{
603
604
607 {
609 }
610
612
616 {
618 }
619
623
624
626
629
631}
#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 579 of file timer.c.
580{
582 TRACE(
"IntKillTimer Window %p id %uI systemtimer %s\n",
583 Window, IDEvent, SystemTimer ?
"TRUE" :
"FALSE");
584
587
588 if (pTmr)
589 {
591 }
593
595}
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 182 of file timer.c.
187{
193
194#if 0
195
197 {
198 TRACE(
"Adjusting uElapse\n");
199 Elapse = 1;
200 }
201#else
202
204 {
205 TRACE(
"Adjusting uElapse\n");
207 }
208#endif
209
210
212 {
213 TRACE(
"Adjusting uElapse\n");
215 }
216
217
218
219 if ((
Window) && (IDEvent == 0))
220 Ret = 1;
221
223
225 {
227
231 {
233 ERR(
"Unable to find a free window-less timer id\n");
235 return 0;
236 }
237
240 Ret = IDEvent;
241
243 }
244
245 if (!pTmr)
246 {
248 if (!pTmr) return 0;
249
251 pTmr->
pti =
Window->head.pti->pEThread->Tcb.Win32Thread;
252 else
253 {
256 else
258 }
259
263 pTmr->
pfn = TimerFunc;
266 }
267 else
268 {
271 }
272
274
277
278 return Ret;
279}
#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 IntLockWindowlessTimerBitmap()
#define IntUnlockWindowlessTimerBitmap()
#define MAX_WINDOW_LESS_TIMER_ID
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 661 of file timer.c.
666{
669
670 TRACE(
"Enter NtUserKillTimer\n");
673
675
677
678 TRACE(
"Leave NtUserKillTimer, ret=%i\n",
ret);
680}
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 685 of file timer.c.
691{
693
695 TRACE(
"Enter NtUserSetSystemTimer\n");
696
698
700
701 TRACE(
"Leave NtUserSetSystemTimer, ret=%u\n",
ret);
703}
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Referenced by SetSystemTimer().
◆ NtUserSetTimer()
Definition at line 635 of file timer.c.
642{
645
646 TRACE(
"Enter NtUserSetTimer\n");
649
651
653 TRACE(
"Leave NtUserSetTimer, ret=%u\n",
ret);
654
656}
Referenced by SetTimer().
◆ NtUserValidateTimerCallback()
Definition at line 707 of file timer.c.
709{
711
713
715
717 return Ret;
718}
VOID FASTCALL UserEnterShared(VOID)
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Referenced by DispatchMessageA(), and DispatchMessageW().
◆ PostTimerMessages()
Definition at line 401 of file timer.c.
402{
408
410
414 {
417 (pTmr->
pti == pti) &&
419 {
425
427
429 pTmr->
flags &= ~TMRF_READY;
432
433
435 {
438 }
439 break;
440 }
441
443 }
444
446
447 return Hit;
448}
#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 452 of file timer.c.
453{
459
463
465
467 {
469 TimerCount++;
471 {
474 continue;
475 }
476
478 {
479 pTmr->
flags &= ~TMRF_INIT;
480 }
481 else
482 {
484 {
487 {
490
492 {
493
495 }
496 else
497 {
499
501 {
505 }
506 }
507 }
509 }
510 else
512 }
513
515 }
516
517
520
522
524 TRACE(
"TimerCount = %d\n", TimerCount);
525}
static PLARGE_INTEGER Time
VOID FASTCALL MsqWakeQueue(PTHREADINFO pti, DWORD MessageBits, BOOL KeyEvent)
PKEVENT pEventQueueServer
Referenced by RawInputThreadMain().
◆ RemoveTimer()
◆ StartTheTimers()
Definition at line 374 of file timer.c.
375{
376
377
379
380
381}
VOID CALLBACK HungAppSysTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Referenced by RawInputThreadMain().
◆ SystemTimerProc()
Definition at line 286 of file timer.c.
290{
293
295 {
297 if (!pWnd)
298 {
299 ERR(
"System Timer Proc has invalid window handle! %p Id: %u\n",
hwnd, idEvent);
300 return;
301 }
302 }
303 else
304 {
305 TRACE(
"Windowless Timer Running!\n" );
306 return;
307 }
308
309 switch (idEvent)
310 {
311
312
313
315 {
319
323 {
326 {
328 {
331
333 {
335 }
336 else
339 }
340 else
341 {
344 }
345 TRACE(
"Generating WM_NCMOUSEHOVER\n");
348 break;
349 }
350 }
351 }
352 return;
353
355 {
356 FLASHWINFO fwi =
357 {sizeof(FLASHWINFO),
360
362 }
363 return;
364
365 default:
366 ERR(
"System Timer Proc invalid id %u!\n", idEvent);
367 break;
368 }
370}
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 385 of file timer.c.
389{
391 {
393 TRACE(
"SysemTimerSet: Access Denied!\n");
394 return 0;
395 }
397}
#define ERROR_ACCESS_DENIED
#define PsGetCurrentProcess
◆ ValidateTimerCallback()
◆ HintIndex
◆ Mutex
◆ TimeLast
◆ TimerLock
◆ TimersListHead
◆ WindowLessTimersBitMap
◆ WindowLessTimersBitMapBuffer
PVOID WindowLessTimersBitMapBuffer |
|
static |