Manage COM port names from a Windows driver

I am writing a driver stack for Windows (7/8) for a multiport serial card. The card has two ports, so the driver stack contains a bus driver that creates two PDOs, one for each port, and then the bus INVALIDATEs relationship to initiate a PNP sequence that causes the port drivers to load. The port driver searches for the PortName string in the registry when creating symbolic links to allow access to applications. I assume MS CoInstaller assigns names. Ports have regular COMn numbers, usually COM3 and COM4.

Everything seems to work fine, except that I cannot find a way to control which port is indicated, which name - the ports have different instance identifiers (0x40 and 0x41) and different UINumbers (0 and 8). On some (possibly most) installations there is a mapping 0x40 = COM3 and 0x41 = COM4, ​​and with other installations the relation is the opposite.

Can anyone suggest what controls port names? I do not have my own installer, but if necessary, it can easily add device-specific.

thanks

+4
source share
1 answer

This is not a complete answer, but it answers the question of how Windows chooses a new COM port name:


this, Windows COM-:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter\ComDB

, Windows 7

ComDB"=hex:fc,ff,ff,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00

(fc) , COM1 COM2 COM3 COM8 .

0

Source: https://habr.com/ru/post/1610332/


All Articles