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.

 

What is a Windows USB device path and how is it formatted?的更多相关文章

  1. 痞子衡嵌入式:可通过USB Device Path来唯一指定i.MXRT设备进行ROM/Flashloader通信

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是通过USB Device Path来唯一指定i.MXRT设备进行ROM/Flashloader通信. i.MXRT系列高性能微控制器从2 ...

  2. How to match between physical usb device and its drive letter?

    struct tagDrives { WCHAR letter; WCHAR volume[ BUFFER_SIZE ]; } g_drives[ ]; // WCHAR GetUSBDrive( ) ...

  3. Install Slax on USB device (Slax U 盘安装)

    Slax is a modern, portable, small and fast Linux operating system with a modular approach and outsta ...

  4. USB Device Finder

    http://www.velleman.eu/images/tmp/usbfind.c #ifdef __cplusplus extern "C" { #endif #includ ...

  5. "The connection for the USB device '###' was unsuccessful. The device is currently in use"

    一.问题描述 1.情景描述 笔者的物理主机系统是“windows7 64位”,想使用“摄像头录像大师”.这个软件在录制视频的过程中,需要调用windows自带的"windows media ...

  6. EDK II之Device Path

    UEFI中通过Device Path来描述设备的路径,一个完整的路径由多个Device Path Nodes组成. 下面通过输入设备的路径作为例子: PNP0A03 – PCI Host Bridge ...

  7. STM32F4 HAL Composite USB Device Example : CDC + MSC

    STM32F4 USB Composite CDC + MSC I'm in the process of building a USB composite CDC + MSC device on t ...

  8. Android Studio关于USB device not found的解决的方法

    Android Studio关于USB device not found的解决的方法 我们使用Android Studio进行Android开发时.当我们使用真机进行调试时.非常可能会出现USB de ...

  9. [USB] Windows USB/DVD Download Tool

    此工具为微软官方U盘启动盘制作工具 Windows USB/DVD Download Tool 说明:https://www.microsoft.com/en-us/download/windows- ...

随机推荐

  1. C函数及指针学习2

    1.break  永久终止循环,continue 结束当前循环 2.switch 每个case标签要有唯一值,(且为常量或常量表达式) 不加break 时执行流会贯穿整个case 标签 3 赋值操作符 ...

  2. c#部分---输入班级人数,输入语文数学英语成绩,打印语文前两名,数学后两名,英语平均分

    1.开始收集输入项 2.用冒泡排序,统计语文成绩,并附带把语数英三门课全排列 3.数学成绩排序,附带把三门课全排序‘ 4.最后算英语的平均分:

  3. leetcode 116 Populating Next Right Pointers in Each Node ----- java

    Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *nex ...

  4. Codeforces Round #126 (Div. 2)

    A. Cinema 假设当前要的位置为\((x, y)\),如果枚举答案的横坐标,那么每次找离\(y\)最近的纵坐标. 如果占用了位置\((x,y)\),需要要更新第\(x\)行的信息,而占用位置\( ...

  5. some knowledge of maven {maven实战}

    maven是跨平台的,不仅是一个构建工具,也是一个可以管理依赖的工具.它最大化的消除了构件的重复,并且提供了中央仓库,能帮我们自动下载构件.------------------------------ ...

  6. java CS结构软件自动升级的实现

    前段时间做了一个工具发布给公司的各部门使用后反馈了不少BUG,每次修改后均需要发邮件通知各用户替换最新版本,很不方便,因此后来就写了一个自动升级的功能,这样每次发布新的版本时只需要将其部署到自动升级服 ...

  7. python--flask使用

    Flask是一个使用 Python 编写的轻量级 Web 应用框架.下面我将使用Flask框架,创建一个简单的html页面示例. 1.项目的目录结构如下所示:exweb\  uniqueenv\  a ...

  8. unity, polygon collider 2D 添加顶点

    正常情况下只要按下了Edit Collider按钮,鼠标停在polygon collider 2D的一条边上,就会出现一个虚拟的新顶点,此时如果按下鼠标,新顶点就创建出来了. 但是我今天遇到一个奇怪的 ...

  9. unity,standalone下自定义分辨率不起作用的解法

    写一个Editor脚本AddMenu.cs:using UnityEditor; using UnityEngine; public class AddMenu : EditorWindow { [M ...

  10. 【转】ASP.NET Cookies简单应用 记住用户名和密码

    不要试图给Password类型的TextBox赋值! 在asp.net中,不要试图给Password类型的TextBox控件赋值! 无论是在设计或是运行时,都不可以的. 猜测的原因是,password ...