Serial enumeration question

I’ve created a 16 port PCI based serial adapter, and used mf.sys to enumerate each COM port for me. I rewrote the wdf serial driver to work with my slightly modified UARTS and everything works fine with one exception. When I install the serial drivers they start enumerating from COM3. I can manually change them, but what’s the best way to get the system to enumerate starting with COM1?

On a related note, is there a way I can essentially ‘reset’ the enumeration to start at a given COM #? Sometimes it seems it starts enumerating things off in the weeds or fails to release the COM ports on an uninstall. When this happens I have zombie devices hogging up COMs 3-18, and subsequent installs start enumerating from COM19 or beyond.

I’ve disabled COM1 and COM2 in the BIOS and done a fresh install of XP in the above scenario, so prior to installing my serial driver, there were no COM ports present on the system.

The ports class installer will only hand out com1 or com2 if the assigned hw resources match the traditional isa resources for those 2 numbers. It is basically an app compat thing, users expect that their mobo serial ports will always have the right numbers on them and this guarantees that. The only way you can alter this behavior is not install in the ports device class and install in your own custom device class where you have your own device coinstaller which assigns names using the ComDB APIs with its own policy.

If you want to reset enumeration, you need to clear out the claimed port numbers from the ComDB. It would be pretty easy to write an app that shows the claimed port numbers and then frees a subset of them.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, March 17, 2009 10:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Serial enumeration question

I’ve created a 16 port PCI based serial adapter, and used mf.sys to enumerate each COM port for me. I rewrote the wdf serial driver to work with my slightly modified UARTS and everything works fine with one exception. When I install the serial drivers they start enumerating from COM3. I can manually change them, but what’s the best way to get the system to enumerate starting with COM1?

On a related note, is there a way I can essentially ‘reset’ the enumeration to start at a given COM #? Sometimes it seems it starts enumerating things off in the weeds or fails to release the COM ports on an uninstall. When this happens I have zombie devices hogging up COMs 3-18, and subsequent installs start enumerating from COM19 or beyond.

I’ve disabled COM1 and COM2 in the BIOS and done a fresh install of XP in the above scenario, so prior to installing my serial driver, there were no COM ports present on the system.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

Ah… that sorta makes sense… Stinks for our application though. We’re not pinning out the mainboard serial ports (using a 3rd party ETX on our mainboard) and disabling them in the BIOS so they don’t get detected by the OS.

I haven’t dealt with the ComDB that you’re referring to. I’d like to look into that more for resetting enumeration. Where can I find out more?

Installing to a different device class seems tempting, but seems like assigning the names using the ComDB APIs would be grossly redundant.

I can use the advanced settings in the device manager to rename COM3 to COM1. Is there some registry ninja (or equivalent) I can do to renumber the devices post-installation to essentially make COM(n) = COM(n-2)?

ComDB reference: http://msdn.microsoft.com/en-us/library/ms800803.aspx

The source for the advanced dialog is in the wdk, src\setup\pnpports so you can see what reg keys it plays with to change com port names

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, March 17, 2009 11:00 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Serial enumeration question

Ah… that sorta makes sense… Stinks for our application though. We’re not pinning out the mainboard serial ports (using a 3rd party ETX on our mainboard) and disabling them in the BIOS so they don’t get detected by the OS.

I haven’t dealt with the ComDB that you’re referring to. I’d like to look into that more for resetting enumeration. Where can I find out more?

Installing to a different device class seems tempting, but seems like assigning the names using the ComDB APIs would be grossly redundant.

I can use the advanced settings in the device manager to rename COM3 to COM1. Is there some registry ninja (or equivalent) I can do to renumber the devices post-installation to essentially make COM(n) = COM(n-2)?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

Most excellent… Thanks!

Shane Corbin wrote:

When I install the serial drivers they start enumerating from COM3. I
can manually change them, but what’s the best way to get the system
to enumerate starting with COM1?

Just out of curiosity, why do you care what the COM port values actually are?

Chris,

It’s an embedded application where we have pinned 16 serial ports out to the back of the device, and labeled them as COM1-COM16. They aren’t virtual COMs or anything of that nature. It’s actually a PCI device with 16 individual UARTS.

-Shane

> Ah… that sorta makes sense… Stinks for our application though.

I would rewrite the app to use PnP device interfaces and forget the obsolete COM%d names forever.

This is a couple of screens of code, nothing else.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim S. Shatskih wrote:

> Ah… that sorta makes sense… Stinks for our application though.

I would rewrite the app to use PnP device interfaces and forget
the obsolete COM%d names forever.

Gee, Maxim, rewrite which application? He’s making a serial PCI card, not an application.

If he wants his device to be useful, he has to support the existing COM port contract, not tell each of his customers to rewrite their application…