PcRequestNewPowerState function

The PcRequestNewPowerState function is used to request a new power state for the device. This function is typically not needed by adapter drivers but can occasionally be useful in working around some kinds of hardware problems.

Syntax


NTSTATUS PcRequestNewPowerState(
  _In_ PDEVICE_OBJECT     pDeviceObject,
  _In_ DEVICE_POWER_STATE RequestedNewState
);

Parameters

pDeviceObject [in]

Pointer to the adapter's functional device object (FDO). This parameter must point to a system structure of type DEVICE_OBJECT.

RequestedNewState [in]

Specifies the device power state being requested. Set this parameter to one of the following DEVICE_POWER_STATE enumeration values: PowerDeviceD0, PowerDeviceD1, PowerDeviceD2, or PowerDeviceD3.

Return value

PcRequestNewPowerState returns STATUS_SUCCESS if the call was successful. Otherwise, returns an appropriate error message.

Remarks

An adapter driver can call PcRequestNewPowerState to compensate for hardware design flaws. For example, if the functions in an audio adapter are not mutually independent and need to be shut down in a particular order, the adapter can call PcRequestNewPowerState to ensure that a particular subdevice is shut down first.

The RequestedNewState parameter can be set to one of the DEVICE_POWER_STATE enumeration values in the following table.

Power StateMeaning

PowerDeviceD0

Full power state

PowerDeviceD1

The sleep state with the lowest power-up latency

PowerDeviceD2

A medium-latency sleep state

PowerDeviceD3

A full hibernation state and the sleep state with the longest power-up latency

 

The hardware can be accessed only in power state PowerDeviceD0. In any other state, the driver must cache any attempted hardware accesses and defer those accesses until the PowerDeviceD0 state is restored.

For more information, see Power Management for Audio Devices.

Requirements

Target platform

Universal

Version

The PortCls system driver implements the PcRequestNewPowerState function in Microsoft Windows 98/Me and in Windows 2000 and later operating systems.

Header

Portcls.h (include Portcls.h)

Library

Portcls.lib

IRQL

PASSIVE_LEVEL

See also

DEVICE_OBJECT

 

 

Send comments about this topic to Microsoft

Show: