I want to get from a Windows COM port name (COM11
) to the serial number of the USB device that provides that COM port (I'm presently working with FTDI adapters, if that matters).
I can use SetupDiGetClassDevs(&GUID_DEVCLASS_PORTS, NULL, NULL, DIGCF_PRESENT)
to enumerate the ports on the system, then I can use SetupDiEnumDeviceInfo
and SetupDiGetDeviceRegistryProperty
to get the vid/pid out of the Hardware ID.
But I can't seem to figure out a way to get hold of the serial number.
The objective is to program the serial adapters with serial numbers that identify their usage for a simulator program we've got (so the user doesn't have to figure out which adapter is which COM port).