ReactOS  0.4.12-dev-919-gfc3b8d5
timer.c File Reference
#include <win32k.h>
Include dependency graph for timer.c:

Go to the source code of this file.

Macros

#define NUM_WINDOW_LESS_TIMERS   32768
 
#define IntLockWindowlessTimerBitmap()   ExEnterCriticalRegionAndAcquireFastMutexUnsafe(Mutex)
 
#define IntUnlockWindowlessTimerBitmap()   ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(Mutex)
 
#define TimerEnterExclusive()
 
#define TimerLeave()
 

Functions

 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)
 
INIT_FUNCTION 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)
 

Variables

static LIST_ENTRY TimersListHead
 
static LONG TimeLast = 0
 
static PFAST_MUTEX Mutex
 
static RTL_BITMAP WindowLessTimersBitMap
 
static PVOID WindowLessTimersBitMapBuffer
 
static ULONG HintIndex = 1
 
ERESOURCE TimerLock
 

Macro Definition Documentation

◆ IntLockWindowlessTimerBitmap

#define IntLockWindowlessTimerBitmap ( )    ExEnterCriticalRegionAndAcquireFastMutexUnsafe(Mutex)

Definition at line 29 of file timer.c.

◆ IntUnlockWindowlessTimerBitmap

#define IntUnlockWindowlessTimerBitmap ( )    ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(Mutex)

Definition at line 32 of file timer.c.

◆ NUM_WINDOW_LESS_TIMERS

#define NUM_WINDOW_LESS_TIMERS   32768

Definition at line 20 of file timer.c.

◆ TimerEnterExclusive

#define TimerEnterExclusive ( )
Value:
{ \
KeEnterCriticalRegion(); \
ExAcquireResourceExclusiveLite(&TimerLock, TRUE); \
}
#define TRUE
Definition: types.h:120
ERESOURCE TimerLock
Definition: timer.c:27

Definition at line 35 of file timer.c.

◆ TimerLeave

#define TimerLeave ( )
Value:
{ \
ExReleaseResourceLite(&TimerLock); \
KeLeaveCriticalRegion(); \
}
ERESOURCE TimerLock
Definition: timer.c:27

Definition at line 41 of file timer.c.

Function Documentation

◆ CreateTimer()

static PTIMER FASTCALL CreateTimer ( VOID  )
static

Definition at line 52 of file timer.c.

53 {
54  HANDLE Handle;
55  PTIMER Ret = NULL;
56 
58  if (Ret)
59  {
60  Ret->head.h = Handle;
62  }
63 
64  return Ret;
65 }
HANDLE h
Definition: ntuser.h:176
#define InsertTailList(ListHead, Entry)
HEAD head
Definition: timer.h:5
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
Definition: object.c:535
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE Handle
Definition: extypes.h:390
LIST_ENTRY ptmrList
Definition: timer.h:6
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by IntSetTimer().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UserTimer  )

◆ DestroyTimersForThread()

BOOL FASTCALL DestroyTimersForThread ( PTHREADINFO  pti)

Definition at line 553 of file timer.c.

554 {
556  PTIMER pTmr;
557  BOOL TimersRemoved = FALSE;
558 
560 
561  while(pLE != &TimersListHead)
562  {
563  pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
564  pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
565  if ((pTmr) && (pTmr->pti == pti))
566  {
567  TimersRemoved = RemoveTimer(pTmr);
568  }
569  }
570 
571  TimerLeave();
572 
573  return TimersRemoved;
574 }
unsigned int BOOL
Definition: ntddk_ex.h:94
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
PTHREADINFO pti
Definition: timer.h:7
Definition: typedefs.h:117
static BOOL FASTCALL RemoveTimer(PTIMER pTmr)
Definition: timer.c:70
#define TimerEnterExclusive()
Definition: timer.c:35

Referenced by ExitThreadCallback().

◆ DestroyTimersForWindow()

BOOL FASTCALL DestroyTimersForWindow ( PTHREADINFO  pti,
PWND  Window 
)

Definition at line 526 of file timer.c.

527 {
528  PLIST_ENTRY pLE;
529  PTIMER pTmr;
530  BOOL TimersRemoved = FALSE;
531 
532  if (Window == NULL)
533  return FALSE;
534 
536  pLE = TimersListHead.Flink;
537  while(pLE != &TimersListHead)
538  {
539  pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
540  pLE = pLE->Flink; /* get next timer list entry before current timer is removed */
541  if ((pTmr) && (pTmr->pti == pti) && (pTmr->pWnd == Window))
542  {
543  TimersRemoved = RemoveTimer(pTmr);
544  }
545  }
546 
547  TimerLeave();
548 
549  return TimersRemoved;
550 }
PWND pWnd
Definition: timer.h:8
Definition: window.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
PTHREADINFO pti
Definition: timer.h:7
Definition: typedefs.h:117
static BOOL FASTCALL RemoveTimer(PTIMER pTmr)
Definition: timer.c:70
#define TimerEnterExclusive()
Definition: timer.c:35

Referenced by co_UserFreeWindow(), and IntClientShutdown().

◆ FindSystemTimer()

PTIMER FASTCALL FindSystemTimer ( PMSG  pMsg)

Definition at line 126 of file timer.c.

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 }
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
smooth NULL
Definition: ftsmooth.c:416
LPARAM lParam
Definition: winuser.h:3070
LONG_PTR LPARAM
Definition: windef.h:208
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TMRF_SYSTEM
Definition: timer.h:20
Definition: typedefs.h:117
FLONG flags
Definition: timer.h:12
TIMERPROC pfn
Definition: timer.h:13
#define TimerEnterExclusive()
Definition: timer.c:35

Referenced by IntDispatchMessage().

◆ FindTimer()

PTIMER FASTCALL FindTimer ( PWND  Window,
UINT_PTR  nID,
UINT  flags 
)

Definition at line 96 of file timer.c.

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 }
PWND pWnd
Definition: timer.h:8
#define TMRF_RIT
Definition: timer.h:21
Definition: window.c:29
UINT_PTR nID
Definition: timer.h:9
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TMRF_SYSTEM
Definition: timer.h:20
GLbitfield flags
Definition: glext.h:7161
Definition: typedefs.h:117
FLONG flags
Definition: timer.h:12
#define TimerEnterExclusive()
Definition: timer.c:35

Referenced by IntKillTimer(), and IntSetTimer().

◆ InitTimerImpl()

INIT_FUNCTION NTSTATUS NTAPI InitTimerImpl ( VOID  )

Definition at line 598 of file timer.c.

599 {
600  ULONG BitmapBytes;
601 
602  /* Allocate FAST_MUTEX from non paged pool */
604  if (!Mutex)
605  {
607  }
608 
610 
611  BitmapBytes = ALIGN_UP_BY(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
614  {
615  return STATUS_UNSUCCESSFUL;
616  }
617 
620  BitmapBytes * 8);
621 
622  /* Yes we need this, since ExAllocatePoolWithTag isn't supposed to zero out allocated memory */
624 
627 
628  return STATUS_SUCCESS;
629 }
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
Definition: Mutex.h:15
ERESOURCE TimerLock
Definition: timer.c:27
#define NUM_WINDOW_LESS_TIMERS
Definition: timer.c:20
static LIST_ENTRY TimersListHead
Definition: timer.c:16
#define TAG_TIMERBMP
Definition: tags.h:10
smooth NULL
Definition: ftsmooth.c:416
static PVOID WindowLessTimersBitMapBuffer
Definition: timer.c:24
FAST_MUTEX
Definition: extypes.h:17
NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP)
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_INTERNAL_SYNC
Definition: tags.h:18
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
unsigned int ULONG
Definition: retypes.h:1
#define ALIGN_UP_BY(size, align)
return STATUS_SUCCESS
Definition: btrfs.c:2725
static RTL_BITMAP WindowLessTimersBitMap
Definition: timer.c:23

Referenced by DriverEntry().

◆ IntKillTimer()

BOOL FASTCALL IntKillTimer ( PWND  Window,
UINT_PTR  IDEvent,
BOOL  SystemTimer 
)

Definition at line 577 of file timer.c.

578 {
579  PTIMER pTmr = NULL;
580  TRACE("IntKillTimer Window %p id %uI systemtimer %s\n",
581  Window, IDEvent, SystemTimer ? "TRUE" : "FALSE");
582 
584  pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0);
585 
586  if (pTmr)
587  {
588  RemoveTimer(pTmr);
589  }
590  TimerLeave();
591 
592  return pTmr ? TRUE : FALSE;
593 }
#define TRUE
Definition: types.h:120
PTIMER FASTCALL FindTimer(PWND Window, UINT_PTR nID, UINT flags)
Definition: timer.c:96
Definition: window.c:29
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define TMRF_SYSTEM
Definition: timer.h:20
static BOOL FASTCALL RemoveTimer(PTIMER pTmr)
Definition: timer.c:70
#define TimerEnterExclusive()
Definition: timer.c:35

Referenced by co_UserHideCaret(), IntFlashWindowEx(), IntRemoveTrackMouseEvent(), IntTrackMouseEvent(), IntTrackMouseMove(), NtUserCallHwndParam(), NtUserCreateCaret(), NtUserKillTimer(), and SystemTimerProc().

◆ IntSetTimer()

UINT_PTR FASTCALL IntSetTimer ( PWND  Window,
UINT_PTR  IDEvent,
UINT  Elapse,
TIMERPROC  TimerFunc,
INT  Type 
)

Definition at line 177 of file timer.c.

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 
267  ASSERT(MasterTimer != NULL);
268  // Start the timer thread!
269  if (TimersListHead.Flink == TimersListHead.Blink) // There is only one timer
271 
272  return Ret;
273 }
PWND pWnd
Definition: timer.h:8
static ULONG HintIndex
Definition: timer.c:25
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
Definition: timerobj.c:281
Type
Definition: Type.h:6
PKTIMER MasterTimer
Definition: input.c:16
#define USER_TIMER_MINIMUM
Definition: winuser.h:896
_In_ LARGE_INTEGER DueTime
Definition: kefuncs.h:524
struct _LIST_ENTRY * Blink
Definition: typedefs.h:120
INT cmsCountdown
Definition: timer.h:10
#define IntUnlockWindowlessTimerBitmap()
Definition: timer.c:32
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define TMRF_RIT
Definition: timer.h:21
#define ERROR_NO_SYSTEM_RESOURCES
Definition: winerror.h:931
PTIMER FASTCALL FindTimer(PWND Window, UINT_PTR nID, UINT flags)
Definition: timer.c:96
#define NUM_WINDOW_LESS_TIMERS
Definition: timer.c:20
Definition: window.c:29
UINT_PTR nID
Definition: timer.h:9
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
smooth NULL
Definition: ftsmooth.c:416
#define TMRF_INIT
Definition: timer.h:22
PTHREADINFO ptiRawInput
Definition: input.c:15
int64_t LONGLONG
Definition: typedefs.h:66
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
#define TMRF_TIFROMWND
Definition: timer.h:25
#define TMRF_SYSTEM
Definition: timer.h:20
PTHREADINFO pti
Definition: timer.h:7
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
int Window
Definition: x11stubs.h:26
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define USER_TIMER_MAXIMUM
Definition: winuser.h:895
INT cmsRate
Definition: timer.h:11
NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP, ULONG, ULONG)
#define ERR(fmt,...)
Definition: debug.h:109
FLONG flags
Definition: timer.h:12
unsigned int UINT
Definition: ndis.h:50
#define IntLockWindowlessTimerBitmap()
Definition: timer.c:29
TIMERPROC pfn
Definition: timer.h:13
static PTIMER FASTCALL CreateTimer(VOID)
Definition: timer.c:52
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
LONGLONG QuadPart
Definition: typedefs.h:112
static RTL_BITMAP WindowLessTimersBitMap
Definition: timer.c:23

Referenced by co_IntSetCaretPos(), co_UserShowCaret(), IntFlashWindowEx(), IntTrackMouseEvent(), IntTrackMouseMove(), NtUserCreateCaret(), NtUserSetSystemTimer(), NtUserSetTimer(), StartTheTimers(), and SystemTimerSet().

◆ NtUserKillTimer()

BOOL APIENTRY NtUserKillTimer ( HWND  hWnd,
UINT_PTR  uIDEvent 
)

Definition at line 661 of file timer.c.

665 {
666  PWND Window = NULL;
668 
669  TRACE("Enter NtUserKillTimer\n");
672  UserLeave();
673 
674  RETURN(IntKillTimer(Window, uIDEvent, FALSE));
675 
676 CLEANUP:
677  TRACE("Leave NtUserKillTimer, ret=%i\n", _ret_);
678  END_CLEANUP;
679 }
#define CLEANUP
Definition: ntuser.h:5
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:577
HWND hWnd
Definition: settings.c:17
Definition: window.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
Definition: ntuser.h:657
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
#define RETURN(rrr)
Definition: decompress.c:40
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by KillTimer().

◆ NtUserSetSystemTimer()

UINT_PTR APIENTRY NtUserSetSystemTimer ( HWND  hWnd,
UINT_PTR  nIDEvent,
UINT  uElapse,
TIMERPROC  lpTimerFunc 
)

Definition at line 684 of file timer.c.

690 {
692 
693  TRACE("Enter NtUserSetSystemTimer\n");
694 
695  RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM));
696 
697 CLEANUP:
698  TRACE("Leave NtUserSetSystemTimer, ret=%u\n", _ret_);
699  END_CLEANUP;
700 }
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
#define CLEANUP
Definition: ntuser.h:5
HWND hWnd
Definition: settings.c:17
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
#define TRACE(s)
Definition: solgame.cpp:4
#define TMRF_SYSTEM
Definition: timer.h:20
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define RETURN(rrr)
Definition: decompress.c:40
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by SetSystemTimer().

◆ NtUserSetTimer()

UINT_PTR APIENTRY NtUserSetTimer ( HWND  hWnd,
UINT_PTR  nIDEvent,
UINT  uElapse,
TIMERPROC  lpTimerFunc 
)

Definition at line 634 of file timer.c.

640 {
641  PWND Window = NULL;
643 
644  TRACE("Enter NtUserSetTimer\n");
647  UserLeave();
648 
649  RETURN(IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND));
650 
651 CLEANUP:
652  TRACE("Leave NtUserSetTimer, ret=%u\n", _ret_);
653 
654  END_CLEANUP;
655 }
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
#define CLEANUP
Definition: ntuser.h:5
HWND hWnd
Definition: settings.c:17
Definition: window.c:29
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
#define TMRF_TIFROMWND
Definition: timer.h:25
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
Definition: ntuser.h:657
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
#define RETURN(rrr)
Definition: decompress.c:40
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by SetTimer().

◆ NtUserValidateTimerCallback()

BOOL APIENTRY NtUserValidateTimerCallback ( LPARAM  lParam)

Definition at line 704 of file timer.c.

706 {
707  BOOL Ret = FALSE;
708 
709  UserEnterShared();
710 
712 
713  UserLeave();
714  return Ret;
715 }
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:241
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Definition: timer.c:150
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
LPARAM lParam
Definition: combotst.c:139

Referenced by DispatchMessageA(), and DispatchMessageW().

◆ PostTimerMessages()

BOOL FASTCALL PostTimerMessages ( PWND  Window)

Definition at line 395 of file timer.c.

396 {
397  PLIST_ENTRY pLE;
398  MSG Msg;
399  PTHREADINFO pti;
400  BOOL Hit = FALSE;
401  PTIMER pTmr;
402  LARGE_INTEGER TickCount;
403 
405 
407  pLE = TimersListHead.Flink;
408  while(pLE != &TimersListHead)
409  {
410  pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
411  if ( (pTmr->flags & TMRF_READY) &&
412  (pTmr->pti == pti) &&
413  ((pTmr->pWnd == Window) || (Window == NULL)) )
414  {
415  KeQueryTickCount(&TickCount);
416 
417  Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0;
418  Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
419  Msg.wParam = (WPARAM) pTmr->nID;
420  Msg.lParam = (LPARAM) pTmr->pfn;
421  Msg.time = MsqCalculateMessageTime(&TickCount);
422  // Fix all wine win:test_GetMessagePos WM_TIMER tests. See CORE-10867.
423  Msg.pt = gpsi->ptCursor;
424 
426  pTmr->flags &= ~TMRF_READY;
428  Hit = TRUE;
429  // Now move this entry to the end of the list so it will not be
430  // called again in the next msg loop.
431  if (pLE != &TimersListHead)
432  {
433  RemoveEntryList(&pTmr->ptmrList);
435  }
436  break;
437  }
438 
439  pLE = pLE->Flink;
440  }
441 
442  TimerLeave();
443 
444  return Hit;
445 }
PWND pWnd
Definition: timer.h:8
#define TRUE
Definition: types.h:120
#define WM_SYSTIMER
Definition: comctl32.h:111
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:876
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define QS_TIMER
Definition: winuser.h:893
struct @1567 Msg[]
UINT_PTR WPARAM
Definition: windef.h:207
#define InsertTailList(ListHead, Entry)
static __inline LONG MsqCalculateMessageTime(IN PLARGE_INTEGER TickCount)
Definition: msgqueue.h:253
PSERVERINFO gpsi
Definition: main.c:27
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
Definition: window.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT_PTR nID
Definition: timer.h:9
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
THRDESKHEAD head
Definition: ntuser.h:659
#define TimerLeave()
Definition: timer.c:41
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
VOID NTAPI KeQueryTickCount(IN PLARGE_INTEGER TickCount)
Definition: clock.c:165
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
VOID FASTCALL ClearMsgBitsMask(PTHREADINFO pti, UINT MessageBits)
Definition: msgqueue.c:445
#define TMRF_SYSTEM
Definition: timer.h:20
#define WM_TIMER
Definition: winuser.h:1718
VOID FASTCALL MsqPostMessage(PTHREADINFO pti, MSG *Msg, BOOLEAN HardwareMessage, DWORD MessageBits, DWORD dwQEvent, LONG_PTR ExtraInfo)
Definition: msgqueue.c:1342
PTHREADINFO pti
Definition: timer.h:7
Definition: typedefs.h:117
FLONG flags
Definition: timer.h:12
#define QS_POSTMESSAGE
Definition: winuser.h:888
#define TMRF_READY
Definition: timer.h:19
TIMERPROC pfn
Definition: timer.h:13
LIST_ENTRY ptmrList
Definition: timer.h:6
#define TimerEnterExclusive()
Definition: timer.c:35

Referenced by co_IntPeekMessage().

◆ ProcessTimers()

VOID FASTCALL ProcessTimers ( VOID  )

Definition at line 449 of file timer.c.

450 {
451  LARGE_INTEGER TickCount, DueTime;
452  LONG Time;
453  PLIST_ENTRY pLE;
454  PTIMER pTmr;
455  LONG TimerCount = 0;
456 
458  pLE = TimersListHead.Flink;
459  KeQueryTickCount(&TickCount);
460  Time = MsqCalculateMessageTime(&TickCount);
461 
462  DueTime.QuadPart = (LONGLONG)(-97656); // 1024hz .9765625 ms set to 10.0 ms
463 
464  while(pLE != &TimersListHead)
465  {
466  pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
467  TimerCount++;
468  if (pTmr->flags & TMRF_WAITING)
469  {
470  pLE = pTmr->ptmrList.Flink;
471  pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList);
472  continue;
473  }
474 
475  if (pTmr->flags & TMRF_INIT)
476  {
477  pTmr->flags &= ~TMRF_INIT; // Skip this run.
478  }
479  else
480  {
481  if (pTmr->cmsCountdown < 0)
482  {
483  ASSERT(pTmr->pti);
484  if ((!(pTmr->flags & TMRF_READY)) && (!(pTmr->pti->TIF_flags & TIF_INCLEANUP)))
485  {
486  if (pTmr->flags & TMRF_ONESHOT)
487  pTmr->flags |= TMRF_WAITING;
488 
489  if (pTmr->flags & TMRF_RIT)
490  {
491  // Hard coded call here, inside raw input thread.
492  pTmr->pfn(NULL, WM_SYSTIMER, pTmr->nID, (LPARAM)pTmr);
493  }
494  else
495  {
496  pTmr->flags |= TMRF_READY; // Set timer ready to be ran.
497  // Set thread message queue for this timer.
498  if (pTmr->pti)
499  { // Wakeup thread
500  pTmr->pti->cTimersReady++;
501  ASSERT(pTmr->pti->pEventQueueServer != NULL);
502  MsqWakeQueue(pTmr->pti, QS_TIMER, TRUE);
503  }
504  }
505  }
506  pTmr->cmsCountdown = pTmr->cmsRate;
507  }
508  else
509  pTmr->cmsCountdown -= Time - TimeLast;
510  }
511 
512  pLE = pLE->Flink;
513  }
514 
515  // Restart the timer thread!
516  ASSERT(MasterTimer != NULL);
518 
519  TimeLast = Time;
520 
521  TimerLeave();
522  TRACE("TimerCount = %d\n", TimerCount);
523 }
VOID FASTCALL MsqWakeQueue(PTHREADINFO pti, DWORD MessageBits, BOOL KeyEvent)
Definition: msgqueue.c:412
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
Definition: timerobj.c:281
#define TMRF_WAITING
Definition: timer.h:24
PKTIMER MasterTimer
Definition: input.c:16
#define WM_SYSTIMER
Definition: comctl32.h:111
_In_ LARGE_INTEGER DueTime
Definition: kefuncs.h:524
INT cmsCountdown
Definition: timer.h:10
FLONG TIF_flags
Definition: win32.h:94
#define QS_TIMER
Definition: winuser.h:893
#define TMRF_RIT
Definition: timer.h:21
static __inline LONG MsqCalculateMessageTime(IN PLARGE_INTEGER TickCount)
Definition: msgqueue.h:253
UINT cTimersReady
Definition: win32.h:109
long LONG
Definition: pedump.c:60
UINT_PTR nID
Definition: timer.h:9
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TMRF_INIT
Definition: timer.h:22
VOID NTAPI KeQueryTickCount(IN PLARGE_INTEGER TickCount)
Definition: clock.c:165
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TMRF_ONESHOT
Definition: timer.h:23
int64_t LONGLONG
Definition: typedefs.h:66
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
PKEVENT pEventQueueServer
Definition: win32.h:124
PTHREADINFO pti
Definition: timer.h:7
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
INT cmsRate
Definition: timer.h:11
Definition: typedefs.h:117
FLONG flags
Definition: timer.h:12
#define TMRF_READY
Definition: timer.h:19
TIMERPROC pfn
Definition: timer.h:13
LIST_ENTRY ptmrList
Definition: timer.h:6
#define TimerEnterExclusive()
Definition: timer.c:35
static LONG TimeLast
Definition: timer.c:17
#define TIF_INCLEANUP
Definition: ntuser.h:240
static PLARGE_INTEGER Time
Definition: time.c:105
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by RawInputThreadMain().

◆ RemoveTimer()

static BOOL FASTCALL RemoveTimer ( PTIMER  pTmr)
static

Definition at line 70 of file timer.c.

71 {
72  BOOL Ret = FALSE;
73  if (pTmr)
74  {
75  /* Set the flag, it will be removed when ready */
76  RemoveEntryList(&pTmr->ptmrList);
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 }
PWND pWnd
Definition: timer.h:8
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:683
#define IntUnlockWindowlessTimerBitmap()
Definition: timer.c:32
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:610
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define NUM_WINDOW_LESS_TIMERS
Definition: timer.c:20
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT_PTR nID
Definition: timer.h:9
smooth NULL
Definition: ftsmooth.c:416
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define TMRF_SYSTEM
Definition: timer.h:20
VOID NTAPI RtlClearBit(_In_ PRTL_BITMAP BitMapHeader, _In_ BITMAP_INDEX BitNumber)
Definition: bitmap.c:294
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define ERR(fmt,...)
Definition: debug.h:109
FLONG flags
Definition: timer.h:12
#define IntLockWindowlessTimerBitmap()
Definition: timer.c:29
LIST_ENTRY ptmrList
Definition: timer.h:6
static RTL_BITMAP WindowLessTimersBitMap
Definition: timer.c:23

Referenced by DestroyTimersForThread(), DestroyTimersForWindow(), and IntKillTimer().

◆ StartTheTimers()

VOID FASTCALL StartTheTimers ( VOID  )

Definition at line 368 of file timer.c.

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 }
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
#define TMRF_RIT
Definition: timer.h:21
smooth NULL
Definition: ftsmooth.c:416
VOID CALLBACK HungAppSysTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: msgqueue.c:2227

Referenced by RawInputThreadMain().

◆ SystemTimerProc()

VOID CALLBACK SystemTimerProc ( HWND  hwnd,
UINT  uMsg,
UINT_PTR  idEvent,
DWORD  dwTime 
)

Definition at line 280 of file timer.c.

284 {
285  PDESKTOP pDesk;
286  PWND pWnd = NULL;
287 
288  if (hwnd)
289  {
290  pWnd = UserGetWindowObject(hwnd);
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;
312  WPARAM wParam;
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);
324  Msg = WM_MOUSEHOVER;
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 }
BOOL FASTCALL IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
Definition: painting.c:1292
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1189
DWORD ExStyle
Definition: ntuser.h:668
DWORD htEx
Definition: desktop.h:32
#define TRUE
Definition: types.h:120
struct _DESKTOP * rpdesk
Definition: ntuser.h:189
PWND spwndTrack
Definition: desktop.h:31
#define ID_EVENT_SYSTIMER_MOUSEHOVER
Definition: timer.h:27
WPARAM FASTCALL MsqGetDownKeyState(PUSER_MESSAGE_QUEUE MessageQueue)
Definition: msgqueue.c:338
#define WM_MOUSEHOVER
Definition: commctrl.h:4945
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:577
#define FLASHW_SYSTIMER
Definition: painting.h:4
LONG top
Definition: windef.h:292
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
struct @1567 Msg[]
UINT_PTR WPARAM
Definition: windef.h:207
RECT rcClient
Definition: ntuser.h:681
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
PSERVERINFO gpsi
Definition: main.c:27
WPARAM wParam
Definition: combotst.c:138
RECT rcMouseHover
Definition: desktop.h:33
DWORD dwDTFlags
Definition: desktop.h:12
THRDESKHEAD head
Definition: ntuser.h:659
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define ID_EVENT_SYSTIMER_FLASHWIN
Definition: timer.h:28
FORCEINLINE BOOL RECTL_bPointInRect(_In_ const RECTL *prcl, _In_ INT x, _In_ INT y)
Definition: rect.h:52
struct Point Point
#define DF_TME_HOVER
Definition: desktop.h:47
#define WM_NCMOUSEHOVER
Definition: winuser.h:1817
#define ERR(fmt,...)
Definition: debug.h:109
Definition: ntuser.h:657
unsigned int UINT
Definition: ndis.h:50
#define HTCLIENT
Definition: winuser.h:2429

Referenced by IntFlashWindowEx(), IntTrackMouseEvent(), and IntTrackMouseMove().

◆ SystemTimerSet()

UINT_PTR FASTCALL SystemTimerSet ( PWND  Window,
UINT_PTR  nIDEvent,
UINT  uElapse,
TIMERPROC  lpTimerFunc 
)

Definition at line 379 of file timer.c.

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 }
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
Definition: window.c:29
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
#define PsGetCurrentProcess
Definition: psfuncs.h:17
#define TRACE(s)
Definition: solgame.cpp:4
#define TMRF_SYSTEM
Definition: timer.h:20
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ ValidateTimerCallback()

BOOL FASTCALL ValidateTimerCallback ( PTHREADINFO  pti,
LPARAM  lParam 
)

Definition at line 150 of file timer.c.

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 }
#define TRUE
Definition: types.h:120
#define TMRF_RIT
Definition: timer.h:21
PPROCESSINFO ppi
Definition: win32.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
static LIST_ENTRY TimersListHead
Definition: timer.c:16
Definition: timer.h:3
#define TimerLeave()
Definition: timer.c:41
LONG_PTR LPARAM
Definition: windef.h:208
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TMRF_SYSTEM
Definition: timer.h:20
PTHREADINFO pti
Definition: timer.h:7
Definition: typedefs.h:117
FLONG flags
Definition: timer.h:12
TIMERPROC pfn
Definition: timer.h:13
#define TimerEnterExclusive()
Definition: timer.c:35
LPARAM lParam
Definition: combotst.c:139

Referenced by IntDispatchMessage(), and NtUserValidateTimerCallback().

Variable Documentation

◆ HintIndex

ULONG HintIndex = 1
static

Definition at line 25 of file timer.c.

Referenced by IntSetTimer().

◆ Mutex

◆ TimeLast

LONG TimeLast = 0
static

Definition at line 17 of file timer.c.

Referenced by ProcessTimers().

◆ TimerLock

ERESOURCE TimerLock

Definition at line 27 of file timer.c.

Referenced by InitTimerImpl().

◆ TimersListHead

◆ WindowLessTimersBitMap

RTL_BITMAP WindowLessTimersBitMap
static

Definition at line 23 of file timer.c.

Referenced by InitTimerImpl(), IntSetTimer(), and RemoveTimer().

◆ WindowLessTimersBitMapBuffer

PVOID WindowLessTimersBitMapBuffer
static

Definition at line 24 of file timer.c.

Referenced by InitTimerImpl().