This function requests that the 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:.
  • DeviceState
    [in] Indicates the device power state specified in CEDEVICE_POWER_STATE.
  • Flags
    [in] Set to POWER_NAME to specify the name of the device that is requesting the power request.

Return Values

    Returned if there is not a valid parameter.
    Attempt to update the device power state failed.
    The device class or the device within the device class cannot be found.
  • Win32 error code
    Propagated from the IOCTL_POWER_SET call.


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 the Power Manager that it wants to change its device power level using this API. If no entity has requested a power level requirement for the device, then the 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.


OS Versions: Windows CE .NET 4.0 and later.
Header: Pm.h.
Link Library: Coredll.lib.

See Also


 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.