CanUserWritePwrScheme function (powrprof.h)

[CanUserWritePwrScheme is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Applications written for Windows Vista and later should use PowerSettingAccessCheck instead.]

Determines whether the current user has sufficient privilege to write a power scheme.

Syntax

BOOLEAN CanUserWritePwrScheme();

Return value

If the current user has sufficient privilege to write a power scheme, the function returns TRUE.

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

Error Meaning
ERROR_ACCESS_DENIED
The current user does not have sufficient privilege to write a power scheme.

Remarks

This function is useful if your application is impersonating a user.

For more information on using PowrProf.h, see Power Schemes.

Requirements

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

See also

Power Management Functions

Power Schemes

WritePwrScheme