Calling PoStartNextPowerIrp from a Device Power Policy Owner

Beginning with Windows Vista, calling PoStartNextPowerIrp is not required and call to this routine performs no power management operation. However, in Windows ServerĀ 2003, Windows XP, and Windows 2000, a function driver that owns device power policy must call PoStartNextPowerIrp once for every IRP_MN_QUERY_POWER or IRP_MN_SET_POWER request that the driver receives. When the call occurs depends on the type of request and whether the driver will fail or succeed the request, as the following table shows.

Type of request If driver succeeds the request, the call occurs: If driver fails the request, the call occurs:

IRP_MN_QUERY_POWER (device power state)

In an IoCompletion routine, immediately before returning.

In DispatchPower routine, before calling IoCompleteRequest.

IRP_MN_QUERY_POWER (system power state)

In the PoRequestPowerIrp callback routine for the related device IRP, immediately before completing the system IRP.

In DispatchPower routine, before calling IoCompleteRequest.

IRP_MN_SET_POWER (device power state)

In an IoCompletion routine, immediately before returning.

Not allowed.

IRP_MN_SET_POWER (system power state)

In the PoRequestPowerIrp callback routine for the related device IRP, immediately before completing the system IRP.

Not allowed.