Error running on Linux/Wine

Report any bugs or errors you find here.
Post Reply
clewis.it
0posts
Posts: 9
Joined: 06 May 2022
Callsign: KN6KFR

Error running on Linux/Wine

Post by clewis.it »

Hi. I have this program running on Linux using WINE. The only problem I can find so far is with the com port. When I select read or write, it comes up with an unhandled exception error. I do already have the com ports defined and have used them with the original code plug software (also on WINE).

Does anyone have any ideas how I can resolve this issue?

Here is a screenshot of the error:
Screenshot_20231120_144754.png
Here is the text that appears when I click the Details button:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Management.ManagementException: Error code: 0x80041001
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectSearcher.Get()
at CPEditor.COMPortForm.Form2_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
CPEditor
Assembly Version: 0.3.504.1
Win32 Version: 0.3.0504.1
CodeBase: file:///C:/Program%20Files%20(x86)/CPEditor/CPEditor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Newtonsoft.Json
Assembly Version: 13.0.0.0
Win32 Version: 0.3.0504.1
CodeBase: file:///C:/Program%20Files%20(x86)/CPEditor/CPEditor.exe
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.6.81.0 built by: NETFXREL2
CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
You do not have the required permissions to view the files attached to this post.
barrelman70
Posts: 1
Joined: 07 Jan 2024

Re: Error running on Linux/Wine

Post by barrelman70 »

Ever find a solution for this? I'm having the same issue. Radioddity CPS works under wine but I'm getting the same error trying to use cpeditor
clewis.it
0posts
Posts: 9
Joined: 06 May 2022
Callsign: KN6KFR

Re: Error running on Linux/Wine

Post by clewis.it »

Unfortunately I have no new information on this.
User avatar
MM7DBT
Site Admin
150posts
Posts: 190
Joined: 02 Jun 2021
Location: Scotland
Callsign: MM7DBT

Re: Error running on Linux/Wine

Post by MM7DBT »

Unfortunately I don't have anything to easily run Linux on to test WINE myself..

However it looks like the errors relates to how it's reading the COM Ports, since I want the description of the port as well as the actual COM* number to automatically select the first USB>Serial device (Prolific, FTDI etc).. I am using WMI to achieve this, which may not work in WINE / Linux.

Attached is a test build where I have written a separate method to detect the WINE environment and then use the standard System.IO.
Which if its works, should return the COM ports without any description etc, and will not auto select the USB>Serial devices.

Let me know if it works, or if the same error occurs.. or a different error.
You do not have the required permissions to view the files attached to this post.
-73 de MM7DBT
clewis.it
0posts
Posts: 9
Joined: 06 May 2022
Callsign: KN6KFR

Re: Error running on Linux/Wine

Post by clewis.it »

Thanks for the update. Unfortunately, it doesn't fix the issue, but I do see a specific call to GetCOMPortsWithWMI() now. Here's the new log.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Management.ManagementException: Error code: 0x80041001
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectSearcher.Get()
at CPEditor.COMPortForm.GetCOMPortsWithWMI()
at CPEditor.COMPortForm.PopulateCOMPorts()
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
User avatar
MM7DBT
Site Admin
150posts
Posts: 190
Joined: 02 Jun 2021
Location: Scotland
Callsign: MM7DBT

Re: Error running on Linux/Wine

Post by MM7DBT »

GetCOMPortsWithWMI() should never be called when running on WINE.. Although it's not easy to detect whether it is running natively on Windows or via WINE.

I have updated the detection method. Try the one attached here.
You do not have the required permissions to view the files attached to this post.
-73 de MM7DBT
clewis.it
0posts
Posts: 9
Joined: 06 May 2022
Callsign: KN6KFR

Re: Error running on Linux/Wine

Post by clewis.it »

hmm. Good news and bad news. And maybe worse news.

Good news: This latest program now allows me to select com ports. I have /dev/ttyusb0 connected as com4. Verified that it does put the radio into read mode while establishing the connection.

Bad news: When it gets to reading block 1 of 68, the radio goes back into normal mode and the program waits as long as I have the patience to wait.

Worse news: No errors get logged to the console.


00ec:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdr4_2K": c0000142
0108:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdralw2k": c0000142
0150:err:ole:CoGetContextToken apartment not initialised
The executable is not located in either Program Files or Program Files (x86)
0164:err:winediag:ntlm_check_version ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0164:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
01a0:err:comm:stop_waiting failed to clear waiting state: 0xc0000008
0148:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Foundation.Diagnostics.AsyncCausalityTracer"
Establishing Connection To Radio...
DR300UV: Begin Download...
Reading Block 1 of 68


That's it. I totally understand if you don't want to put anymore work into this, I was just hoping this would work since rt73-utils doesn't support the newest firmware.
Post Reply