HW_TIMER callback function

The HwStorTimer routine is called after the interval that is specified when the miniport driver called StorPortNotification with the RequestTimerCall NotificationType value.



void HwTimer(
  PVOID DeviceExtension



A pointer to the miniport driver's per HBA storage area.

Return Value



The name HwStorTimer is only a placeholder. The actual prototype of this routine is defined in Srb.h as follows:

  _In_ PVOID  DeviceExtension

If the miniport opts into multi-channel support, the StartIo spin lock is still taken. However, if the miniport has requested multiple channel support via PERF_CONFIGURATION_DATA, the StartIo spin lock is not taken or checked before the call to HwStorStartIo in the miniport. This means that the HwStorStartIo callback is not synchronized with the callback to the HwStorTimer routine when multi-channel support is used. The miniport must do this on its own by using a compiler interlocked intrinsic, for example using InterlockedCompareExchange.

A HwStorTimer routine is optional.


To define an HwStorTimer callback function, you must first provide a function declaration that identifies the type of callback function you’re defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it’s a requirement for writing drivers for the Windows operating system.

For example, to define a HwStorTimer callback routine that is named MyHwTimer, use the HW_TIMER type as shown in this code example:


Then, implement your callback routine as follows:

MyHwTimer (
  _In_ PVOID  DeviceExtension

The HW_TIMER function type is defined in the Storport.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the Use_decl_annotations annotation to your function definition. The Use_decl_annotations annotation ensures that the annotations that are applied to the HW_TIMER function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions Using Function Role Types for Storport Drivers. For information about Use_decl_annotations, see Annotating Function Behavior.


Target Platform Universal
Header storport.h (include Storport.h)

See Also


Send comments about this topic to Microsoft