kernel32: Fix percentage calculation in GetSystemPowerStatus.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2022-04-22 02:12:53 -06:00 committed by Alexandre Julliard
parent ea30b88a99
commit 8a5d8d6cf9
1 changed files with 1 additions and 1 deletions

View File

@ -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;