WDF_TIMER_CONFIG 结构

The WDF_TIMER_CONFIG structure contains configuration information for a framework timer object.

语法


typedef struct _WDF_TIMER_CONFIG {
  ULONG         Size;
  PFN_WDF_TIMER EvtTimerFunc;
  ULONG         Period;
  BOOLEAN       AutomaticSerialization;
  ULONG         TolerableDelay;
} WDF_TIMER_CONFIG, *PWDF_TIMER_CONFIG;

成员

Size

The size, in bytes, of this structure.

EvtTimerFunc

A pointer to a driver-supplied EvtTimerFunc callback function, or NULL.

Period

A time period, in milliseconds. The framework calls the driver's EvtTimerFunc callback function repeatedly, whenever the specified number of milliseconds elapses. If this value is zero, the framework does not call the driver's EvtTimerFunc callback function repeatedly. Instead, it calls the callback function once, after the WdfTimerStart method's "due time" has elapsed. (The time period must be zero if WdfTimerCreate sets the execution level to WdfExecutionLevelPassive.) The time period cannot be a negative value.

AutomaticSerialization

A Boolean value that, if TRUE, indicates that the framework will synchronize execution of the timer object's EvtTimerFunc callback function with callback functions from other objects that are underneath the timer's parent device object. For more information, see the following Remarks section. If FALSE, the framework does not synchronize execution of the EvtTimerFunc callback function.

TolerableDelay

A time value, in milliseconds, that specifies the maximum amount of additional time that the driver can tolerate after the Period time elapses. The time value cannot be negative. For more information about this member, see the following Remarks section. The TolerableDelay member is available in version 1.9 and later versions of KMDF.

评论

The WDF_TIMER_CONFIG structure is used as input to the WdfTimerCreate method. To initialize a WDF_TIMER_CONFIG structure, your driver must call either WDF_TIMER_CONFIG_INIT or WDF_TIMER_CONFIG_INIT_PERIODIC.

Setting the AutomaticSerialization member of WDF_TIMER_CONFIG to TRUE has no effect if the parent object's synchronization scope is set to WdfSynchronizationScopeNone.

If the parent device object's execution level is WdfExecutionLevelPassive, you can set the AutomaticSerialization member to TRUE only if the timer object represents a passive-level timer.

If the TolerableDelay member is nonzero, the framework can call the driver's EvtTimerFunc callback function after the Period time elapses, but not later than the time that Period+ TolerableDelay represents. If a driver uses the TolerableDelay member, the operating system can group together expiration times that are close together and process them all at once. If the operating system can handle the expirations of multiple timers at once, it can potentially keep the computer in a low-power state for longer periods of time to increase battery life.

For more information about AutomaticSerialization and synchronizing driver callback functions, see Synchronization Techniques for Framework-Based Drivers.

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdftimer.h (包括Wdf.h)

另请参见

EvtTimerFunc
WDF_TIMER_CONFIG_INIT
WDF_TIMER_CONFIG_INIT_PERIODIC
WdfTimerCreate
WdfTimerStart

 

 

社区附加资源

添加
显示:
© 2015 Microsoft