I'm writing a driver stack for Windows (7/8) for a multiport serial card. The card has two ports so the driver stack comprises a bus driver that creates two PDOs, one for each port and then INVALIDATEs bus relations to initiate a PNP sequence resulting in the Port Drivers being loaded. The Port Drivers look for the PortName string in the registry when creating the Symbolic Links to allow application access. I guess the MS CoInstaller is assigning the names. The ports are given the usual COMn numbers, typically COM3 and COM4.
All seems to work well except that I cannot find a way to control which port is given which name - the ports have different Instance IDs (0x40 & 0x41) and different UINumbers (0 and 8). On some (maybe most) installs there's a mapping of 0x40=COM3 and 0x41=COM4 but on other installs the relationship is reversed.
Can anyone suggest what controls the port naming? I do not have my own coinstaller but could easily add a device-specific one if required.
Thanks