[KERNEL32] GetSystemPowerStatus(): Set the BATTERY_FLAG_CRITICAL flag if the battery...
authorEric Kohl <eric.kohl@reactos.org>
Fri, 19 Apr 2019 20:30:46 +0000 (22:30 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 19 Apr 2019 20:30:46 +0000 (22:30 +0200)
dll/win32/kernel32/client/power.c

index e25d25a..4a486fe 100644 (file)
@@ -61,6 +61,9 @@ GetSystemPowerStatus(IN LPSYSTEM_POWER_STATUS PowerStatus)
             PowerStatus->BatteryLifePercent = 100;
         }
 
+        if (PowerStatus->BatteryLifePercent <= 4)
+            PowerStatus->BatteryFlag |= BATTERY_FLAG_CRITICAL;
+
         if (PowerStatus->BatteryLifePercent <= 32)
             PowerStatus->BatteryFlag |= BATTERY_FLAG_LOW;