program fails to enumerate COM ports

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
leniviy
Level 2
Level 2
Posts: 39
Joined: Sat Jun 27, 2009 3:19 pm

program fails to enumerate COM ports

Post by leniviy »

Hi. LG PC Sync can work with ~/.wine/dosdevices/com1 but fails to enumerate com ports. I cannot select port other than COM1 and the combo box that would allow me to do that is blank.

I did:
# ln -s /dev/ttyACM0 ~/.wine/dosdevices/com5
# sudo chmod g+rw,o+rw /dev/ttyACM0

and added to registry:
[HKEY_LOCAL_MACHINE\Hardware\DEVICEMAP\SERIALCOMM]

"COM5"="COM5"


env WINEDEBUG=+reg wine "C:\Program Files\LGGSM\LGPCSync\LGPCSync.exe" &
then open "options" dialog:

Code: Select all

trace:reg:NtOpenKey (0x28,L"System\\CurrentControlSet\\Control\\DeviceClasses",20019,0x32e1a4)
trace:reg:NtOpenKey <- (nil)
trace:reg:NtOpenKey (0x28,L"SYSTEM\\CurrentControlSet\\Services\\Modem\\Enum",20019,0x32e51c)
trace:reg:NtOpenKey <- (nil)
If you create "DeviceClasses" then it scans 2 keys inside:
{4D36E978-E325-11CE-BFC1-08002BE10318}
{86E0D1E0-8089-11D0-9CE4-08003E301F73}
I don't know what to put there

wine-1.1.25
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: program fails to enumerate COM ports

Post by vitamin »

leniviy wrote:If you create "DeviceClasses" then it scans 2 keys inside:
{4D36E978-E325-11CE-BFC1-08002BE10318}
{86E0D1E0-8089-11D0-9CE4-08003E301F73}
I don't know what to put there
These are both GUIDs for comports. They have something like this under them:

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{86e0d1e0-8089-11d0-9ce4-08003e301f73}]

[..\##?#ACPI#PNP0501#1#{86e0d1e0-8089-11d0-9ce4-08003e301f73}]
"DeviceInstance"="ACPI\\PNP0501\\1"

[..\##?#ACPI#PNP0501#1#{86e0d1e0-8089-11d0-9ce4-08003e301f73}\#]
"SymbolicLink"="\\\\?\\ACPI#PNP0501#1#{86e0d1e0-8089-11d0-9ce4-08003e301f73}"

[..\##?#ACPI#PNP0501#1#{86e0d1e0-8089-11d0-9ce4-08003e301f73}\#\Control]
"Linked"=dword:00000001

[..\##?#ACPI#PNP0501#1#{86e0d1e0-8089-11d0-9ce4-08003e301f73}\Control]
"ReferenceCount"=dword:00000001
Same for the other GUID. Dunno if it will help or not. None of these link to the COM? names. So it might try to open the strange device names...
Martin Gregorie

program fails to enumerate COM ports

Post by Martin Gregorie »

On Sat, 2009-07-18 at 10:38 -0500, leniviy wrote:
Hi. LG PC Sync can work with ~/.wine/dosdevices/com1 but fails to
enumerate com ports. I cannot select port other than COM1 and the
combo box that would allow me to do that is blank.
My installation finds all my six installed COM ports (COM1/2 on the
mobo, COM2-6 on a PCI card.

OS: fully patched Fedora 8
WINE: 1.1.9
Prog: EW Windows Uploader
Windows version: Win 98

.wine/dosdevices contains: c: d: e:: f: f:: g: g:: h::

This version of WINE has never been able to see USB-to-serial adapters.

The uploader talks to a specialised gliding flight recorder to download
flight logs, clear memory, set the date, etc.

HTH,
Martin
leniviy
Level 2
Level 2
Posts: 39
Joined: Sat Jun 27, 2009 3:19 pm

Post by leniviy »

Martin, do you have anything here:
HKEY_LOCAL_MACHINE\Hardware\DEVICEMAP\SERIALCOMM
or
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{86e0d1e0-8089-11d0-9ce4-08003e301f73}
?

I guess there are several ways for a program to detect com ports. Some don't work under wine though.
For example, I launched hyperterm from XP and it showed me the ports I manually added to HKEY_LOCAL_MACHINE\Hardware\DEVICEMAP\SERIALCOMM, but it crushes when SERIALCOMM key is empty

I wonder whether LG PC Sync uses some windows API or scans the registry itself. When less busy, will try to recreate all the needed keys.
Martin Gregorie

program fails to enumerate COM ports

Post by Martin Gregorie »

On Sat, 2009-07-18 at 14:13 -0500, leniviy wrote:
Martin, do you have anything here:
HKEY_LOCAL_MACHINE\Hardware\DEVICEMAP\SERIALCOMM
No, nothing.
or
HKEY_LOCAL_MACHINEH\SYSTEM\CurrentControlSet\Control\DeviceClasses\{86e0d1e0-8089-11d0-9ce4-08003e301f73}
?
No, nothing.

This is a vanilla install with no registry changes or winetricks.
Grepping *.reg in the uploader's Wine prefix doesn't find any lines
containing HKEY_LOCAL_MACHINE.

I need to use the

8250.nr_uarts=6

GRUB boot parameter so the kernel can see all six serial ports UART is
the generic name for the serial port chip, so this parameter tells the
kernel to use up to 6 serial ports implemented with Intel 8250
compatible UARTs. This tested by interrupting the boot and editing the
boot parameters and, if it helps, made permanent by editing the "kernel"
line in /boot/grub/grub.conf

I also needed to add

vm.mmap_min_addr = 0

to etc/sysctl.conf to let WINE run in DOS emulation mode, but that may
not be needed by your program.
I guess there are several ways for a program to detect com ports. Some
don't work under wine though.
Scarcely surprising when you discover just how poorly serial ports are
supported by DOS and earlier Windows versions up to Win98 - I know
nothing about the innards of anything more recent than that. The BIOS
doesn't contain anything useful either, so serial port discovery was
pretty much left as a roll-your-own exercise for the authors of programs
that used them.
I wonder whether LG PC Sync uses some windows API or scans the
registry itself. When less busy, will try to recreate all the needed
keys.
I've written DOS programs that used serial comms, but only by buying a
third party serial comms library package, though I suppose I could have
also swiped code from MS-Kermit.

Martin
Locked