[SDK][NDK] Move SYSTEM_POWER_INFORMATION to ntpoapi.h (#869)
authorSerge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
Wed, 5 Dec 2018 12:48:01 +0000 (13:48 +0100)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Wed, 5 Dec 2018 12:48:01 +0000 (13:48 +0100)
As suggested by Thomas Faber. See CORE-12587 for more details.

modules/rostests/apitests/powrprof/power.c
sdk/include/ddk/ntpoapi.h
sdk/include/ndk/potypes.h
sdk/include/xdk/winnt_old.h

index e618fd8..d95b8d1 100644 (file)
@@ -14,6 +14,7 @@
 #include <ntstatus.h>
 #define WIN32_NO_STATUS
 #include <winreg.h>
+#include <ndk/potypes.h>
 #include <powrprof.h>
 
 unsigned int g_NumPwrSchemes = 0;
index 7f14963..7856fff 100644 (file)
@@ -271,6 +271,13 @@ typedef struct _PROCESSOR_STATE_HANDLER2 {
   PROCESSOR_PERF_LEVEL PerfLevel[1];
 } PROCESSOR_STATE_HANDLER2, *PPROCESSOR_STATE_HANDLER2;
 
+typedef struct _SYSTEM_POWER_INFORMATION {
+  ULONG MaxIdlenessAllowed;
+  ULONG Idleness;
+  ULONG TimeRemaining;
+  UCHAR CoolingMode;
+} SYSTEM_POWER_INFORMATION, *PSYSTEM_POWER_INFORMATION;
+
 _IRQL_requires_max_(PASSIVE_LEVEL)
 __kernel_entry
 NTSYSCALLAPI
index 48a2dd6..9c67881 100644 (file)
@@ -27,6 +27,20 @@ Author:
 #include <ntpoapi.h>
 #endif
 
+#ifdef NTOS_MODE_USER
+//
+// Information Structures for NtPowerInformation
+// Copied from ddk\ntpoapi.h
+//
+typedef struct _SYSTEM_POWER_INFORMATION
+{
+    ULONG MaxIdlenessAllowed;
+    ULONG Idleness;
+    ULONG TimeRemaining;
+    UCHAR CoolingMode;
+} SYSTEM_POWER_INFORMATION, *PSYSTEM_POWER_INFORMATION;
+#endif
+
 //
 // Docking states
 //
@@ -123,7 +137,9 @@ typedef struct _PO_IRP_QUEUE
     PIRP PendingIrpList;
 } PO_IRP_QUEUE, *PPO_IRP_QUEUE;
 
+//
 // Power IRP Manager
+//
 typedef struct _PO_IRP_MANAGER
 {
     PO_IRP_QUEUE DeviceIrpQueue;
index 07c8118..1ea3d93 100644 (file)
@@ -3882,15 +3882,6 @@ typedef enum _POWER_INFORMATION_LEVEL {
   PowerInformationLevelMaximum
 } POWER_INFORMATION_LEVEL;
 
-#if 1 /* (_WIN32_WINNT >= 0x0500) */
-typedef struct _SYSTEM_POWER_INFORMATION {
-    ULONG  MaxIdlenessAllowed;
-    ULONG  Idleness;
-    ULONG  TimeRemaining;
-    UCHAR  CoolingMode;
-} SYSTEM_POWER_INFORMATION,*PSYSTEM_POWER_INFORMATION;
-#endif
-
 #if (_WIN32_WINNT >= 0x0501)
 
 typedef enum _ACTIVATION_CONTEXT_INFO_CLASS {