[Applies to KMDF and UMDF]
The WdfTimerCreate method creates a framework timer object.
NTSTATUS WdfTimerCreate( PWDF_TIMER_CONFIG Config, PWDF_OBJECT_ATTRIBUTES Attributes, WDFTIMER *Timer );
A pointer to a WDF_TIMER_CONFIG structure.
A pointer to a WDF_OBJECT_ATTRIBUTES structure that contains object attributes for the new timer object.
A pointer to a location that receives a handle to the new framework timer object.
WdfTimerCreate returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:
||The Attributes parameter was NULL, or the ParentObject member of the WDF_OBJECT_ATTRIBUTES structure that Attributes specifies was NULL.|
||An invalid parameter was specified.|
||The ParentObject member of the WDF_OBJECT_ATTRIBUTES structure did not reference a framework device object or an object whose chain of parents leads to a framework device object.|
||There was insufficient memory.|
||The AutomaticSerialization member of the WDF_TIMER_CONFIG structure was set to TRUE, but the parent device object's execution level was set to WdfExecutionLevelPassive.|
For a list of other return values that the WdfTimerCreate method might return, see Framework Object Creation Errors.
This method might also return other NTSTATUS values.
When your driver calls WdfTimerCreate, it must supply a WDF_OBJECT_ATTRIBUTES structure and must specify a parent object in the structure's ParentObject member. The parent object can be a framework device object or any object whose chain of parents leads to a framework device object. The framework will delete the timer object when it deletes the device object.
After creating a timer object, the driver must call WdfTimerStart to start the timer's clock regardless of whether the timer is periodic or not.
For more information about framework timer objects, see Using Timers.
WDF_TIMER_CONFIG timerConfig; WDF_OBJECT_ATTRIBUTES timerAttributes; WDFTIMER timerHandle; NTSTATUS status;
|Minimum KMDF version||1.0|
|Minimum UMDF version||2.0|
|Header||wdftimer.h (include Wdf.h)|
|Library||Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)|
|DDI compliance rules||DriverCreate, KmdfIrql, KmdfIrql2|