[PATCH] kernel32: Report 'No System Battery' in GetSystemPowerStatus

Derek Lesho dlesho at codeweavers.com
Fri Sep 20 15:11:52 CDT 2019


Nine Chapters naively checks for the low and critical battery flags,
ignoring the possibility that the Battery status is unknown.

Fixes Proton bug #3068

Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
---
 dlls/kernel32/powermgnt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c
index 190dc016c3..cb5bb5237b 100644
--- a/dlls/kernel32/powermgnt.c
+++ b/dlls/kernel32/powermgnt.c
@@ -50,7 +50,8 @@ BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS ps)
     if (ps)
     {
         ps->ACLineStatus        = 255;
-        ps->BatteryFlag         = 255;
+        /* Nine Parchments doesn't handle an unknown battery status correctly. */
+        ps->BatteryFlag         = 128;
         ps->BatteryLifePercent  = 255;
         ps->Reserved1           = 0;
         ps->BatteryLifeTime     = ~0u;
-- 
2.23.0




More information about the wine-devel mailing list