https://git.reactos.org/?p=reactos.git;a=commitdiff;h=afca8367ea2a77aa47636…
commit afca8367ea2a77aa476361ec770c6e39267f8236
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Fri Apr 19 22:30:46 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Fri Apr 19 22:30:46 2019 +0200
[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 e25d25a4e2..4a486fe94a 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;