Virtual Com naming

Hi,

I am writing a virtual Com driver for the Win2000.

I wanted to give the com port name based on the serial number of the plugged
device.

I found some posts which will explain how to change the virtual com port
number from application level.

But I want to assign the fixed serial port name from driver level.

Any help is appreciated.

Thanks in advance,

RD

Which name do you mean? The device name, e.g. \Device\MySerial0? Or the
symbolic link name, \DosDevices\COMX ? If it is the symbolic COMX name,
your driver should not decide which name to use, the ports class
coinstaller will assign your device a COMX name and write it as
“PortName” in the device parameters key of the device (see the serial
example on how to retrieve the value). You cannot pick your own name in
the driver because you do not know which COMX names have already been
taken.

Since your device has a serial number, I am assuming it is connected
over USB. A USB device with a serial number will only be installed
once, which means that if you plug in your device into another port, you
will be assigned the same COMX name

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ramya Desai
Sent: Tuesday, April 24, 2007 12:30 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual Com naming

Hi,

I am writing a virtual Com driver for the Win2000.

I wanted to give the com port name based on the serial number of the
plugged device.

I found some posts which will explain how to change the virtual com port
number from application level.

But I want to assign the fixed serial port name from driver level.

Any help is appreciated.

Thanks in advance,

RD

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

It is possible to override the workings of the ComArbiter and change your port name COMx to what you want. It is not completely trivial. It involves.
(1) HKLM\SYSTEM\CurrentControlSet\Control\COM Name Arbiter. This is a bitmap of used COM ports.
(2) DefineDosDevice() to get rid and set you Symbolic Link
(3) HKLM\HARDWARE\SERIALCOM
(4) The PortName in the Device Parameters
(5) And others

I would suggest using the Device Properties for a real UART Com port and change is name and see what changes in the registry. This should get you started. It is involved. Note you will change the name from what the Comarbiter gives you on installation. The other time is done like the Device Properties GUI Control for changing the COM name.

-William Michael Jones “Mike”

“Doron Holan” wrote in message news:xxxxx@ntdev…
Which name do you mean? The device name, e.g. \Device\MySerial0? Or the symbolic link name, \DosDevices\COMX ? If it is the symbolic COMX name, your driver should not decide which name to use, the ports class coinstaller will assign your device a COMX name and write it as “PortName” in the device parameters key of the device (see the serial example on how to retrieve the value). You cannot pick your own name in the driver because you do not know which COMX names have already been taken.

Since your device has a serial number, I am assuming it is connected over USB. A USB device with a serial number will only be installed once, which means that if you plug in your device into another port, you will be assigned the same COMX name

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ramya Desai
Sent: Tuesday, April 24, 2007 12:30 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual Com naming

Hi,

I am writing a virtual Com driver for the Win2000.

I wanted to give the com port name based on the serial number of the plugged device.

I found some posts which will explain how to change the virtual com port number from application level.

But I want to assign the fixed serial port name from driver level.

Any help is appreciated.

Thanks in advance,

RD

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

The pnpports sample in the WDK shows you how the rename is implemented
in user mode (which includes all of these steps below), so you don’t
have to reverse engineer a single thing. If you want to get a new port
number, use the ComDB APIs to release/claim a new port and do not touch
the HKLM\SYSTEM\CurrentControlSet\Control\COM Name Arbiter key directly.

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of William Michael
Jones
Sent: Tuesday, April 24, 2007 10:20 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Virtual Com naming

It is possible to override the workings of the ComArbiter and change
your port name COMx to what you want. It is not completely trivial. It
involves.

(1) HKLM\SYSTEM\CurrentControlSet\Control\COM Name Arbiter. This is a
bitmap of used COM ports.

(2) DefineDosDevice() to get rid and set you Symbolic Link

(3) HKLM\HARDWARE\SERIALCOM

(4) The PortName in the Device Parameters

(5) And others

I would suggest using the Device Properties for a real UART Com port and
change is name and see what changes in the registry. This should get
you started. It is involved. Note you will change the name from what
the Comarbiter gives you on installation. The other time is done like
the Device Properties GUI Control for changing the COM name.

-William Michael Jones “Mike”

“Doron Holan” wrote in message
news:xxxxx@ntdev…

Which name do you mean? The device name, e.g. \Device\MySerial0?
Or the symbolic link name, \DosDevices\COMX ? If it is the symbolic
COMX name, your driver should not decide which name to use, the ports
class coinstaller will assign your device a COMX name and write it as
“PortName” in the device parameters key of the device (see the serial
example on how to retrieve the value). You cannot pick your own name in
the driver because you do not know which COMX names have already been
taken.

Since your device has a serial number, I am assuming it is
connected over USB. A USB device with a serial number will only be
installed once, which means that if you plug in your device into another
port, you will be assigned the same COMX name

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ramya Desai
Sent: Tuesday, April 24, 2007 12:30 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual Com naming

Hi,

I am writing a virtual Com driver for the Win2000.

I wanted to give the com port name based on the serial number of
the plugged device.

I found some posts which will explain how to change the virtual
com port number from application level.

But I want to assign the fixed serial port name from driver
level.

Any help is appreciated.

Thanks in advance,

RD

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer