Alex Henrie : kernel32: Fix percentage calculation in GetSystemPowerStatus.

Alexandre Julliard julliard at winehq.org
Fri Apr 22 14:46:04 CDT 2022


Module: wine
Branch: master
Commit: 8a5d8d6cf9a1c405d8b8ef6ca19a102534b64a4f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8a5d8d6cf9a1c405d8b8ef6ca19a102534b64a4f

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Fri Apr 22 02:12:53 2022 -0600

kernel32: Fix percentage calculation in GetSystemPowerStatus.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/powermgnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/kernel32/powermgnt.c b/dlls/kernel32/powermgnt.c
index ca62019b256..ae83de3c523 100644
--- a/dlls/kernel32/powermgnt.c
+++ b/dlls/kernel32/powermgnt.c
@@ -63,7 +63,7 @@ BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS ps)
 
     if (bs.BatteryPresent)
     {
-        ps->BatteryLifePercent = bs.MaxCapacity ? bs.RemainingCapacity / bs.MaxCapacity : 100;
+        ps->BatteryLifePercent = bs.MaxCapacity ? 100 * bs.RemainingCapacity / bs.MaxCapacity : 100;
         ps->BatteryLifeTime = bs.EstimatedTime;
         if (!bs.Charging && (LONG)bs.Rate < 0)
             ps->BatteryFullLifeTime = 3600 * bs.MaxCapacity / -(LONG)bs.Rate;




More information about the wine-cvs mailing list