Expand Minimize

IoInitializeTimer routine

The IoInitializeTimer routine sets up a driver-supplied IoTimer routine associated with a given device object.

Syntax


NTSTATUS IoInitializeTimer(
  _In_      PDEVICE_OBJECT DeviceObject,
  _In_      PIO_TIMER_ROUTINE TimerRoutine,
  _In_opt_  PVOID Context
);

Parameters

DeviceObject [in]

Pointer to a device object representing a device on which I/O operations can time out.

TimerRoutine [in]

Pointer to the driver-supplied IoTimer routine.

Context [in, optional]

Pointer to the driver-determined context with which its IoTimer routine will be called.

Return value

IoInitializeTimer returns STATUS_SUCCESS if the IoTimer routine is set up.

Remarks

IoInitializeTimer should be called only once per device object.

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 reenable it again with IoStartTimer.

The driver's IoTimer routine is called at IRQL = DISPATCH_LEVEL and therefore must not contain pageable code.

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 KeXxxTimer routines.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

IrqlIoPassive5, PowerIrpDDis, HwStorPortProhibitedDDIs

See also

IoTimer
IoStartTimer
IoStopTimer
KeInitializeTimer
KeSetTimer

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft