[Bug 52831] New: Kernel32::GetSystemPowerStatus Returns Invalid Data if BAT0 is Missing

WineHQ Bugzilla wine-bugs at winehq.org
Sun Apr 17 17:44:59 CDT 2022


https://bugs.winehq.org/show_bug.cgi?id=52831

            Bug ID: 52831
           Summary: Kernel32::GetSystemPowerStatus Returns Invalid Data if
                    BAT0 is Missing
           Product: Wine
           Version: 7.6
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: kernel32
          Assignee: wine-bugs at winehq.org
          Reporter: root at kazwolfe.io
      Distribution: ---

Created attachment 72224
  --> https://bugs.winehq.org/attachment.cgi?id=72224
Output from Wine, MCVE binary, and relevant information.

Currently, it appears as though Kernel32's GetSystemPowerStatus behaves
inconsistently on modern systems and will return garbage or invalid
information.

A precursory glance into this problem seems to be rooted in
dlls/ntdll/unix/system.c#L3447 and `fill_battery_state`. This function only
appears to check for the existence of `/sys/class/power_supply/AC` and
`/sys/class/power_supply/BAT0`, which not all systems necessarily have. For
example, my test computer runs on `AC0` and `BAT1`. A Steam Deck (where this
bug originally was noticed) uses `ACAD` and `BAT1`.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list