master
 1/**
 2 * This file has no copyright assigned and is placed in the Public Domain.
 3 * This file is part of the mingw-w64 runtime package.
 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 5 */
 6
 7#ifndef _POWERSETTING_H_
 8#define _POWERSETTING_H_
 9
10#include <apiset.h>
11#include <apisetcconv.h>
12
13#ifdef _CONTRACT_GEN
14#include <nt.h>
15#include <ntrtl.h>
16#include <nturtl.h>
17#include <minwindef.h>
18#endif
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
25
26#ifndef _HPOWERNOTIFY_DEF_
27#define _HPOWERNOTIFY_DEF_
28
29typedef PVOID HPOWERNOTIFY, *PHPOWERNOTIFY;
30
31#endif /* _HPOWERNOTIFY_DEF_ */
32
33#if (NTDDI_VERSION >= NTDDI_VISTA)
34DWORD WINAPI PowerReadACValue(HKEY RootPowerKey, CONST GUID *SchemeGuid, CONST GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, PULONG Type, LPBYTE Buffer, LPDWORD BufferSize);
35DWORD WINAPI PowerReadDCValue(HKEY RootPowerKey, CONST GUID *SchemeGuid, CONST GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, PULONG Type, PUCHAR Buffer, LPDWORD BufferSize);
36DWORD WINAPI PowerWriteACValueIndex(HKEY RootPowerKey, CONST GUID *SchemeGuid, CONST GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, DWORD AcValueIndex);
37DWORD WINAPI PowerWriteDCValueIndex(HKEY RootPowerKey, CONST GUID *SchemeGuid, CONST GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, DWORD DcValueIndex);
38DWORD WINAPI PowerGetActiveScheme(HKEY UserRootPowerKey, GUID **ActivePolicyGuid);
39DWORD WINAPI PowerSetActiveScheme(HKEY UserRootPowerKey, CONST GUID *SchemeGuid);
40#endif
41
42#if (NTDDI_VERSION >= NTDDI_WIN7)
43DWORD WINAPI PowerSettingRegisterNotification(LPCGUID SettingGuid, DWORD Flags, HANDLE Recipient, PHPOWERNOTIFY RegistrationHandle);
44DWORD WINAPI PowerSettingUnregisterNotification(HPOWERNOTIFY RegistrationHandle);
45#endif
46
47#if NTDDI_VERSION >= NTDDI_WIN10_RS5
48
49typedef enum EFFECTIVE_POWER_MODE {
50    EffectivePowerModeBatterySaver,
51    EffectivePowerModeBetterBattery,
52    EffectivePowerModeBalanced,
53    EffectivePowerModeHighPerformance,
54    EffectivePowerModeMaxPerformance,
55    EffectivePowerModeGameMode,
56    EffectivePowerModeMixedReality
57} EFFECTIVE_POWER_MODE;
58
59#define EFFECTIVE_POWER_MODE_V1 (0x00000001)
60#define EFFECTIVE_POWER_MODE_V2 (0x00000002)
61
62typedef VOID WINAPI EFFECTIVE_POWER_MODE_CALLBACK(EFFECTIVE_POWER_MODE Mode, VOID *Context);
63
64HRESULT WINAPI PowerRegisterForEffectivePowerModeNotifications(ULONG Version, EFFECTIVE_POWER_MODE_CALLBACK *Callback, VOID *Context, VOID **RegistrationHandle);
65HRESULT WINAPI PowerUnregisterFromEffectivePowerModeNotifications(VOID *RegistrationHandle);
66#endif
67
68#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif /* _POWERSETTING_H_ */