[Bug 52831] New: Kernel32::GetSystemPowerStatus Returns Invalid Data if BAT0 is Missing
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(a)winehq.org Reporter: root(a)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.
https://bugs.winehq.org/show_bug.cgi?id=52831 --- Comment #1 from kazwolfe <root(a)kazwolfe.io> --- Created attachment 72225 --> https://bugs.winehq.org/attachment.cgi?id=72225 The source code used to build BatteryMCVE.exe Attaching source code of used MCVE. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52831 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase Summary|Kernel32::GetSystemPowerSta |Kernel32::GetSystemPowerSta |tus Returns Invalid Data if |tus returns invalid data if |BAT0 is Missing |/sys/class/power_supply/BAT | |0 is missing -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52831 Alex Henrie <alexhenrie24(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alexhenrie24(a)gmail.com Fixed by SHA1| |89ec37871f6093d8336f636dc96 | |7d79579607dd3 Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #2 from Alex Henrie <alexhenrie24(a)gmail.com> --- Fixed by https://gitlab.winehq.org/wine/wine/-/commit/89ec37871f6093d8336f636dc967d79... Thank you for the bug report! Your test program was especially useful :-) -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52831 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #3 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 7.11. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52831 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |7.0.x -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52831 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|7.0.x |--- --- Comment #4 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 7.0.x milestone from bug fixes included in 7.0.2. -- 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.
participants (1)
-
WineHQ Bugzilla