Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 2.87 KB

timer-objects-and-dpcs.md

File metadata and controls

34 lines (20 loc) · 2.87 KB
title description keywords ms.date
KeXxxTimer Routines, KTIMER Objects, and DPCs
Starting with Windows 2000, a set of KeXxxTimer routines is available to manage timers.
timers WDK kernel
timer objects WDK kernel
timer objects WDK kernel , about timer objects
deferred procedure calls WDK kernel
DPCs WDK kernel
kernel dispatcher objects WDK , timer objects
dispatcher objects WDK kernel , timer objects
notification timers WDK kernel
synchronization timers WDK kernel
KTIMER
KeXxxTimer routines
KeInitializeTimer
KeInitializeTimerEx
KeSetTimer
KeSetTimerEx
CustomTimerDpc
timeout intervals WDK kernel
07/22/2021

KeXxxTimer Routines, KTIMER Objects, and DPCs

Starting with Windows 2000, a set of KeXxxTimer routines is available to manage timers. These routines use timer objects that are based on the KTIMER structure. To create a timer object, a driver first allocates storage for a KTIMER structure. Then the driver calls a routine such as KeInitializeTimer or KeInitializeTimerEx to initialize this structure.

A timer can be set to expire just once, or to expire repeatedly after a given interval. KeSetTimer always sets a timer that will expire just once. KeSetTimerEx accepts an optional Period parameter, which specifies a recurring timer interval.

An optional CustomTimerDpc routine (a type of deferred procedure call) can be associated with either a notification timer or a synchronization timer. This routine executes when the specified time interval expires. For more information, see Using Timer Objects.

A timer can be a notification timer or a synchronization timer.

  • When a notification timer is signaled, all waiting threads have their wait satisfied. The state of the timer remains signaled until it is explicitly reset.

  • When a synchronization timer expires, its state is set to Signaled until a single waiting thread is released. Then the timer is reset to the Not-Signaled state.

KeInitializeTimer always creates notification timers. KeInitializeTimerEx accepts a Type parameter, which can be NotificationTimer or SynchronizationTimer.

The following topics provide more information about timer objects and DPCs:

Using Timer Objects

Timer Accuracy

Registering and Queuing a CustomTimerDpc Routine

Providing CustomTimerDpc Context Information

Using a CustomTimerDpc Routine