From afca8367ea2a77aa476361ec770c6e39267f8236 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 19 Apr 2019 22:30:46 +0200 Subject: [PATCH] [KERNEL32] GetSystemPowerStatus(): Set the BATTERY_FLAG_CRITICAL flag if the battery life gets lower than 5 percent. --- dll/win32/kernel32/client/power.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dll/win32/kernel32/client/power.c b/dll/win32/kernel32/client/power.c index e25d25a4e2e..4a486fe94a5 100644 --- a/dll/win32/kernel32/client/power.c +++ b/dll/win32/kernel32/client/power.c @@ -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;