WdfDeviceGetDevicePowerPolicyState - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdevice.h

WDF_DEVICE_POWER_POLICY_STATE WdfDeviceGetDevicePowerPolicyState(
  [in] WDFDEVICE Device
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdevice-wdfdevicegetdevicepowerpolicystate)

WdfDeviceGetDevicePowerPolicyState function

Description

[Applies to KMDF only]

[!NOTE] This function is for Microsoft-internal use only.

The WdfDeviceGetDevicePowerPolicyState method returns the current state of the framework's power policy state machine, for a specified device.

Parameters

Device [in]

A handle to a framework device object.

Return value

WdfDeviceGetDevicePowerPolicyState returns a WDF_DEVICE_POWER_POLICY_STATE-typed enumerator that identifies the current state of the framework's power policy state machine for the specified device.

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

Remarks

For more information about the framework's state machines, see State Machines in the Framework.

The WdfDeviceGetDevicePowerPolicyState method returns a meaningful value only if it is called from within the callback functions that the driver registers when it calls WdfDeviceInitSetPowerPolicyEventCallbacks.

Examples

The following code example obtains the current state of the framework's power policy state machine for a specified device.

WDF_DEVICE_POWER_POLICY_STATE devicePowerPolicyState;

devicePowerPolicyState = WdfDeviceGetDevicePowerPolicyState(Device);

See also

WdfDevStateNormalize

WdfDeviceGetDevicePnpState

WdfDeviceGetDevicePowerState