What's a Windows USB device path and how are it formatted?

Source: Internet
Author: User

http://community.silabs.com/t5/Interface-Knowledge-Base/Windows-USB-Device-Path/ta-p/114059

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.


 

What's a Windows USB device path and how are it formatted?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.