Commit 8a5d8d6c authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

kernel32: Fix percentage calculation in GetSystemPowerStatus.

parent ea30b88a
...@@ -63,7 +63,7 @@ BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS ps) ...@@ -63,7 +63,7 @@ BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS ps)
if (bs.BatteryPresent) 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; ps->BatteryLifeTime = bs.EstimatedTime;
if (!bs.Charging && (LONG)bs.Rate < 0) if (!bs.Charging && (LONG)bs.Rate < 0)
ps->BatteryFullLifeTime = 3600 * bs.MaxCapacity / -(LONG)bs.Rate; ps->BatteryFullLifeTime = 3600 * bs.MaxCapacity / -(LONG)bs.Rate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment