ExTimerDeleteCallback routine

An ExTimerDeleteCallback callback routine runs when the operating system deletes an EX_TIMER timer object.


EXT_DELETE_CALLBACK ExTimerDeleteCallback;

VOID ExTimerDeleteCallback(
  _In_opt_ PVOID Context
{ ... }


Context [in, optional]

The context value from the DeleteContext member of the EXT_DELETE_PARAMETERS structure that your driver previously passed as an input parameter to the ExDeleteTimer routine.

Return value



As an option, your driver can supply a pointer to an ExTimerDeleteCallback routine in the DeleteCallback member of the EXT_DELETE_PARAMETERS structure that your driver passes as an input parameter to the ExDeleteTimer routine. The ExTimerDeleteCallback routine can free any storage or other system resources that the driver might have previously allocated to use with the timer object that is being deleted.

If the driver supplies an ExTimerDeleteCallback routine, and the Wait parameter in the ExDeleteRoutine call is TRUE, the ExTimerDeleteCallback routine runs before ExDeleteTimer returns. Otherwise, the ExTimerDeleteCallback routine might run before or after the ExDeleteTimer call returns. The ExTimerDeleteCallback routine is called only after the timer object has been disabled to prevent further timer operations and any pending timer operation on the timer object is canceled or completed. The timer object (an EX_TIMER structure) that the driver passes as an input parameter to the ExDeleteTimer routine might no longer be valid by the time the ExTimerDeleteCallback routine runs.

For more information, see ExXxxTimer Routines and EX_TIMER Objects.


To define an ExTimerDeleteCallback callback routine, you must first provide a function declaration that identifies the type of callback routine you're defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function type 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 an ExTimerDeleteCallback callback routine that is named MyExTimerDeleteCallback, use the EXT_DELETE_CALLBACK function type, as shown in this code example:

EXT_DELETE_CALLBACK  MyExTimerDeleteCallback;

Then, implement your callback routine as follows:

    PVOID  Context

The EXT_DELETE_CALLBACK function type is defined in the Wdm.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 EXT_DELETE_CALLBACK 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 WDM Drivers. For more information about _Use_decl_annotations_, see Annotating Function Behavior.


Target platform



Available starting with Windows 8.1.


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



See also




Send comments about this topic to Microsoft