Usbser.sys CDC Virtual COM Port

Posted: 04-11-2006, 09:54 AM
Hello!

I have an interesting question regarding the use of the usbser.sys built in
windows driver... I have implemented a USB CDC driver in some hardware that
I am developing hoping not to have to change Win32 applications that
currently talk to the device using an RS-232 COM Port.

I have generated a .inf file for windows XP and it installs the usbser.sys
driver correctly and it works! The Win32 apps can happily send and receive
data over USB from the device as if it was connected to an RS-232 COM port.

My problem is that the device will not remain in the device manager when
disconnected. It is of course very reasonable that when you unplug a USB
device it is removed from the device manager, however, RS-232 ports are
always available! This causes problems in the Win32 apps that are using the
port as they have to be re-started (or they at least have to re-connect to
the port) each time the device is reconnected to the PC. I wouldn't be
surprised if there is no solution to this but I was wondering if anyone had
any ideas of how to get round it? Of course, I am hoping not to have to
change the implementation of the Win32 apps as that was the whole point of
implementing USB as a virtual COM port.

Any suggestions would be most welcome!

Cheers,
Greg
Reply With Quote

Responses to "Usbser.sys CDC Virtual COM Port"

Doron Holan [MS]
Guest
Posts: n/a
 
Re: Usbser.sys CDC Virtual COM Port
Posted: 04-12-2006, 04:48 AM
there is no way to change this. COM1 and COM2 can also disappear by removal
(esp on a laptop b/c they are in a hw dock) or by disalbing them in device
manager.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Greg Inman" <NoSpamFakeEmail@nowhere.com> wrote in message
news:92298c67d1ab4f58b6ec506666966818@ureader.com. ..
> Hello!
>
> I have an interesting question regarding the use of the usbser.sys built
> in
> windows driver... I have implemented a USB CDC driver in some hardware
> that
> I am developing hoping not to have to change Win32 applications that
> currently talk to the device using an RS-232 COM Port.
>
> I have generated a .inf file for windows XP and it installs the usbser.sys
> driver correctly and it works! The Win32 apps can happily send and receive
> data over USB from the device as if it was connected to an RS-232 COM
> port.
>
> My problem is that the device will not remain in the device manager when
> disconnected. It is of course very reasonable that when you unplug a USB
> device it is removed from the device manager, however, RS-232 ports are
> always available! This causes problems in the Win32 apps that are using
> the
> port as they have to be re-started (or they at least have to re-connect to
> the port) each time the device is reconnected to the PC. I wouldn't be
> surprised if there is no solution to this but I was wondering if anyone
> had
> any ideas of how to get round it? Of course, I am hoping not to have to
> change the implementation of the Win32 apps as that was the whole point of
> implementing USB as a virtual COM port.
>
> Any suggestions would be most welcome!
>
> Cheers,
> Greg

Reply With Quote
Greg Inman
Guest
Posts: n/a
 
Re: Usbser.sys CDC Virtual COM Port
Posted: 04-12-2006, 08:04 AM
Thanks for the response Doron... I suspected as much.

I guess I'll just have to implement USB properly!

Greg.
Reply With Quote
Greg Inman
Guest
Posts: n/a
 
Re: Usbser.sys CDC Virtual COM Port
Posted: 04-12-2006, 01:17 PM
Just to follow this up...

We have here a third party USB->8-port expander device, ie. provides 8
RS-232 COM ports on a single USB connection to the pc. This manages the
problem of dissapearing virtual COM ports very effectively.

I can connect a Win32 App to one of the virtual COM ports, see it work,
completely unplug the expander device from the USB (not just at the COM port)
and see that the app can no longer communicate with the device. After
plugging the USB device back in to the PC the software app is able to
communicate with the device as before without any need to re-start or
re-create the COM port in windows.

When disconnected the virtual com ports do disapear from device manager,
however. So it must be that the windows logical side of that device is able
to re-attach to the COM port when it comes back after being re-connected.

The device is of course using it's own custom driver not the usbser.sys but
I just thought it might be of interest that it appears perfectly possible to
maintain the virtual COM port in windows even though the device has been
removed from the USB bus.

Greg.
Reply With Quote
Vijay Malhotra
Guest
Posts: n/a
 
Re: Usbser.sys CDC Virtual COM Port
Posted: 11-04-2008, 07:04 AM

Hi Greg,

It has been a while since you posted last here.. But I still hope t
see your reply!

We are also developing virtual COM port driver. (For the purpose : W
have a legacy application that outputs only to COM port and a us
hardware device). We are using usbser.sys as virtual COM port driver. W
are able to install the driver successfully.

But when we use Serial COM APIs like CreateFile etc., they fail wit
GetLastError reporting 2(system can not find specified path). Also if
see device manager -> Ports (COM & LPT) section, the virtual COM drive
is listed with an exclaimation mark with below error,-

"Windows cannot load the device driver for this hardware. The drive
may be corrupted or missing. (Code 39)"

Do you have any inputs here ? Thanks in advance!

Vija

--
Vijay Malhotr
-----------------------------------------------------------------------
Vijay Malhotra's Profile: http://forums.techarena.in/members/vijay-malhotra.ht
View this thread: http://forums.techarena.in/windows-d...vers/493811.ht

http://forums.techarena.i

Reply With Quote
GTrek
Guest
Posts: n/a
 
Re: Usbser.sys CDC Virtual COM Port
Posted: 01-18-2009, 12:10 PM

Hi All,

Just a note here that I had this problem. I got around it by scannin
all available com ports a few times a second on a timer until the port
wanted came up and then opened it. Use the code below (VB sorry):-

Sub GetSerialPortNames()
' Show all available COM ports.
For Each sp As String In My.Computer.Ports.SerialPortNames
ListBox1.Items.Add(sp)
Next
End Sub

Regards

Joh

--
GTre
-----------------------------------------------------------------------
GTrek's Profile: http://forums.techarena.in/members/gtrek.ht
View this thread: http://forums.techarena.in/windows-d...vers/493811.ht

http://forums.techarena.i

Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create virtual port serie and map bluetooth device to this port Jérôme MATHIEU Windows XP Device Drivers 0 10-11-2004 10:13 AM
virtual serial/com port charliex Windows XP Device Drivers 0 04-18-2004 02:49 AM
Virtual Plug and Play USB Port Rick Windows XP Device Drivers 0 03-07-2004 02:11 PM
PDA virtual serial port driver pepi Windows XP Device Drivers 0 02-19-2004 10:10 AM
Virtual printer port not available in RDC Checkbox Windows XP Help & Support 0 10-17-2003 04:41 AM