Expand Minimize
This topic has not yet been rated - Rate this topic

WdfDeviceSetPowerCapabilities method

The WdfDeviceSetPowerCapabilities method reports a device's power capabilities.

Syntax


VOID WdfDeviceSetPowerCapabilities(
  [in]  WDFDEVICE Device,
  [in]  PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities
);

Parameters

Device [in]

A handle to a framework device object.

PowerCapabilities [in]

A pointer to a driver-allocated WDF_DEVICE_POWER_CAPABILITIES structure.

Return value

None.

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

Remarks

A driver typically calls WdfDeviceSetPowerCapabilities from within one of the following callback functions:

If more than one driver in the device's driver stack call WdfDeviceSetPowerCapabilities, the power manager uses the values that are supplied by the driver that is highest in the stack.

Examples

The following code example initializes a WDF_DEVICE_POWER_CAPABILITIES structure and then calls WdfDeviceSetPowerCapabilities.


WDF_DEVICE_POWER_CAPABILITIES powerCaps;

WDF_DEVICE_POWER_CAPABILITIES_INIT(&powerCaps);
powerCaps.DeviceD1 = WdfTrue;
powerCaps.WakeFromD1 = WdfTrue;
powerCaps.DeviceWake = PowerDeviceD1;
powerCaps.DeviceState[PowerSystemWorking] = PowerDeviceD1;
powerCaps.DeviceState[PowerSystemSleeping1] = PowerDeviceD1;
powerCaps.DeviceState[PowerSystemSleeping2] = PowerDeviceD2;
powerCaps.DeviceState[PowerSystemSleeping3] = PowerDeviceD2;
powerCaps.DeviceState[PowerSystemHibernate] = PowerDeviceD3;
powerCaps.DeviceState[PowerSystemShutdown] = PowerDeviceD3;

WdfDeviceSetPowerCapabilities(
                              device,
                              &powerCaps
                              );

Requirements

Version

Available in version 1.0 and later versions of KMDF (see KMDF Version History).

Header

Wdfdevice.h (include Wdf.h)

Library

Wdf<MajorVersionNumber>000.sys (see Framework Library Versioning.)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WdfDeviceSetPnpCapabilities
WDF_DEVICE_POWER_CAPABILITIES
WDF_DEVICE_POWER_CAPABILITIES_INIT

 

 

Send comments about this topic to Microsoft

Build date: 4/23/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.