DevicePowerNotify

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

DWORD DevicePowerNotify(
  PVOID pvDevice, 
  CEDEVICE_POWER_STATE DeviceState, 
  DWORD Flags
);

Parameters

  • 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

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

Remarks

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.

Requirements

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

See Also

CEDEVICE_POWER_STATE | IOCTL_POWER_SET

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.