Applications can use SetupDi API functions to retrieve the symbolic link names
of all ports whose drivers have reg i s t e red the port using
GUID_DEVINTERFACE_COMPORT. Applications that use the .NET
Framework and other programming tools typically use higher-level functions to
find ports and thus don??™t need to use the GUID directly.
*
4
Windows provides a COM-port database that helps ensure a unique number
for each port. Application programming interface (API) functions provide a
way for applications to claim and release port numbers. (See the pnpports example
in the WDK for example code.) Uninstalling a port from within the Device
Manager releases the port number for use by other port hardware.
To prevent unwanted ???COM-port proliferation,??? include a serial number in a
string descriptor in any USB virtual COM port you design. A device that contains
a serial number retains its COM-port number even if moved to a different
USB port on the system. A device that doesn??™t contain a serial number gets a
new port number on each attachment to a different port on the system. (Two
devices with identical USB descriptors and no serial numbers will get the same
COM-port number if they attach to the same port at different times.) Chapter
16 has more about storing serial numbers in USB devices.
*
Windows uses INF files to match a device setup class to a device.
Pages:
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69