信息
您所需的主题如下所示。但此主题未包含在此库中。

EvtTimerFunc

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

语法

EVT_WDF_TIMER EvtTimerFunc;

VOID EvtTimerFunc(
  __in  WDFTIMER Timer 
)
{ ... }

参数

Timer [in]

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

返回值

None

评论

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 framework 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 version 1.9 and later versions of the framework, 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. (Callback functions that are called at PASSIVE_LEVEL cannot delete timer objects.)

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

示例

The function type is declared in Wdftimer.h, as follows.

typedef VOID
  (EVT_WDF_TIMER) (
    IN WDFTIMER  Timer
    );

To define an EvtTimerFunc callback function that is named MyTimerFunc, you must first provide a function declaration that SDV and other verification tools require, as follows:

EVT_WDF_TIMER  MyTimerFunc;

Then, implement your callback function as follows:

VOID
 MyTimerFunc (
    IN WDFTIMER  Timer
    )
  {...}

要求

版本

Supported by version 1.0 and later versions of KMDF.

标头

Wdftimer.h (包括Wdf.h)

IRQL

See Remarks section.

另请参见

WdfTimerCreate

 

 

社区附加资源

显示:
© 2015 Microsoft