Export (0) Print
Expand All
Expand Minimize

PowerSettingAccessCheckEx function

Queries for a group policy override for specified power settings and specifies the requested access for the setting.

Syntax


DWORD PowerSettingAccessCheckEx(
  _In_      POWER_DATA_ACCESSOR AccessFlags,
  _In_opt_  const GUID *PowerGuid,
  _In_      REGSAM AccessType
);

Parameters

AccessFlags [in]

The type of access to check for group policy overrides.

ValueMeaning
ACCESS_AC_POWER_SETTING_INDEX
0 (0x0)

Check for overrides on AC power settings.

ACCESS_DC_POWER_SETTING_INDEX
1 (0x1)

Check for overrides on DC power settings.

ACCESS_SCHEME
16 (0x10)

Check for restrictions on specific power schemes.

ACCESS_ACTIVE_SCHEME
19 (0x13)

Check for restrictions on active power schemes.

ACCESS_CREATE_SCHEME
20 (0x14)

Check for restrictions on creating or restoring power schemes.

 

PowerGuid [in, optional]

The identifier of the power setting.

AccessType [in]

The type of security access for the setting. For more information, see Registry Key Security and Access Rights.

This parameter can be one of the following values.

ValueMeaning
KEY_READ

Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY values.

KEY_WRITE

Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights.

 

Return value

Returns ERROR_SUCCESS (zero) if the call was successful, and a nonzero value if the call failed.

Return code/valueDescription
ERROR_SUCCESS
0 (0x0)

The specified power setting is not currently overridden by a group policy.

ERROR_ACCESS_DISABLED_BY_POLICY
1260 (0x4EC)

This program is blocked by group policy. For more information, contact your system administrator.

ERROR_INSTALL_REMOTE_DISALLOWED
1640 (0x668)

Only Administrators can remotely access power settings.

 

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Powrprof.h

Library

Powrprof.lib

DLL

Powrprof.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft