Bewerken

Delen via


EVT_WDF_TIMER callback function (wdftimer.h)

[Applies to KMDF and UMDF]

The EvtTimerFunc event callback function is called when a specified time period has elapsed.

Syntax

EVT_WDF_TIMER EvtWdfTimer;

void EvtWdfTimer(
  [in] WDFTIMER Timer
)
{...}

Parameters

[in] Timer

A handle to a framework timer object that was obtained from a previous call to WdfTimerCreate.

Return value

None

Remarks

To register an EvtTimerFunc callback function and specify the time period that should elapse before the framework calls this function, your driver must call WdfTimerCreate.

In KMDF versions prior to version 1.9, the framework implements EvtTimerFunc callback functions as deferred procedure calls (DPCs). Therefore, when a time period elapses, the system adds a call to an EvtTimerFunc callback function to a DPC queue. The system calls the EvtTimerFunc callback function at IRQL = DISPATCH_LEVEL when it reaches the front of the queue and a CPU that is running at IRQL < DISPATCH_LEVEL is available.

In KMDF versions 1.9 and later, by default the framework implements EvtTimerFunc callback functions as DPCs. Alternatively, if the driver sets the timer object's execution level to WdfExecutionLevelPassive, the framework calls the EvtTimerFunc callback function from a work item at IRQL = PASSIVE_LEVEL.

Note

If an EvtTimerFunc callback function running at PASSIVE_LEVEL calls WdfObjectDelete, this results in deadlock. Instead, either wait for the parent to delete the timer automatically when the device is removed - or, if you need to delete early, schedule a work item from the timer callback to delete the timer.

Starting in UMDF version 2.0, a UMDF driver's EvtTimerFunc callback functions always run at PASSIVE_LEVEL.

For more information about framework timer objects, see Using Timers.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdftimer.h (include Wdf.h)
IRQL See Remarks section.

See also

WdfTimerCreate