DevicePowerNotify (Compact 2013)


This function requests that Power Manager change the power state of a device.


DWORD DevicePowerNotify(
  PVOID pvDevice,
  DWORD Flags


  • pvDevice
    [in] Specifies the device. Must be a valid LPWSTR device name, for example, COM1:.
  • Flags
    [in] Set to POWER_NAME to specify the name of the device that is requesting the power request.

Return Value

    Indicates that the device class or the device within the device class cannot be found.
    Indicates that there is no valid parameter.
    Indicates that the attempt to update the device power state failed.


When DevicePowerNotify is called, qualify the name of your device with an associated class. For example, {8DD679CE-8AB4-43c8-A14A-EA4963FAA715}\DSK1: refers to a power-managed block device called DSK1. If no class qualification is present, the generic power-manageable class {A32942B7-920C-486b-B0E6-92A702A99B35} is assumed.

A device driver can notify Power Manager that it wants to change its device power level using this function. If no entity has requested a power level requirement for the device, Power Manager may issue an IOCTL_POWER_SET to the requested device power level. Drivers should not assume that successful calls to this function will result in an IOCTL_POWER_SET or that subsequent IOCTL_POWER_SET operations are a result of this call.

Power Manager supports DevicePowerNotify requests from a device while processing IOCTL_POWER_CAPABILITIES. This enables devices that are set to be loaded at a device power state other than D0 to request that their power state value be updated immediately following registration with Power Manager. As with any DevicePowerNotify function call, the request might not result in a device power state update. This depends on constraints imposed on Power Manager by applications, as well as the system power state configuration.

Drivers that support power management should report their capabilities as accurately as possible during enumeration. From then on, they will receive requests from Power Manager to get or change their device power states. Devices that can manage their own power should use DevicePowerNotify to request that Power Manager change their device power state.






See Also


Power Management Functions