diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/nbt/inc/timer.h | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ntos/nbt/inc/timer.h')
-rw-r--r-- | private/ntos/nbt/inc/timer.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/private/ntos/nbt/inc/timer.h b/private/ntos/nbt/inc/timer.h new file mode 100644 index 000000000..63c7e886f --- /dev/null +++ b/private/ntos/nbt/inc/timer.h @@ -0,0 +1,89 @@ +// +// +// timer.h +// +// This file contains the typedefinitions for the timer code + + +#ifndef __TIMERNBT_H +#define __TIMERNBT_H + +// to convert a millisecond time to 100ns time +// +#define MILLISEC_TO_100NS 10000 +// the completion routine that the client must define +typedef + VOID + (*COMPLETIONROUTINE)( + IN PVOID, // context + IN PVOID, // context2 + IN PVOID); // timerqentry +typedef + VOID + (*COMPLETIONCLIENT)( + IN PVOID, + IN NTSTATUS); + +// Timer Queue Entry - this entry looks after a timer event. It tracks who +// should be called when the timeout occurs, the time in the future of the +// timout, and a context value. +typedef struct +{ + CTETimer VxdTimer ; + LIST_ENTRY Linkage; + PVOID Context; + PVOID Context2; + COMPLETIONROUTINE CompletionRoutine; + PVOID ClientContext; + COMPLETIONCLIENT ClientCompletion; + PVOID pCacheEntry; // entry in Remote or local cache + ULONG DeltaTime; + // this is set by the completionroutine to tell the timing system to + // restart the timer again, as opposed to disposing of the timer + USHORT Flags; + USHORT Retries; // number of times to restart the timer + UCHAR RefCount; // to tell if the timer is expiring or not + +}tTIMERQENTRY; + +// Flag bits for tTIMERQENTRY +#define TIMER_RESTART 0x0001 +// to differentiate the broadcast timeouts from the timouts to the Name Service +#define TIMER_MNODEBCAST 0x0002 +#define TIMER_DOING_EXPIRY 0x0004 +#define TIMER_NOT_STARTED 0x0008 +#define TIMER_RETIMED 0x0010 // timeout has changed, restart timer without any processing + +// The timer Q itself +typedef struct +{ + DEFINE_LOCK_STRUCTURE( SpinLock ) + LIST_ENTRY ActiveHead; + LIST_ENTRY FreeHead; + +} tTIMERQ; + +// +// Function Prototype - this function is only called locally to this file +// + + +// +// TimerExpiry routine - Called by kernel upon timer expiration. Note that +// DeferredContext is the only argument used and must be named/used the +// same between NT and WFW. +// +VOID +TimerExpiry( +#ifndef VXD + IN PKDPC Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArg1, + IN PVOID SystemArg2 +#else + IN CTEEvent * pCTEEvent, + IN PVOID DeferredContext +#endif + ) ; + +#endif |