NTSTATUS
IoInitializeTimer(
IN PDEVICE_OBJECT DeviceObject,
IN PIO_TIMER_ROUTINE TimerRoutine,
IN PVOID Context
);
IoInitializeTimer sets up a driver-supplied IoTimer routine associated with a given device object.
VOID (*PIO_TIMER_ROUTINE) ( IN PDEVICE_OBJECT DeviceObject, IN PVOID Context );
IoInitializeTimer returns STATUS_SUCCESS if the IoTimer routine is set up.
A driver’s IoTimer routine is called once per second after the driver enables the timer by calling IoStartTimer.
The driver can disable the timer by calling IoStopTimer and can re-enable it again with IoStartTimer.
Callers of IoInitializeTimer must be running at IRQL PASSIVE_LEVEL.
When the timer is running, the I/O Manager calls the driver-supplied IoTimer routine once per second. Drivers whose time-out routines should be called at variable intervals or at intervals of finer granularity can set up a CustomTimerDpc routine and use the Ke..Timer routines.