Windows operating systems rely on a unique device path to uniquely identify each USB device/interface connected to the SYS Tem. A device path string is used to communicate with a USB device and was passed to the CreateFile () Win32 API function.
USB Device Path Format
In most cases, Windows formats the USB device path as follows:
\?usb#vid_vvvv&pid_pppp#ssss#{gggggggg-gggg-gggg-gggg-gggggggggggg}
Where:
VVVV is the USB vendor ID represented in 4 hexadecimal characters.
PPPP is the USB product ID represented in 4 hexadecimal characters.
ssss is the USB serial string represented in n characters.
GGGGGGGG-GGGG-GGGG-GGGG-GGGGGGGGGGGG is the device interface GUID, which is a used to a link applications to device wit H specific drivers loaded.
The cp210x VCP driver GUID is:
{a2a39220-39f4-4b88-aecb-3d86a35dc748}
The GUIDs are assigned in the driver or driver INF file and are used by the application to filter devices that has loaded th At driver.
Composite USB Device Path Format for Interfaces
For a composite device with multiple interfaces, the device path is interface might look something like:
\?usb#vid_vvvv&pid_pppp&mi_II#aaaaaaaaaaaaaaaa#{ GGGGGGGG-GGGG-GGGG-GGGG-GGGGGGGGGGGG}
Where:
VVVV is the USB vendor ID represented in 4 hexadecimal characters.
PPPP is the USB product ID represented in 4 hexadecimal characters.
II is the USB interface number.
aaaaaaaaaaaaaaaa is a unique, windows-generated string based on things such as the physical USB port address and/ or interface number.
GGGGGGGG-GGGG-GGGG-GGGG-GGGGGGGGGGGG is the device interface GUID, which is a used to a link applications to device wit H specific drivers loaded.
Unique Device Paths
Windows requires that the device path is unique for every USB device and interface. If the USB devices is plugged into the same machine with the same vid/pid/serial string and then the USB Device Path Format Described above won ' t generate a unique string for the both devices. In this case, Windows generates a unique string similar to the format described in the Composite USB Device Path Forma T section. This method is also used if the USB device ISerial index are set to 0, indicating that the device does not has a serial St Ring.
Registry Keys Using Device Path Information
The device path is useful-locating the USB device registry keys, where additional settings and information are stored For the device instance. USB device registry keys is stored in the following location:
[Hklmsystemcurrentcontrolsetenumusbvid_vvvv&pid_ppppssss],
Where:
VVVV is the USB vendor ID.
PPPP is the USB product ID.
ssss is the USB serial string or the unique, windows-generate string.
For example, the cp210x VCP drivers stores the COM port number in the Device Parametersportname registry key as shown in T He figure below.
Finding the device Path Parameters using device Manager
The vendor ID, product ID, and serial string or unique string can be obtained using Device Manager. Open the properties for a USB device and click on the ' Details ' tab. Select the ' device Instance Path ' property from the C Ombo box to display the device instance path which shares the components of the device path used for CreateFile (). The Device Instance Path is formatted slightly differently as shown in the figure below.