The WdfDeviceGetDevicePowerState method returns the current state of the framework's power state machine, for a specified device.
WDF_DEVICE_POWER_STATE WdfDeviceGetDevicePowerState( [in] WDFDEVICE Device );
- Device [in]
A handle to a framework device object.
WdfDeviceGetDevicePowerState returns a WDF_DEVICE_POWER_STATE-typed enumerator that identifies the current state of the framework's power state machine for the specified device.
A bug check occurs if the driver supplies an invalid object handle.
Most drivers do not need to be aware of the state of the framework's power state machine. For more information about the framework's state machines, see State Machines in the Framework.
The WdfDeviceGetDevicePowerState method returns a meaningful value only if it is called from within the following callback functions:
The following code example obtains the current state of the framework's power state machine for a specified device.
WDF_DEVICE_POWER_STATE state; state = WdfDeviceGetDevicePowerState(Device);
|Available in version 1.0 and later versions of KMDF.|
|Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)|