zoukankan      html  css  js  c++  java
  • What is a Windows USB device path and how is it formatted?

    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 system. A device path string is used to communicate with a USB device and is 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 that is used to link applications to device with specific drivers loaded.


    The CP210x VCP driver GUID is:


    {A2A39220-39F4-4b88-AECB-3D86A35DC748}


    The GUID is assigned in the driver or driver INF file and is used by the application to filter devices that have loaded that driver.


    Composite USB Device Path Format For Interfaces


    For a composite device with multiple interfaces, the device path for each 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 that is used to link applications to device with specific drivers loaded.


    Unique Device Paths


    Windows requires that the device path be unique for every USB device and interface. If two USB devices are plugged into the same machine with the same VID/PID/Serial string, then the USB Device Path Format described above won’t generate a unique string for the two devices. In this case, Windows generates a unique string similar to the format described in the Composite USB Device Path Format section. This method is also used if the USB device iSerial index is set to 0, indicating that the device does not have a serial string.


    Registry Keys Using Device Path Information


    The device path is useful for locating the USB device registry keys, where additional settings and information are stored for the device instance. USB device registry keys are 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 the 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 combo 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.


     

  • 相关阅读:
    Linux中/etc目录下passwd和shadow文件
    Linux基本命令
    Linux目录结构说明与基本操作
    如何用虚拟机VMware Workstation安装CentOs-7
    VPP源码分析及流程图
    VPP环境搭建及配置
    【转】智能指针的交叉引用问题及解决方法
    二叉树的前 中 后 层序遍历
    排序算法
    C和C++的一些区别
  • 原文地址:https://www.cnblogs.com/fdyang/p/4520413.html
Copyright © 2011-2022 走看看