Is there a way to assign a new hardware device to a designated VCom port from
the .inf file?

; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation
; Copyright (C) 2004 Microchip Technology Inc.

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MCHP%
LayoutFile=layout.inf
DriverVer=08/17/2001,5.1.2600.0

[Manufacturer]
%MFGNAME%=DeviceList

[DestinationDirs]
DefaultDestDir=12

[SourceDisksFiles]

[SourceDisksNames]

[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_04D8&PID_000A

;------------------------------------------------------------------------------
; Windows 2000/XP Sections
;------------------------------------------------------------------------------

[DriverInstall.nt]
CopyFiles=DriverCopyFiles
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles]
usbser.sys,,,0x20

[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService

[DriverService]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------

[Strings]
MCHP="Microchip Technology Inc."
MFGNAME="Microchip Technology Inc."
DESCRIPTION="Communications Port"
SERVICE="USB RS-232 Emulation Driver"

Thanks

RE: Assigning Virtual Com Port by Joseph

Joseph
Thu Sep 14 11:47:02 CDT 2006

That wasn't really clear....Is there a way for me to change the inf file
where when the driver is loaded it dosen't automatically go to the next
available com port. I could assign it to say Com port 4?

Re: Assigning Virtual Com Port by chris

chris
Thu Sep 14 14:54:51 CDT 2006

Joseph wrote:

> That wasn't really clear....Is there a way for me to change the inf file
> where when the driver is loaded it dosen't automatically go to the next
> available com port. I could assign it to say Com port 4?

Not with usbser.sys. The modem/ports class installer looks at the
contents of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM
Name Arbiter to decide which is the next available COM port, and writes
it into the "PortName" device parameter.

The device driver then looks this up when it loads and creates the
entry in HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM to map the
COM port back to the PDO.

I suppose if you had your own modem driver, you could choose whatever
COM port you wanted, but then you'd have to play the appropriate games
to fight whatever the class installer did.


Re: Assigning Virtual Com Port by Joseph

Joseph
Thu Sep 14 15:16:01 CDT 2006

I knew it probably wouldn't be as easy as I thought it might be!!
Thanks for the info though!!
Joe

Re: Assigning Virtual Com Port by Chris

Chris
Fri Sep 15 08:58:21 CDT 2006

<chris.aseltine@gmail.com> wrote:
> Not with usbser.sys. The modem/ports class installer looks at the
> contents of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM
> Name Arbiter to decide which is the next available COM port, and writes
> it into the "PortName" device parameter.

But don't look at that registry key yourself. Use the ComDBXxx() family of
functions (they can be found in msports.h).


Chris