#include <rtl.h>
#include <debug.h>
#include <wine/list.h>
Go to the source code of this file.
|
NTSTATUS | RtlpInitializeTimerThread (VOID) |
|
static PLARGE_INTEGER | get_nt_timeout (PLARGE_INTEGER pTime, ULONG timeout) |
|
static void | queue_remove_timer (struct queue_timer *t) |
|
static void | timer_cleanup_callback (struct queue_timer *t) |
|
static VOID WINAPI | timer_callback_wrapper (LPVOID p) |
|
static ULONGLONG | queue_current_time (void) |
|
static void | queue_add_timer (struct queue_timer *t, ULONGLONG time, BOOL set_event) |
|
static void | queue_move_timer (struct queue_timer *t, ULONGLONG time, BOOL set_event) |
|
static void | queue_timer_expire (struct timer_queue *q) |
|
static ULONG | queue_get_timeout (struct timer_queue *q) |
|
static DWORD WINAPI | timer_queue_thread_proc (LPVOID p) |
|
static void | queue_destroy_timer (struct queue_timer *t) |
|
NTSTATUS WINAPI | RtlCreateTimerQueue (PHANDLE NewTimerQueue) |
|
NTSTATUS WINAPI | RtlDeleteTimerQueueEx (HANDLE TimerQueue, HANDLE CompletionEvent) |
|
static struct timer_queue * | get_timer_queue (HANDLE TimerQueue) |
|
NTSTATUS WINAPI | RtlCreateTimer (HANDLE TimerQueue, PHANDLE NewTimer, WAITORTIMERCALLBACKFUNC Callback, PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags) |
|
NTSTATUS WINAPI | RtlSetTimer (HANDLE TimerQueue, PHANDLE NewTimer, WAITORTIMERCALLBACKFUNC Callback, PVOID Parameter, DWORD DueTime, DWORD Period, ULONG Flags) |
|
NTSTATUS WINAPI | RtlUpdateTimer (HANDLE TimerQueue, HANDLE Timer, DWORD DueTime, DWORD Period) |
|
NTSTATUS WINAPI | RtlDeleteTimer (HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEvent) |
|
NTSTATUS NTAPI | RtlCancelTimer (HANDLE TimerQueue, HANDLE Timer) |
|
NTSTATUS NTAPI | RtlDeleteTimerQueue (HANDLE TimerQueue) |
|
◆ EXPIRE_NEVER
◆ NDEBUG
◆ TIMER_QUEUE_MAGIC
#define TIMER_QUEUE_MAGIC 0x516d6954 /* TimQ */ |
◆ get_nt_timeout()
◆ get_timer_queue()
Definition at line 375 of file timerqueue.c.
376{
378
379 if (TimerQueue)
380 return TimerQueue;
381 else
382 {
383 if (!default_timer_queue)
384 {
388 {
390 (
void **) &default_timer_queue,
q,
NULL);
392
394 }
395 }
396 return default_timer_queue;
397 }
398}
GLdouble GLdouble GLdouble GLdouble q
#define InterlockedCompareExchangePointer
NTSYSAPI NTSTATUS NTAPI RtlCreateTimerQueue(PHANDLE TimerQueue)
NTSYSAPI NTSTATUS NTAPI RtlDeleteTimerQueueEx(_In_ HANDLE TimerQueue, _In_opt_ HANDLE CompletionEvent)
Referenced by RtlCreateTimer().
◆ queue_add_timer()
Definition at line 114 of file timerqueue.c.
116{
117
120
122
125 {
128 break;
129 }
131
133
134
135
136 if (set_event && &
t->entry ==
list_head(&
q->timers))
138}
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
#define LIST_FOR_EACH(cursor, list)
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
Referenced by queue_move_timer(), and RtlCreateTimer().
◆ queue_current_time()
◆ queue_destroy_timer()
Definition at line 258 of file timerqueue.c.
259{
260
262 if (
t->runcount == 0)
263
264
265
267 else
268
269
271}
static void queue_move_timer(struct queue_timer *t, ULONGLONG time, BOOL set_event)
static void queue_remove_timer(struct queue_timer *t)
Referenced by RtlDeleteTimer(), and RtlDeleteTimerQueueEx().
◆ queue_get_timeout()
Definition at line 193 of file timerqueue.c.
194{
197
200 {
203
205 {
208 }
209 }
211
213}
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
static ULONGLONG queue_current_time(void)
Referenced by timer_queue_thread_proc().
◆ queue_move_timer()
◆ queue_remove_timer()
◆ queue_timer_expire()
Definition at line 148 of file timerqueue.c.
149{
151
154 {
158 {
161 {
162 next =
t->expire +
t->period;
163
166 }
167 else
170 }
171 else
173 }
175
177 {
180 else
181 {
189 }
190 }
191}
NTSYSAPI NTSTATUS NTAPI RtlQueueWorkItem(_In_ WORKERCALLBACKFUNC Function, _In_opt_ PVOID Context, _In_ ULONG Flags)
static unsigned __int64 next
static VOID WINAPI timer_callback_wrapper(LPVOID p)
static void timer_cleanup_callback(struct queue_timer *t)
#define WT_TRANSFER_IMPERSONATION
#define WT_EXECUTEINPERSISTENTTHREAD
#define WT_EXECUTEINIOTHREAD
#define WT_EXECUTELONGFUNCTION
#define WT_EXECUTEINTIMERTHREAD
Referenced by timer_queue_thread_proc().
◆ RtlCancelTimer()
Definition at line 585 of file timerqueue.c.
586{
588}
NTSYSAPI NTSTATUS NTAPI RtlDeleteTimer(_In_ HANDLE TimerQueue, _In_ HANDLE Timer, _In_ HANDLE CompletionEvent)
◆ RtlCreateTimer()
Definition at line 425 of file timerqueue.c.
429{
433
436
440
449
454 else
457
460 else
462
464}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
#define STATUS_INVALID_HANDLE
#define TIMER_QUEUE_MAGIC
static struct timer_queue * get_timer_queue(HANDLE TimerQueue)
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
_In_ WDFTIMER _In_ LONGLONG DueTime
_Must_inspect_result_ _In_ ULONG Flags
_In_ LARGE_INTEGER _In_ ULONG Period
_Inout_opt_ PVOID Parameter
◆ RtlCreateTimerQueue()
Definition at line 285 of file timerqueue.c.
286{
291
298 {
301 }
304 {
308 }
309
313}
static void list_init(struct list_entry *head)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
static DWORD WINAPI timer_queue_thread_proc(LPVOID p)
PRTL_START_POOL_THREAD RtlpStartThreadFunc
Referenced by BasepCreateDefaultTimerQueue(), CreateTimerQueue(), and get_timer_queue().
◆ RtlDeleteTimer()
Definition at line 540 of file timerqueue.c.
542{
547
552 {
556 }
557 else if (CompletionEvent)
558 event = CompletionEvent;
559
562 if (
t->runcount == 0 &&
event)
566
568 {
570 {
573 }
575 }
576
578}
#define INVALID_HANDLE_VALUE
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
#define STATUS_INVALID_PARAMETER_1
static void queue_destroy_timer(struct queue_timer *t)
◆ RtlDeleteTimerQueue()
◆ RtlDeleteTimerQueueEx()
Definition at line 331 of file timerqueue.c.
332{
337
340
342
346
347
350 else
351
354
356 {
359 }
360 else
361 {
362 if (CompletionEvent)
363 {
364 DPRINT1(
"asynchronous return on completion event unimplemented\n");
367 }
369 }
370
373}
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
◆ RtlpInitializeTimerThread()
◆ RtlSetTimer()
Definition at line 468 of file timerqueue.c.
476{
478 NewTimer,
484}
NTSYSAPI NTSTATUS NTAPI RtlCreateTimer(_In_ HANDLE TimerQueue, _In_ PHANDLE phNewTimer, _In_ WAITORTIMERCALLBACKFUNC Callback, _In_ PVOID Parameter, _In_ ULONG DueTime, _In_ ULONG Period, _In_ ULONG Flags)
◆ RtlUpdateTimer()
Definition at line 504 of file timerqueue.c.
506{
509
511
513 {
516 }
518
520}
◆ timer_callback_wrapper()
◆ timer_cleanup_callback()
◆ timer_queue_thread_proc()
Definition at line 215 of file timerqueue.c.
216{
219
221 for (;;)
222 {
226
229
231 {
232
233
234
235
240 }
243
244 if (done)
245 break;
246
248 }
249
255 return 0;
256}
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
static PLARGE_INTEGER get_nt_timeout(PLARGE_INTEGER pTime, ULONG timeout)
static ULONG queue_get_timeout(struct timer_queue *q)
PRTL_EXIT_POOL_THREAD RtlpExitThreadFunc
static void queue_timer_expire(struct timer_queue *q)
Referenced by RtlCreateTimerQueue().
◆ RtlpExitThreadFunc
◆ RtlpStartThreadFunc
◆ TimerThreadHandle