From f30a979ddd34b639c3b1b855f8bbf23c993e477d Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <[email protected]>
Date: Fri, 24 Mar 2023 21:44:14 +0530
Subject: [PATCH 2/2] headers: Add powersettings.h

Signed-off-by: Biswapriyo Nath <[email protected]>
---
 mingw-w64-headers/include/powersetting.h | 74 ++++++++++++++++++++++++
 mingw-w64-headers/include/powrprof.h     | 47 +--------------
 2 files changed, 75 insertions(+), 46 deletions(-)
 create mode 100644 mingw-w64-headers/include/powersetting.h

diff --git a/mingw-w64-headers/include/powersetting.h 
b/mingw-w64-headers/include/powersetting.h
new file mode 100644
index 0000000..b2dd5a6
--- /dev/null
+++ b/mingw-w64-headers/include/powersetting.h
@@ -0,0 +1,74 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#ifndef _POWERSETTING_H_
+#define _POWERSETTING_H_
+
+#include <apiset.h>
+#include <apisetcconv.h>
+
+#ifdef _CONTRACT_GEN
+#include <nt.h>
+#include <ntrtl.h>
+#include <nturtl.h>
+#include <minwindef.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+#ifndef _HPOWERNOTIFY_DEF_
+#define _HPOWERNOTIFY_DEF_
+
+typedef PVOID HPOWERNOTIFY, *PHPOWERNOTIFY;
+
+#endif /* _HPOWERNOTIFY_DEF_ */
+
+#if (NTDDI_VERSION >= NTDDI_VISTA)
+DWORD WINAPI PowerReadACValue(HKEY RootPowerKey, CONST GUID *SchemeGuid, CONST 
GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, PULONG Type, 
LPBYTE Buffer, LPDWORD BufferSize);
+DWORD WINAPI PowerReadDCValue(HKEY RootPowerKey, CONST GUID *SchemeGuid, CONST 
GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, PULONG Type, 
PUCHAR Buffer, LPDWORD BufferSize);
+DWORD WINAPI PowerWriteACValueIndex(HKEY RootPowerKey, CONST GUID *SchemeGuid, 
CONST GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, DWORD 
AcValueIndex);
+DWORD WINAPI PowerWriteDCValueIndex(HKEY RootPowerKey, CONST GUID *SchemeGuid, 
CONST GUID *SubGroupOfPowerSettingsGuid, CONST GUID *PowerSettingGuid, DWORD 
DcValueIndex);
+DWORD WINAPI PowerGetActiveScheme(HKEY UserRootPowerKey, GUID 
**ActivePolicyGuid);
+DWORD WINAPI PowerSetActiveScheme(HKEY UserRootPowerKey, CONST GUID 
*SchemeGuid);
+#endif
+
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+DWORD WINAPI PowerSettingRegisterNotification(LPCGUID SettingGuid, DWORD 
Flags, HANDLE Recipient, PHPOWERNOTIFY RegistrationHandle);
+DWORD WINAPI PowerSettingUnregisterNotification(HPOWERNOTIFY 
RegistrationHandle);
+#endif
+
+#if NTDDI_VERSION >= NTDDI_WIN10_RS5
+
+typedef enum EFFECTIVE_POWER_MODE {
+    EffectivePowerModeBatterySaver,
+    EffectivePowerModeBetterBattery,
+    EffectivePowerModeBalanced,
+    EffectivePowerModeHighPerformance,
+    EffectivePowerModeMaxPerformance,
+    EffectivePowerModeGameMode,
+    EffectivePowerModeMixedReality
+} EFFECTIVE_POWER_MODE;
+
+#define EFFECTIVE_POWER_MODE_V1 (0x00000001)
+#define EFFECTIVE_POWER_MODE_V2 (0x00000002)
+
+typedef VOID WINAPI EFFECTIVE_POWER_MODE_CALLBACK(EFFECTIVE_POWER_MODE Mode, 
VOID *Context);
+
+HRESULT WINAPI PowerRegisterForEffectivePowerModeNotifications(ULONG Version, 
EFFECTIVE_POWER_MODE_CALLBACK *Callback, VOID *Context, VOID 
**RegistrationHandle);
+HRESULT WINAPI PowerUnregisterFromEffectivePowerModeNotifications(VOID 
*RegistrationHandle);
+#endif
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _POWERSETTING_H_ */
diff --git a/mingw-w64-headers/include/powrprof.h 
b/mingw-w64-headers/include/powrprof.h
index d9ff756..796b052 100644
--- a/mingw-w64-headers/include/powrprof.h
+++ b/mingw-w64-headers/include/powrprof.h
@@ -8,6 +8,7 @@
 #define _POWRPROF_H_
 
 #include <powerbase.h>
+#include <powersetting.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -220,11 +221,6 @@ DWORD WINAPI PowerEnumerate(
   DWORD *BufferSize
 );
 
-DWORD WINAPI PowerGetActiveScheme(
-  HKEY UserRootPowerKey,
-  GUID **ActivePolicyGuid
-);
-
 DWORD WINAPI PowerImportPowerScheme(
   HKEY RootPowerKey,
   LPCWSTR ImportFileNamePath,
@@ -239,16 +235,6 @@ DWORD WINAPI PowerReadACDefaultIndex(
   LPDWORD AcDefaultIndex
 );
 
-DWORD WINAPI PowerReadACValue(
-  HKEY RootPowerKey,
-  const GUID *SchemeGuid,
-  const GUID *SubGroupOfPowerSettingsGuid,
-  const GUID *PowerSettingGuid,
-  PULONG Type,
-  LPBYTE Buffer,
-  LPDWORD BufferSize
-);
-
 DWORD WINAPI PowerReadACValueIndex(
   HKEY RootPowerKey,
   const GUID *SchemeGuid,
@@ -265,16 +251,6 @@ DWORD WINAPI PowerReadDCDefaultIndex(
   LPDWORD DcDefaultIndex
 );
 
-DWORD WINAPI PowerReadDCValue(
-  HKEY RootPowerKey,
-  const GUID *SchemeGuid,
-  const GUID *SubGroupOfPowerSettingsGuid,
-  const GUID *PowerSettingGuid,
-  PULONG Type,
-  PUCHAR Buffer,
-  LPDWORD BufferSize
-);
-
 DWORD WINAPI PowerReadDCValueIndex(
   HKEY RootPowerKey,
   const GUID *SchemeGuid,
@@ -385,11 +361,6 @@ DWORD WINAPI PowerRestoreIndividualDefaultPowerScheme(
   const GUID *SchemeGuid
 );
 
-DWORD WINAPI PowerSetActiveScheme(
-  HKEY UserRootPowerKey,
-  const GUID *SchemeGuid
-);
-
 DWORD WINAPI PowerSettingAccessCheck(
   POWER_DATA_ACCESSOR AccessFlags,
   const GUID *PowerGuid
@@ -403,14 +374,6 @@ DWORD WINAPI PowerWriteACDefaultIndex(
   DWORD DefaultAcIndex
 );
 
-DWORD WINAPI PowerWriteACValueIndex(
-  HKEY RootPowerKey,
-  const GUID *SchemeGuid,
-  const GUID *SubGroupOfPowerSettingsGuid,
-  const GUID *PowerSettingGuid,
-  DWORD AcValueIndex
-);
-
 DWORD WINAPI PowerWriteDCDefaultIndex(
   HKEY RootSystemPowerKey,
   const GUID *SchemePersonalityGuid,
@@ -419,14 +382,6 @@ DWORD WINAPI PowerWriteDCDefaultIndex(
   DWORD DefaultDcIndex
 );
 
-DWORD WINAPI PowerWriteDCValueIndex(
-  HKEY RootPowerKey,
-  const GUID *SchemeGuid,
-  const GUID *SubGroupOfPowerSettingsGuid,
-  const GUID *PowerSettingGuid,
-  DWORD DcValueIndex
-);
-
 DWORD WINAPI PowerWriteDescription(
   HKEY RootPowerKey,
   const GUID *SchemeGuid,
-- 
2.40.0

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to