PoSetPowerState - NtDoc

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

POWER_STATE PoSetPowerState(
  [in] PDEVICE_OBJECT   DeviceObject,
  [in] POWER_STATE_TYPE Type,
  [in] POWER_STATE      State
);

View the official Windows Driver Kit DDI reference
// wdm.h

POWER_STATE PoSetPowerState(
  [in] PDEVICE_OBJECT   DeviceObject,
  [in] POWER_STATE_TYPE Type,
  [in] POWER_STATE      State
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntifs-posetpowerstate)

PoSetPowerState function (ntifs.h)

Description

The PoSetPowerState routine notifies the system of a change in the device power state for a device.

Parameters

DeviceObject [in]

A pointer to the target DEVICE_OBJECT.

Type [in]

Indicates a POWER_STATE_TYPE value. Drivers must specify DevicePowerState.

State [in]

Specifies the power state to be set. Drivers must specify a DEVICE_POWER_STATE value.

Return value

PoSetPowerState returns the previous power state.

Remarks

PoSetPowerState notifies the power manager of the new power state for a device. Each driver in a device stack (filter, function, and bus drivers) must call PoSetPowerState to inform the power manager of a change in the power state of its corresponding device object. For example:

For more information about powering a device up and down, see Handling IRP_MN_SET_POWER for Device Power States.

Callers of PoSetPowerState must be running at IRQL <= APC_LEVEL except when setting state to D0. When setting state to D0, callers can be running at IRQL <= DISPATCH_LEVEL.

See also

IRP_MN_START_DEVICE

PoStartNextPowerIrp


Windows Driver Kit DDI reference (nf-wdm-posetpowerstate)

PoSetPowerState function (wdm.h)

Description

The PoSetPowerState routine notifies the system of a change in the device power state for a device.

Parameters

DeviceObject [in]

A pointer to the target DEVICE_OBJECT.

Type [in]

Indicates a POWER_STATE_TYPE value. Drivers must specify DevicePowerState.

State [in]

Specifies the power state to be set. Drivers must specify a DEVICE_POWER_STATE value.

Return value

On Windows 2000 and later versions of the operating system, PoSetPowerState returns the previous power state. On Windows 98/Me, PoSetPowerState returns the state passed in State.

Remarks

PoSetPowerState notifies the power manager of the new power state for a device. Each driver in a device stack (filter, function, and bus drivers) must call PoSetPowerState to inform the power manager of a change in the power state of its corresponding device object. For example:

For more information about powering a device up and down, see Handling IRP_MN_SET_POWER for Device Power States.

Callers of PoSetPowerState must be running at IRQL <= APC_LEVEL except when setting state to D0. When setting state to D0, callers can be running at IRQL <= DISPATCH_LEVEL.

See also

IRP_MN_START_DEVICE

PoStartNextPowerIrp