WdfTimerStop 方法

The WdfTimerStop method stops a timer's clock.

语法

BOOLEAN WdfTimerStop(
  [in]  WDFTIMER Timer,
  [in]  BOOLEAN Wait
);

参数

Timer [in]

A handle to a framework timer object that was obtained by calling WdfTimerCreate.

Wait [in]

A Boolean value that, if TRUE, specifies that the framework does not return until all queued calls to the driver's deferred procedure calls (DPCs), including the driver's EvtTimerFunc callback functions, have executed.

返回值

WdfTimerStop returns TRUE if the timer object was in the system's timer queue. Otherwise, this method returns FALSE. For more information, see the following Remarks section.

A bug check occurs if the driver supplies an invalid object handle.

评论

When a driver calls WdfTimerStart, its timer object is added to the system's queue of timer objects. If the timer is not a periodic timer, the system removes the timer object from the queue after the timer's "due time" has elapsed. If the timer is a periodic timer, the timer object remains in the queue until the driver calls WdfTimerStop.

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

WdfTimerStop must be called at IRQL = PASSIVE_LEVEL if the Wait parameter is TRUE. Otherwise, this method must be called at IRQL <= DISPATCH_LEVEL.

示例

The following code example stops a specified timer and waits for all of the driver's queued DPCs to execute.

WdfTimerStop(
             timerHandle,
             TRUE
             );

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdftimer.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

See Remarks section.

另请参见

EvtTimerFunc
WdfTimerCreate
WdfTimerStart

 

 

社区附加资源

添加
显示:
© 2015 Microsoft