DevicePowerSetDeviceState function

Modifies the specified data on the specified device.

Syntax


DWORD WINAPI DevicePowerSetDeviceState(
  _In_ LPCWSTR DeviceDescription,
  _In_ ULONG   SetFlags,
  _In_ PCVOID  SetData
);

Parameters

DeviceDescription [in]

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

SetFlags [in]

The properties of the device that are to be modified.

ValueMeaning
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.

 

SetData [in]

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.

Examples

For an example that uses this function, see Using the Device Power API.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

PowrProf.h

Library

PowrProf.lib

DLL

PowrProf.dll

See also

Device Power Management

 

 

Show: