xref: /reactos/sdk/include/psdk/powrprof.h (revision 34593d93)
1 #ifndef _POWRPROF_H
2 #define _POWRPROF_H
3 
4 #ifndef __WINE_WINTERNL_H
5 /* FIXME: Include this, so NTSTATUS gets defined.
6    Not very clean, but I can't get the hacH^H^H^override used
7    by official PSDK to work. */
8 #include <ntsecapi.h>
9 #endif
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #define EnableMultiBatteryDisplay 2
16 #define EnablePasswordLogon 4
17 #define EnableSysTrayBatteryMeter 1
18 #define EnableWakeOnRing 8
19 #define EnableVideoDimDisplay 16
20 #define NEWSCHEME (UINT)-1
21 
22 #ifndef RC_INVOKED
23 
24 typedef struct _GLOBAL_MACHINE_POWER_POLICY{
25    ULONG Revision;
26    SYSTEM_POWER_STATE LidOpenWakeAc;
27    SYSTEM_POWER_STATE LidOpenWakeDc;
28    ULONG BroadcastCapacityResolution;
29 } GLOBAL_MACHINE_POWER_POLICY, *PGLOBAL_MACHINE_POWER_POLICY;
30 typedef struct _GLOBAL_USER_POWER_POLICY{
31    ULONG Revision;
32    POWER_ACTION_POLICY PowerButtonAc;
33    POWER_ACTION_POLICY PowerButtonDc;
34    POWER_ACTION_POLICY SleepButtonAc;
35    POWER_ACTION_POLICY SleepButtonDc;
36    POWER_ACTION_POLICY LidCloseAc;
37    POWER_ACTION_POLICY LidCloseDc;
38    SYSTEM_POWER_LEVEL DischargePolicy[NUM_DISCHARGE_POLICIES];
39    ULONG GlobalFlags;
40 } GLOBAL_USER_POWER_POLICY, *PGLOBAL_USER_POWER_POLICY;
41 typedef struct _GLOBAL_POWER_POLICY{
42    GLOBAL_USER_POWER_POLICY user;
43    GLOBAL_MACHINE_POWER_POLICY mach;
44 } GLOBAL_POWER_POLICY, *PGLOBAL_POWER_POLICY;
45 typedef struct _MACHINE_POWER_POLICY{
46    ULONG Revision;
47    SYSTEM_POWER_STATE MinSleepAc;
48    SYSTEM_POWER_STATE MinSleepDc;
49    SYSTEM_POWER_STATE ReducedLatencySleepAc;
50    SYSTEM_POWER_STATE ReducedLatencySleepDc;
51    ULONG DozeTimeoutAc;
52    ULONG DozeTimeoutDc;
53    ULONG DozeS4TimeoutAc;
54    ULONG DozeS4TimeoutDc;
55    UCHAR MinThrottleAc;
56    UCHAR MinThrottleDc;
57    UCHAR pad1[2];
58    POWER_ACTION_POLICY OverThrottledAc;
59    POWER_ACTION_POLICY OverThrottledDc;
60 } MACHINE_POWER_POLICY, *PMACHINE_POWER_POLICY;
61 typedef struct _MACHINE_PROCESSOR_POWER_POLICY {
62    ULONG Revision;
63    PROCESSOR_POWER_POLICY ProcessorPolicyAc;
64    PROCESSOR_POWER_POLICY ProcessorPolicyDc;
65 } MACHINE_PROCESSOR_POWER_POLICY, *PMACHINE_PROCESSOR_POWER_POLICY;
66 typedef struct _USER_POWER_POLICY{
67    ULONG Revision;
68    POWER_ACTION_POLICY IdleAc;
69    POWER_ACTION_POLICY IdleDc;
70    ULONG IdleTimeoutAc;
71    ULONG IdleTimeoutDc;
72    UCHAR IdleSensitivityAc;
73    UCHAR IdleSensitivityDc;
74    UCHAR ThrottlePolicyAc;
75    UCHAR ThrottlePolicyDc;
76    SYSTEM_POWER_STATE MaxSleepAc;
77    SYSTEM_POWER_STATE MaxSleepDc;
78    ULONG Reserved[2];
79    ULONG VideoTimeoutAc;
80    ULONG VideoTimeoutDc;
81    ULONG SpindownTimeoutAc;
82    ULONG SpindownTimeoutDc;
83    BOOLEAN OptimizeForPowerAc;
84    BOOLEAN OptimizeForPowerDc;
85    UCHAR FanThrottleToleranceAc;
86    UCHAR FanThrottleToleranceDc;
87    UCHAR ForcedThrottleAc;
88    UCHAR ForcedThrottleDc;
89 } USER_POWER_POLICY, *PUSER_POWER_POLICY;
90 typedef struct _POWER_POLICY{
91    USER_POWER_POLICY user;
92    MACHINE_POWER_POLICY mach;
93 } POWER_POLICY, *PPOWER_POLICY;
94 typedef BOOLEAN (CALLBACK* PWRSCHEMESENUMPROC)(UINT, DWORD, LPWSTR, DWORD, LPWSTR, PPOWER_POLICY, LPARAM);
95 typedef BOOLEAN (CALLBACK* PFNNTINITIATEPWRACTION)(POWER_ACTION, SYSTEM_POWER_STATE, ULONG, BOOLEAN);
96 NTSTATUS WINAPI CallNtPowerInformation(POWER_INFORMATION_LEVEL, PVOID, ULONG, PVOID, ULONG);
97 BOOLEAN WINAPI CanUserWritePwrScheme(VOID);
98 BOOLEAN WINAPI DeletePwrScheme(UINT);
99 BOOLEAN WINAPI EnumPwrSchemes(PWRSCHEMESENUMPROC, LPARAM);
100 BOOLEAN WINAPI GetActivePwrScheme(PUINT);
101 BOOLEAN WINAPI GetCurrentPowerPolicies(PGLOBAL_POWER_POLICY, PPOWER_POLICY);
102 BOOLEAN WINAPI GetPwrCapabilities(PSYSTEM_POWER_CAPABILITIES);
103 BOOLEAN WINAPI GetPwrDiskSpindownRange(PUINT, PUINT);
104 BOOLEAN WINAPI IsAdminOverrideActive(PADMINISTRATOR_POWER_POLICY);
105 BOOLEAN WINAPI IsPwrHibernateAllowed(VOID);
106 BOOLEAN WINAPI IsPwrShutdownAllowed(VOID);
107 BOOLEAN WINAPI IsPwrSuspendAllowed(VOID);
108 BOOLEAN WINAPI ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY);
109 BOOLEAN WINAPI ReadProcessorPwrScheme(UINT, PMACHINE_PROCESSOR_POWER_POLICY);
110 BOOLEAN WINAPI ReadPwrScheme(UINT, PPOWER_POLICY);
111 BOOLEAN WINAPI SetActivePwrScheme(UINT, PGLOBAL_POWER_POLICY, PPOWER_POLICY);
112 BOOLEAN WINAPI SetSuspendState(BOOLEAN, BOOLEAN, BOOLEAN);
113 BOOLEAN WINAPI WriteGlobalPwrPolicy(PGLOBAL_POWER_POLICY);
114 BOOLEAN WINAPI WriteProcessorPwrScheme(UINT, PMACHINE_PROCESSOR_POWER_POLICY);
115 BOOLEAN WINAPI ValidatePowerPolicies(PGLOBAL_POWER_POLICY, PPOWER_POLICY);
116 BOOLEAN WINAPI WritePwrScheme(PUINT, LPWSTR, LPWSTR, PPOWER_POLICY);
117 
118 #endif /* RC_INVOKED */
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif /* _POWRPROF_H */
125