Expand Minimize

WdfDeviceGetDevicePowerPolicyState method

[Applies to KMDF only]

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

Syntax


WDF_DEVICE_POWER_POLICY_STATE WdfDeviceGetDevicePowerPolicyState(
  [in]  WDFDEVICE 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

Most drivers do not need to be aware of the state of the framework's power policy state machine. 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);

Requirements

Minimum KMDF version

1.0

Header

Wdfdevice.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WdfDeviceGetDevicePowerState
WdfDeviceGetDevicePnpState
WdfDevStateNormalize

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.