DevicePowerSetDeviceState function (powrprof.h)

Modifies the specified data on the specified device.

Syntax

DWORD DevicePowerSetDeviceState(
  [in] LPCWSTR DeviceDescription,
  [in] ULONG   SetFlags,
  [in] PVOID   SetData
);

Parameters

[in] DeviceDescription

The name or hardware identifier string of the device to be modified.

[in] SetFlags

The properties of the device that are to be modified.

Value Meaning
DEVICEPOWER_SET_WAKEENABLED
0x00000001
Enables the specified device to wake the system.
DEVICEPOWER_CLEAR_WAKEENABLED
0x00000002
Stops the specified device from being able to wake the system.

[in] SetData

Reserved, must be NULL.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header powrprof.h
Library PowrProf.lib
DLL PowrProf.dll

See also

Device Power Management