https://bugs.winehq.org/show_bug.cgi?id=50728
Bug ID: 50728 Summary: % CPU Utilization monitor/gauge/indicator not functioning in VARA.exe (ham radio software) Product: Wine Version: 6.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: trivial Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: eric.wheez@gmail.com Distribution: ---
Created attachment 69485 --> https://bugs.winehq.org/attachment.cgi?id=69485 Terminal output from running VARA (seeing CPU monitor bug) and then closing it.
When I run a ham radio program, called VARA, through Wine I'm noticing that the program doesn't properly display CPU usage in its "CPU Gauge". It instead just says "%CPU not available". (See this thread for an image: https://groups.io/g/VARA-MODEM/message/1311) I'm assuming it might be an unimplemented function or missing library in Wine, but I don't know how to track down what is missing.
This is with a fresh installation of wine-staging 6.2 and a fresh wineprefix. The bug doesn't occur when VARA is run on a Windows computer. I've attached terminal output of the program running (and then being closed). I'm wondering if this may be similar to bug 26785, though that one was fixed in 2016.
I'm wondering if the bug might be related to one of these warnings: 0024:fixme:advapi:RegisterEventSourceW ((null),L"PDH"): stub 0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0024:fixme:winspool:PerfOpen (null): stub 0024:fixme:winspool:PerfCollect L"Global", 0x31ea48, 0x31ea3c, 0x31ea40: stub 0024:fixme:winspool:PerfClose stub 0024:err:seh:dispatch_exception Fatal EXCEPTION_FLT_INEXACT_RESULT exception (code=c000008f) raised 0024:err:seh:dispatch_exception Fatal EXCEPTION_FLT_INEXACT_RESULT exception (code=c000008f) raised 00e4:fixme:service:QueryServiceConfig2W Level 6 not implemented 00e4:fixme:service:QueryServiceConfig2W Level 6 not implemented 0024:err:ole:TLB_ReadTypeLib Loading of typelib L"msdatsrc.tlb" failed with error 2
I'm very new to debugging though and assume that this will take more than just dropping in dll's and doing winecfg dll overrides (especially if ntdll is at fault here). Does anybody have any insight into Wine's ability to query system resources - or some ideas for commands I could try to track this bug down and report it to the Wine team for possible request for implementation? There's a whole community of hams who would love to have this program 100% operational (even though this is a minor bug).
To reproduce this behavior, you can install VARA with these commands:
#### Configure our wineprefix winetricks -q corefonts dotnet35sp1 vb6run win7 sound=alsa vcrun2015 pdh # run pdh here just for the winecfg dll override
# Install an older pdh.dll (the pdh.dll from "winetricks pdh" is too new for VARA) sudo apt-get install zip -y cd ~/Downloads && mkdir pdhNT40 && cd pdhNT40 wget http://download.microsoft.com/download/winntsrv40/update/5.0.2195.2668/nt4/e... unzip -o nt4pdhdll.exe cp pdh.dll ~/.wine/drive_c/windows/system32
#### Download/extract/install VARA HF (or newer) [https://rosmodem.wordpress.com/] sudo apt-get install p7zip-full -y sudo apt-get install megatools -y
cd ~/Downloads VARALINK=$(curl -s https://rosmodem.wordpress.com/ | grep -oP '(?<=<a href=").*?(?=" target="_blank" rel="noopener noreferrer">VARA HF v)') # Find the mega.nz link from the rosmodem website no matter its version, then store it as a variable megadl ${VARALINK} 7z x VARA*.zip -o"VARAInstaller" -y wine ~/Downloads/VARAInstaller/VARA\ setup*.exe /SILENT
#### Configure VARA # In winecfg, go to the Audio tab to set up your default in/out soundcards wine winecfg
# In VARA, set up your soundcard input and output (go to Settings ... Soundcard) wine ~/.wine/drive_c/VARA/VARA.exe
https://bugs.winehq.org/show_bug.cgi?id=50728
Eric eric.wheez@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Debian
--- Comment #1 from Eric eric.wheez@gmail.com --- I should note that this has been a problem for the past 6 months or so with older versions of wine-staging, wine-devel, and wine-stable as well.
I haven't tried dropping in a native ntdll yet.
https://bugs.winehq.org/show_bug.cgi?id=50728
--- Comment #2 from Eric eric.wheez@gmail.com --- Just wanted to update this thread with easier VARA install instructions:
Download VARA from: https://rosmodem.wordpress.com/ Winetricks packages: winetricks -q vb6run pdh_nt4 win7 sound=alsa Runs (tested) with wine 6.19-devel, 6.22-devel, and many other versions.
Still not sure what's up with the CPU gauge though.
https://bugs.winehq.org/show_bug.cgi?id=50728
Eric eric.wheez@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|6.2 |9.13 Component|-unknown |pdh
--- Comment #3 from Eric eric.wheez@gmail.com --- I believe this might just be an unimplemented "PdhVbAddCounter" function in wine's own pdh.dll. https://source.winehq.org/WineAPI/pdh.html https://github.com/wine-mirror/wine/blob/dcd1eeb256c2258bf7610a32f0c676979dd...
From the terminal's output when running wine with built-in pdh.dll: wine VARA.exe ---snip--- 01b0:fixme:pdh:PdhVbAddCounter 0194B940, "\ (0)\% Processor Time", 0064F974: stub! 01b0:fixme:pdh:PdhVbAddCounter 0194B940, "\ (1)\% Processor Time", 0064F974: stub! ---snip---
Some background: I googled "find cpu load vb6" I found this proposed VB6 code to find CPU %: https://www.vbforums.com/showthread.php?718429-Cpu-Utilization-in-vb6&s=... These lines of the proposed VB6 code caught my eye: - "Set query = WMI.ExecQuery("SELECT * FROM Win32_PerfFormattedData_Counters_ProcessorInformation")" - "Set query1 = WMI.ExecQuery("Select * from Win32_Processor")"
Googling "Win32_PerfFormattedData_Counters_ProcessorInformation" led me to MSDN pages for "Performance Counter Classes" (https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/performance-cou...) -> "WmiPerfClass" -> "Performance Counters Version 6.0" -> "Using Performance Counters" -> "Performance Counter Consumer APIs" -> " Performance Data Helper (PDH) library" (https://learn.microsoft.com/en-us/windows/win32/perfctrs/using-the-pdh-funct...).
Other notes: I'm not sure why using native pdh.dll's doesn't work (modern pdh.dll and NT4 pdh.dll don't seem to help the CPU % calculation). In 2020, only the old PDH dll from NT4 would allow VARA to run. These days in 2024, a native PDH doesn't seem to be required to run VARA.
https://bugs.winehq.org/show_bug.cgi?id=50728
--- Comment #4 from Eric eric.wheez@gmail.com --- quick clarification: In wine in 2024, having no native pdh.dll works for VARA.exe but CPU % doesn't calculate at all. Using `winetricks pdh_nt4` has the same behavior as having no pdh.dll installed at all. Using `winetricks pdh` (from windows6.1-KB976932-X86.exe / Windows 7 SP1) crashes VARA.exe.