kernel32: Improve the GetSystemPowerStatus stub.

Hans Leidekker hans at codeweavers.com
Thu May 28 08:01:47 CDT 2009


diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c
index 9236d8f..8d41044 100644
--- a/dlls/kernel32/powermgnt.c
+++ b/dlls/kernel32/powermgnt.c
@@ -37,10 +37,21 @@ BOOL WINAPI GetDevicePowerState(HANDLE hDevice, BOOL* pfOn)
 /***********************************************************************
  *           GetSystemPowerStatus      (KERNEL32.@)
  */
-BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
+BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS ps)
 {
-    WARN("(): stub, harmless.\n");
-    return FALSE;   /* no power management support */
+    WARN("(%p): stub, harmless.\n", ps);
+
+    if (ps)
+    {
+        ps->ACLineStatus        = 255;
+        ps->BatteryFlag         = 255;
+        ps->BatteryLifePercent  = 255;
+        ps->Reserved1           = 0;
+        ps->BatteryLifeTime     = ~0u;
+        ps->BatteryFullLifeTime = ~0u;
+        return TRUE;
+    }
+    return FALSE;
 }
 
 /***********************************************************************



More information about the wine-patches mailing list