powrprof.h (6.00.3790.1830-Windows 5.0) | | powrprof.h (6.0.6002.18005-Windows 6.0) |
| | |
skipping to change at line 12 | | skipping to change at line 12 |
/*****************************************************************************\ | | /*****************************************************************************\ |
* * | | * * |
* powrprof.h - - Interface for powrprof.dll, the power policy applicator * | | * powrprof.h - - Interface for powrprof.dll, the power policy applicator * |
* * | | * * |
* Version 1.0 * | | * Version 1.0 * |
* * | | * * |
* Copyright (c) Microsoft Corporation. All rights reserved. * | | * Copyright (c) Microsoft Corporation. All rights reserved. * |
* * | | * * |
\*****************************************************************************/ | | \*****************************************************************************/ |
| | |
|
| | #if _MSC_VER > 1000 |
| | #pragma once |
| | #endif |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
extern "C" { | | extern "C" { |
#endif | | #endif |
| | |
// Registry storage structures for the GLOBAL_POWER_POLICY data. There are two | | // Registry storage structures for the GLOBAL_POWER_POLICY data. There are two |
// structures, GLOBAL_MACHINE_POWER_POLICY and GLOBAL_USER_POWER_POLICY. the | | // structures, GLOBAL_MACHINE_POWER_POLICY and GLOBAL_USER_POWER_POLICY. the |
// GLOBAL_MACHINE_POWER_POLICY stores per machine data for which there is no UI. | | // GLOBAL_MACHINE_POWER_POLICY stores per machine data for which there is no UI. |
// GLOBAL_USER_POWER_POLICY stores the per user data. | | // GLOBAL_USER_POWER_POLICY stores the per user data. |
| | |
typedef struct _GLOBAL_MACHINE_POWER_POLICY{ | | typedef struct _GLOBAL_MACHINE_POWER_POLICY{ |
| | |
skipping to change at line 49 | | skipping to change at line 53 |
| | |
// Structure to manage global power policies at the user level. This structure | | // Structure to manage global power policies at the user level. This structure |
// contains data which is common across all power policy profiles. | | // contains data which is common across all power policy profiles. |
| | |
typedef struct _GLOBAL_POWER_POLICY{ | | typedef struct _GLOBAL_POWER_POLICY{ |
GLOBAL_USER_POWER_POLICY user; | | GLOBAL_USER_POWER_POLICY user; |
GLOBAL_MACHINE_POWER_POLICY mach; | | GLOBAL_MACHINE_POWER_POLICY mach; |
} GLOBAL_POWER_POLICY, *PGLOBAL_POWER_POLICY; | | } GLOBAL_POWER_POLICY, *PGLOBAL_POWER_POLICY; |
| | |
// Registry storage structures for the POWER_POLICY data. There are three | | // Registry storage structures for the POWER_POLICY data. There are three |
|
// structures, MACHINE_POWER_POLICY, MACHINE_PROCESSOR_POWER_POLICY and USER_POW | | // structures, MACHINE_POWER_POLICY, MACHINE_PROCESSOR_POWER_POLICY and |
ER_POLICY. the | | // USER_POWER_POLICY. the MACHINE_POWER_POLICY stores per machine data for |
// MACHINE_POWER_POLICY stores per machine data for which there is no UI. | | // which there is no UI. USER_POWER_POLICY stores the per user data. |
// USER_POWER_POLICY stores the per user data. | | |
| | |
typedef struct _MACHINE_POWER_POLICY{ | | typedef struct _MACHINE_POWER_POLICY{ |
ULONG Revision; // 1 | | ULONG Revision; // 1 |
| | |
// meaning of power action "sleep" | | // meaning of power action "sleep" |
SYSTEM_POWER_STATE MinSleepAc; | | SYSTEM_POWER_STATE MinSleepAc; |
SYSTEM_POWER_STATE MinSleepDc; | | SYSTEM_POWER_STATE MinSleepDc; |
SYSTEM_POWER_STATE ReducedLatencySleepAc; | | SYSTEM_POWER_STATE ReducedLatencySleepAc; |
SYSTEM_POWER_STATE ReducedLatencySleepDc; | | SYSTEM_POWER_STATE ReducedLatencySleepDc; |
| | |
| | |
skipping to change at line 77 | | skipping to change at line 81 |
| | |
// processor policies | | // processor policies |
UCHAR MinThrottleAc; | | UCHAR MinThrottleAc; |
UCHAR MinThrottleDc; | | UCHAR MinThrottleDc; |
UCHAR pad1[2]; | | UCHAR pad1[2]; |
POWER_ACTION_POLICY OverThrottledAc; | | POWER_ACTION_POLICY OverThrottledAc; |
POWER_ACTION_POLICY OverThrottledDc; | | POWER_ACTION_POLICY OverThrottledDc; |
| | |
} MACHINE_POWER_POLICY, *PMACHINE_POWER_POLICY; | | } MACHINE_POWER_POLICY, *PMACHINE_POWER_POLICY; |
| | |
|
| | #if (NTDDI_VERSION >= NTDDI_WINXP) // Windows XP Version |
| | // |
| | // deprecated |
| | // |
typedef struct _MACHINE_PROCESSOR_POWER_POLICY { | | typedef struct _MACHINE_PROCESSOR_POWER_POLICY { |
ULONG Revision; // 1 | | ULONG Revision; // 1 |
| | |
PROCESSOR_POWER_POLICY ProcessorPolicyAc; | | PROCESSOR_POWER_POLICY ProcessorPolicyAc; |
PROCESSOR_POWER_POLICY ProcessorPolicyDc; | | PROCESSOR_POWER_POLICY ProcessorPolicyDc; |
| | |
} MACHINE_PROCESSOR_POWER_POLICY, *PMACHINE_PROCESSOR_POWER_POLICY; | | } MACHINE_PROCESSOR_POWER_POLICY, *PMACHINE_PROCESSOR_POWER_POLICY; |
|
| | #endif |
| | |
typedef struct _USER_POWER_POLICY{ | | typedef struct _USER_POWER_POLICY{ |
ULONG Revision; // 1 | | ULONG Revision; // 1 |
| | |
// "system idle" detection | | // "system idle" detection |
POWER_ACTION_POLICY IdleAc; | | POWER_ACTION_POLICY IdleAc; |
POWER_ACTION_POLICY IdleDc; | | POWER_ACTION_POLICY IdleDc; |
ULONG IdleTimeoutAc; | | ULONG IdleTimeoutAc; |
ULONG IdleTimeoutDc; | | ULONG IdleTimeoutDc; |
UCHAR IdleSensitivityAc; | | UCHAR IdleSensitivityAc; |
| | |
skipping to change at line 141 | | skipping to change at line 150 |
} POWER_POLICY, *PPOWER_POLICY; | | } POWER_POLICY, *PPOWER_POLICY; |
| | |
// Constants for GlobalFlags | | // Constants for GlobalFlags |
| | |
#define EnableSysTrayBatteryMeter 0x01 | | #define EnableSysTrayBatteryMeter 0x01 |
#define EnableMultiBatteryDisplay 0x02 | | #define EnableMultiBatteryDisplay 0x02 |
#define EnablePasswordLogon 0x04 | | #define EnablePasswordLogon 0x04 |
#define EnableWakeOnRing 0x08 | | #define EnableWakeOnRing 0x08 |
#define EnableVideoDimDisplay 0x10 | | #define EnableVideoDimDisplay 0x10 |
| | |
|
| | // |
| | // Power setting attribute flags |
| | // |
| | |
| | #define POWER_ATTRIBUTE_HIDE 0x00000001 |
| | |
// This constant is passed as a uiID to WritePwrScheme. | | // This constant is passed as a uiID to WritePwrScheme. |
#define NEWSCHEME (UINT)-1 | | #define NEWSCHEME (UINT)-1 |
| | |
// Prototype for EnumPwrSchemes callback proceedures. | | // Prototype for EnumPwrSchemes callback proceedures. |
| | |
|
| | #if (NTDDI_VERSION >= NTDDI_LONGHORN) |
| | typedef BOOLEAN (CALLBACK* PWRSCHEMESENUMPROC)(UINT, DWORD, LPWSTR, DWORD, LPWST |
| | R, PPOWER_POLICY, LPARAM); |
| | #else |
typedef BOOLEAN (CALLBACK* PWRSCHEMESENUMPROC)(UINT, DWORD, LPTSTR, DWORD, LPTST
R, PPOWER_POLICY, LPARAM); | | typedef BOOLEAN (CALLBACK* PWRSCHEMESENUMPROC)(UINT, DWORD, LPTSTR, DWORD, LPTST
R, PPOWER_POLICY, LPARAM); |
|
| | #endif |
typedef BOOLEAN (CALLBACK* PFNNTINITIATEPWRACTION)(POWER_ACTION, SYSTEM_POWER_ST
ATE, ULONG, BOOLEAN); | | typedef BOOLEAN (CALLBACK* PFNNTINITIATEPWRACTION)(POWER_ACTION, SYSTEM_POWER_ST
ATE, ULONG, BOOLEAN); |
| | |
// Public function prototypes | | // Public function prototypes |
| | |
|
BOOLEAN WINAPI GetPwrDiskSpindownRange(PUINT, PUINT); | | BOOLEAN |
BOOLEAN WINAPI EnumPwrSchemes(PWRSCHEMESENUMPROC, LPARAM); | | WINAPI |
BOOLEAN WINAPI ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY); | | GetPwrDiskSpindownRange( |
BOOLEAN WINAPI ReadPwrScheme(UINT, PPOWER_POLICY); | | __out PUINT puiMax, |
BOOLEAN WINAPI WritePwrScheme(PUINT, LPTSTR, LPTSTR, PPOWER_POLICY); | | __out PUINT puiMin |
BOOLEAN WINAPI WriteGlobalPwrPolicy(PGLOBAL_POWER_POLICY); | | ); |
BOOLEAN WINAPI DeletePwrScheme(UINT); | | |
BOOLEAN WINAPI GetActivePwrScheme(PUINT); | | BOOLEAN |
BOOLEAN WINAPI SetActivePwrScheme(UINT, PGLOBAL_POWER_POLICY, PPOWER_POLICY); | | WINAPI |
BOOLEAN WINAPI GetPwrCapabilities(PSYSTEM_POWER_CAPABILITIES); | | EnumPwrSchemes( |
BOOLEAN WINAPI IsPwrSuspendAllowed(VOID); | | __in PWRSCHEMESENUMPROC lpfn, |
BOOLEAN WINAPI IsPwrHibernateAllowed(VOID); | | __in LPARAM lParam |
BOOLEAN WINAPI IsPwrShutdownAllowed(VOID); | | ); |
BOOLEAN WINAPI IsAdminOverrideActive(PADMINISTRATOR_POWER_POLICY); | | |
BOOLEAN WINAPI SetSuspendState(BOOLEAN, BOOLEAN, BOOLEAN); | | BOOLEAN |
BOOLEAN WINAPI GetCurrentPowerPolicies(PGLOBAL_POWER_POLICY, PPOWER_POLICY); | | WINAPI ReadGlobalPwrPolicy( |
BOOLEAN WINAPI CanUserWritePwrScheme(VOID); | | __in PGLOBAL_POWER_POLICY pGlobalPowerPolicy |
BOOLEAN WINAPI ReadProcessorPwrScheme(UINT, PMACHINE_PROCESSOR_POWER_POLICY); | | ); |
BOOLEAN WINAPI WriteProcessorPwrScheme(UINT, PMACHINE_PROCESSOR_POWER_POLICY); | | |
BOOLEAN WINAPI ValidatePowerPolicies(PGLOBAL_POWER_POLICY, PPOWER_POLICY); | | BOOLEAN |
| | WINAPI |
| | ReadPwrScheme( |
| | __in UINT uiID, |
| | __out PPOWER_POLICY pPowerPolicy |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | WritePwrScheme( |
| | __in PUINT puiID, |
| | __in LPCWSTR lpszSchemeName, |
| | __in_opt LPCWSTR lpszDescription, |
| | __in PPOWER_POLICY lpScheme |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | WriteGlobalPwrPolicy( |
| | __in PGLOBAL_POWER_POLICY pGlobalPowerPolicy |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | DeletePwrScheme( |
| | __in UINT uiID |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | GetActivePwrScheme( |
| | __out PUINT puiID |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | SetActivePwrScheme( |
| | __in UINT uiID, |
| | __in_opt PGLOBAL_POWER_POLICY pGlobalPowerPolicy, |
| | __in_opt PPOWER_POLICY pPowerPolicy |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | GetPwrCapabilities( |
| | __in PSYSTEM_POWER_CAPABILITIES lpspc |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | IsPwrSuspendAllowed( |
| | VOID |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | IsPwrHibernateAllowed( |
| | VOID |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | IsPwrShutdownAllowed( |
| | VOID |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | IsAdminOverrideActive( |
| | __in PADMINISTRATOR_POWER_POLICY papp |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | SetSuspendState( |
| | __in BOOLEAN bHibernate, |
| | __in BOOLEAN bForce, |
| | __in BOOLEAN bWakeupEventsDisabled |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | GetCurrentPowerPolicies( |
| | __out PGLOBAL_POWER_POLICY pGlobalPowerPolicy, |
| | __out PPOWER_POLICY pPowerPolicy |
| | ); |
| | |
| | BOOLEAN |
| | WINAPI |
| | CanUserWritePwrScheme( |
| | VOID |
| | ); |
| | |
| | #if (NTDDI_VERSION >= NTDDI_WINXP) // Windows XP Version |
| | // |
| | // deprecated. |
| | // |
| | BOOLEAN |
| | WINAPI |
| | ReadProcessorPwrScheme( |
| | __in UINT uiID, |
| | __out PMACHINE_PROCESSOR_POWER_POLICY pMachineProcessorPowerPolicy |
| | ); |
| | |
| | // |
| | // deprecated. |
| | // |
| | BOOLEAN |
| | WINAPI |
| | WriteProcessorPwrScheme( |
| | __in UINT uiID, |
| | __in PMACHINE_PROCESSOR_POWER_POLICY pMachineProcessorPowerPolicy |
| | ); |
| | #endif // (NTDDI_VERSION >= NTDDI_WINXP) // Windows XP Version |
| | |
| | BOOLEAN |
| | WINAPI |
| | ValidatePowerPolicies( |
| | __inout_opt PGLOBAL_POWER_POLICY pGlobalPowerPolicy, |
| | __inout_opt PPOWER_POLICY pPowerPolicy |
| | ); |
| | |
#ifndef NT_SUCCESS | | #ifndef NT_SUCCESS |
#define NTSTATUS LONG | | #define NTSTATUS LONG |
#define _OVERRIDE_NTSTATUS_ | | #define _OVERRIDE_NTSTATUS_ |
#endif | | #endif |
| | |
|
NTSTATUS WINAPI CallNtPowerInformation(POWER_INFORMATION_LEVEL, PVOID, ULONG, PV
OID, ULONG); | | NTSTATUS WINAPI CallNtPowerInformation(POWER_INFORMATION_LEVEL, __in_bcount_opt(
cbin) PVOID pvin, ULONG cbin, __out_bcount_opt(cbout) PVOID pvout, ULONG cbout); |
| | |
#ifdef _OVERRIDE_NTSTATUS_ | | #ifdef _OVERRIDE_NTSTATUS_ |
#undef NTSTATUS | | #undef NTSTATUS |
#endif | | #endif |
| | |
|
| | #if (NTDDI_VERSION >= NTDDI_LONGHORN) |
| | // |
| | // Enum which defines which field inside of a |
| | // power setting is being accessed. |
| | // |
| | typedef enum _POWER_DATA_ACCESSOR { |
| | |
| | // |
| | // Used by read/write and enumeration engines |
| | // |
| | ACCESS_AC_POWER_SETTING_INDEX = 0, |
| | ACCESS_DC_POWER_SETTING_INDEX, |
| | ACCESS_FRIENDLY_NAME, |
| | ACCESS_DESCRIPTION, |
| | ACCESS_POSSIBLE_POWER_SETTING, |
| | ACCESS_POSSIBLE_POWER_SETTING_FRIENDLY_NAME, |
| | ACCESS_POSSIBLE_POWER_SETTING_DESCRIPTION, |
| | ACCESS_DEFAULT_AC_POWER_SETTING, |
| | ACCESS_DEFAULT_DC_POWER_SETTING, |
| | ACCESS_POSSIBLE_VALUE_MIN, |
| | ACCESS_POSSIBLE_VALUE_MAX, |
| | ACCESS_POSSIBLE_VALUE_INCREMENT, |
| | ACCESS_POSSIBLE_VALUE_UNITS, |
| | ACCESS_ICON_RESOURCE, |
| | ACCESS_DEFAULT_SECURITY_DESCRIPTOR, |
| | ACCESS_ATTRIBUTES, |
| | |
| | // |
| | // Used by enumeration engine. |
| | // |
| | ACCESS_SCHEME, |
| | ACCESS_SUBGROUP, |
| | ACCESS_INDIVIDUAL_SETTING, |
| | |
| | // |
| | // Used by access check |
| | // |
| | ACCESS_ACTIVE_SCHEME, |
| | ACCESS_CREATE_SCHEME |
| | |
| | } POWER_DATA_ACCESSOR, *PPOWER_DATA_ACCESSOR; |
| | |
| | // |
| | // ========================================= |
| | // Power Scheme APIs |
| | // ========================================= |
| | // |
| | |
| | DWORD |
| | WINAPI |
| | PowerSettingAccessCheck ( |
| | __in POWER_DATA_ACCESSOR AccessFlags, |
| | __in_opt CONST GUID *PowerGuid |
| | ); |
| | |
| | // |
| | // Read functions. |
| | // |
| | DWORD |
| | WINAPI |
| | PowerReadACValueIndex ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out LPDWORD AcValueIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadDCValueIndex ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out LPDWORD DcValueIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadACValue ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_opt PULONG Type, |
| | __out_bcount_opt(*BufferSize) LPBYTE Buffer, |
| | __inout_opt LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadDCValue ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_opt PULONG Type, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadFriendlyName ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadDescription ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadPossibleValue ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_opt PULONG Type, |
| | __in ULONG PossibleSettingIndex, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadPossibleFriendlyName ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in ULONG PossibleSettingIndex, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadPossibleDescription ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in ULONG PossibleSettingIndex, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadValueMin ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out LPDWORD ValueMinimum |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadValueMax ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out LPDWORD ValueMaximum |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadValueIncrement ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out LPDWORD ValueIncrement |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadValueUnitsSpecifier ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_bcount_opt(*BufferSize) UCHAR *Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadACDefaultIndex ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemePersonalityGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid OPTIONAL, |
| | __in CONST GUID *PowerSettingGuid, |
| | __out LPDWORD AcDefaultIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadDCDefaultIndex ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemePersonalityGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in CONST GUID *PowerSettingGuid, |
| | __out LPDWORD DcDefaultIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadIconResourceSpecifier ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __out_bcount_opt(*BufferSize) PUCHAR Buffer, |
| | __inout LPDWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReadSettingAttributes ( |
| | __in_opt CONST GUID *SubGroupGuid, |
| | __in_opt CONST GUID *PowerSettingGuid |
| | ); |
| | |
| | // |
| | // Write functions. |
| | // |
| | DWORD |
| | WINAPI |
| | PowerWriteACValueIndex ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in DWORD AcValueIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteDCValueIndex ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in DWORD DcValueIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteFriendlyName ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteDescription ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in_bcount(BufferSize) UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWritePossibleValue ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in ULONG Type, |
| | __in ULONG PossibleSettingIndex, |
| | __in_bcount(BufferSize) UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWritePossibleFriendlyName ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in ULONG PossibleSettingIndex, |
| | __in_bcount(BufferSize) UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWritePossibleDescription ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in ULONG PossibleSettingIndex, |
| | __in_bcount(BufferSize) UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteValueMin ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in DWORD ValueMinimum |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteValueMax ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in DWORD ValueMaximum |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteValueIncrement ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in DWORD ValueIncrement |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteValueUnitsSpecifier ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in_bcount(BufferSize) UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteACDefaultIndex ( |
| | __in_opt HKEY RootSystemPowerKey, |
| | __in CONST GUID *SchemePersonalityGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in CONST GUID *PowerSettingGuid, |
| | __in DWORD DefaultAcIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteDCDefaultIndex ( |
| | __in_opt HKEY RootSystemPowerKey, |
| | __in CONST GUID *SchemePersonalityGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in CONST GUID *PowerSettingGuid, |
| | __in DWORD DefaultDcIndex |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerWriteIconResourceSpecifier ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in_bcount(BufferSize) UCHAR *Buffer, |
| | __in DWORD BufferSize |
| | ); |
| | |
| | DWORD |
| | PowerWriteSettingAttributes ( |
| | __in_opt CONST GUID *SubGroupGuid, |
| | __in_opt CONST GUID *PowerSettingGuid, |
| | __in DWORD Attributes |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerDuplicateScheme ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SourceSchemeGuid, |
| | __in GUID **DestinationSchemeGuid |
| | ); |
| | |
| | DWORD |
| | PowerImportPowerScheme ( |
| | __in_opt HKEY RootPowerKey, |
| | __in LPCWSTR ImportFileNamePath, |
| | __deref_inout GUID **DestinationSchemeGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerDeleteScheme ( |
| | __in_opt HKEY RootPowerKey, |
| | __in CONST GUID *SchemeGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerRemovePowerSetting ( |
| | __in CONST GUID *PowerSettingSubKeyGuid, |
| | __in CONST GUID *PowerSettingGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerCreateSetting ( |
| | __in_opt HKEY RootSystemPowerKey, |
| | __in CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in CONST GUID *PowerSettingGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerCreatePossibleSetting ( |
| | __in_opt HKEY RootSystemPowerKey, |
| | __in CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in CONST GUID *PowerSettingGuid, |
| | __in ULONG PossibleSettingIndex |
| | ); |
| | |
| | // |
| | // Enumerate Functions. |
| | // |
| | DWORD |
| | WINAPI |
| | PowerEnumerate ( |
| | __in_opt HKEY RootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid, |
| | __in_opt CONST GUID *SubGroupOfPowerSettingsGuid, |
| | __in POWER_DATA_ACCESSOR AccessFlags, |
| | __in ULONG Index, |
| | __out_bcount_opt(*BufferSize) UCHAR *Buffer, |
| | __inout DWORD *BufferSize |
| | ); |
| | |
| | // |
| | // Activate Functions. |
| | // |
| | DWORD |
| | WINAPI |
| | PowerSetActiveScheme ( |
| | __in_opt HKEY UserRootPowerKey, |
| | __in_opt CONST GUID *SchemeGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerGetActiveScheme ( |
| | __in_opt HKEY UserRootPowerKey, |
| | __deref_out GUID **ActivePolicyGuid |
| | ); |
| | |
| | DWORD |
| | PowerOpenUserPowerKey ( |
| | __out HKEY *phUserPowerKey, |
| | __in REGSAM Access, |
| | __in BOOL OpenExisting |
| | ); |
| | |
| | DWORD |
| | PowerOpenSystemPowerKey ( |
| | __out HKEY *phSystemPowerKey, |
| | __in REGSAM Access, |
| | __in BOOL OpenExisting |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerCanRestoreIndividualDefaultPowerScheme ( |
| | __in CONST GUID *SchemeGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerRestoreIndividualDefaultPowerScheme ( |
| | __in CONST GUID *SchemeGuid |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerRestoreDefaultPowerSchemes( |
| | VOID |
| | ); |
| | |
| | DWORD |
| | WINAPI |
| | PowerReplaceDefaultPowerSchemes( |
| | VOID |
| | ); |
| | |
| | POWER_PLATFORM_ROLE |
| | WINAPI |
| | PowerDeterminePlatformRole( |
| | VOID |
| | ); |
| | |
| | #endif // #if (NTDDI_VERSION >= NTDDI_LONGHORN) |
| | |
| | #if (NTDDI_VERSION >= NTDDI_WS03) // Windows server03 |
| | |
| | // |
| | // ========================================= |
| | // Device Power APIs |
| | // ========================================= |
| | // |
| | // |
| | // ======================================================== |
| | // These flags tell us how to interpret a query of |
| | // device power. Use these (or a combination of these) |
| | // for the QueryInterpretationFlags parameter sent into |
| | // DevicePowerEnumDevices(). |
| | // |
| | // They'll ask us for some devices that supports some |
| | // D state. These flags help us determine what the |
| | // user really wants. I.e. does he want the device |
| | // name, or the hardware ID. Does he want some device |
| | // that supports some D state, or does he want us to |
| | // go see if that devices supports some S state? ... |
| | // ======================================================== |
| | // |
| | |
| | // |
| | // Return HardwareID instead of the friendly device name, which |
| | // is the default. |
| | // |
| | #define DEVICEPOWER_HARDWAREID (0x80000000) |
| | |
| | // |
| | // |
| | // 'and' the requested power states. I.e. if the user requested |
| | // that we query devices supporting D1 and D3, this flag says |
| | // "give me devices that support D1 *and* D3". Without this |
| | // flag, the query would be interpreted as "give me devices |
| | // that support D1 *or* D3". |
| | // |
| | #define DEVICEPOWER_AND_OPERATION (0x40000000) |
| | |
| | // Only preform the query on devices that are present in the system. |
| | // |
| | #define DEVICEPOWER_FILTER_DEVICES_PRESENT (0x20000000) |
| | |
| | // |
| | // Only preform the query on devices that are actual hardware. |
| | // |
| | #define DEVICEPOWER_FILTER_HARDWARE (0x10000000) |
| | |
| | // |
| | // Only preform the query on devices that are armed to wake the |
| | // system from a sleep state. |
| | // |
| | #define DEVICEPOWER_FILTER_WAKEENABLED (0x08000000) |
| | |
| | // |
| | // Only preform the query on devices that are capable of being programmed |
| | // to wake the system from a sleep state. |
| | // |
| | #define DEVICEPOWER_FILTER_WAKEPROGRAMMABLE (0x04000000) |
| | |
| | // |
| | // Go find the device who's name is specifed by an input |
| | // parameter, then see if it's got the capabilities specified |
| | // in QueryFlags. |
| | // |
| | #define DEVICEPOWER_FILTER_ON_NAME (0x02000000) |
| | |
| | // |
| | // Define flags to set/clear capabilities in the devices. |
| | // |
| | |
| | // |
| | // Enable the device to wake the system from a sleep state. |
| | // |
| | #define DEVICEPOWER_SET_WAKEENABLED (0x00000001) |
| | |
| | // |
| | // Disable the device from waking the system from a sleep |
| | // state. |
| | // |
| | #define DEVICEPOWER_CLEAR_WAKEENABLED (0x00000002) |
| | |
| | // |
| | // For the QueryFlags parameter, the user should send in |
| | // one of the PDCAP_D*_SUPPORTED flags found in ntpoapi.h. |
| | // |
| | // #define PDCAP_D0_SUPPORTED 0x00000001 |
| | // #define PDCAP_D1_SUPPORTED 0x00000002 |
| | // #define PDCAP_D2_SUPPORTED 0x00000004 |
| | // #define PDCAP_D3_SUPPORTED 0x00000008 |
| | // #define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010 |
| | // #define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020 |
| | // #define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040 |
| | // #define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080 |
| | // #define PDCAP_WARM_EJECT_SUPPORTED 0x00000100 |
| | // |
| | // The user can also send in a combination of these values |
| | // to do queries that match either or both of the specified |
| | // flags. E.g. if the user used (PDCAP_D1_SUPPORTED | PDCAP_D3_SUPPORTED), |
| | // then the query would return a device that supported *either* |
| | // D1 or D3. The user could specify QUERY_AND_OPERATION in |
| | // QueryInterpretationFlags to get a device that supported |
| | // D1 *and* D3. |
| | // |
| | |
| | // |
| | // We also support querying on S states. Although devices don't |
| | // really understand system states, we can use the D-to-S state |
| | // mappings to derive this. For example, if we ask a device if |
| | // he supports S2, we can derive that by looking at his D-to-S |
| | // mappings. Suppose the device has a D-to-S state mapping |
| | // that looks like this: |
| | // S0 -> D0 |
| | // S1 -> D3 |
| | // S2 -> D3 |
| | // S3 -> D3 |
| | // S4 -> D3 |
| | // S5 -> D3 |
| | // |
| | // We see that S2 maps to D3 on this device. Does this device |
| | // actually support D3? We can find that out. If so, then we |
| | // say that this device supports S2. |
| | // |
| | // We have to make up the S-state vectors because there's no |
| | // existing values like the PDCAP_D* values. |
| | // |
| | #define PDCAP_S0_SUPPORTED 0x00010000 |
| | #define PDCAP_S1_SUPPORTED 0x00020000 |
| | #define PDCAP_S2_SUPPORTED 0x00040000 |
| | #define PDCAP_S3_SUPPORTED 0x00080000 |
| | #define PDCAP_WAKE_FROM_S0_SUPPORTED 0x00100000 |
| | #define PDCAP_WAKE_FROM_S1_SUPPORTED 0x00200000 |
| | #define PDCAP_WAKE_FROM_S2_SUPPORTED 0x00400000 |
| | #define PDCAP_WAKE_FROM_S3_SUPPORTED 0x00800000 |
| | #define PDCAP_S4_SUPPORTED 0x01000000 |
| | #define PDCAP_S5_SUPPORTED 0x02000000 |
| | |
| | // |
| | // Function prototypes |
| | // |
| | extern |
| | BOOLEAN |
| | DevicePowerEnumDevices( |
| | __in ULONG QueryIndex, |
| | __in ULONG QueryInterpretationFlags, |
| | __in ULONG QueryFlags, |
| | __out_bcount_opt(*pBufferSize) PBYTE pReturnBuffer, |
| | __inout PULONG pBufferSize |
| | ); |
| | |
| | extern |
| | DWORD |
| | DevicePowerSetDeviceState( |
| | __in LPCWSTR DeviceDescription, |
| | __in ULONG SetFlags, |
| | __in_opt PVOID SetData |
| | ); |
| | |
| | BOOLEAN |
| | DevicePowerOpen( |
| | __in_opt ULONG DebugMask |
| | ); |
| | |
| | BOOLEAN |
| | DevicePowerClose( |
| | VOID |
| | ); |
| | #endif // (NTDDI_VERSION >= NTDDI_WS03) Windows server03 version |
| | |
#ifdef __cplusplus | | #ifdef __cplusplus |
|
} /* extern "C" */ | | } |
#endif | | #endif |
| | |
End of changes. 11 change blocks. |
26 lines changed or deleted | | 846 lines changed or added |
|