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.

 

时间: 2024-12-27 00:38:49

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

USB Device Finder

http://www.velleman.eu/images/tmp/usbfind.c #ifdef __cplusplus extern "C" { #endif #include <windows.h> #include <tchar.h> #include <setupapi.h> #include <initguid.h> #include <stdio.h> // This is the GUID for the U

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 the STM32F4 Discovery board but am having trouble getting windows to recognise it. Using USBlyzer all the descriptor info seems ok but windows will onl

U盘做为系统盘安装系统,出现start booting from usb device和boot failed解决方案

最近在旧机子上安装Centos系统的时候,用大白菜或者是UltraISO制作完U盘的系统盘后,出现了start booting from usb device和boot failed,一直很郁闷,以为是系统的原因.网上说把syslinux那个文件修改或者是替换,这些都不管用.最后发现是制作U启动的时候的格式,与bios启动U盘的格式不相符. BOIS启动USB有几种形式:USB-HDD,USB-FDD,USB-ZIP,USB-CDROM 1. ZIP模式是指把U盘模拟成ZIP驱动器模式,启动后U

Android Studio关于USB device not found的解决办法

Android Studio关于USB device not found的解决办法 我们使用Android Studio进行Android开发时,当我们使用真机进行调试时,很可能会出现USB device not found的问题.网上提出了很多决解办法,很多都是错误的.现给出正确的解决方法: 1. If yon don't have Android SDK installed, please install it first. 2. Open Start menu. Select Androi

【转载】How to Reset USB Device in Linux

USB devices are anywhere nowadays, even many embedded devices replace the traditional serial devices with usb devices. However, I experienced that USB devices hang from time to time. In most cases, a manual unplug and replug will solve the issue. Act

[USB] Windows USB/DVD Download Tool

此工具为微软官方U盘启动盘制作工具 Windows USB/DVD Download Tool 说明:https://www.microsoft.com/en-us/download/windows-usb-dvd-download-tool#installation 下载地址:http://wudt.codeplex.com 1.Choose ISO File 2.Choose media type 3.Insert USB device 4.Creating Bootable USB dev

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

Android Studio关于USB device not found的解决的方法 我们使用Android Studio进行Android开发时.当我们使用真机进行调试时.非常可能会出现USB device not found的问题.网上提出了非常多决解办法.非常多都是错误的.现给出正确的解决方法: 1. If yon don't have Android SDK installed, please install it first. 2. Open Start menu. Select An

UEFI之Device Path

UEFI中通过Device Path来描述设备的路径,一个完整的路径由多个Device Path Nodes组成. 下面通过输入设备的路径作为例子: PNP0A03 – PCI Host BridgePNP0303 – PC Keyboard ControllerConIn: The device path of the default input console. 下图是在系统不接任何外设的情况下:系统中只有一个输入设备:PS2 KB 下图在上图的基础上外接了一个USB的键盘:可以看到,除了一

USB device &amp; USB controller &amp; USB passthrough

近期往 openstack 里倒腾 USB passthrough[1],遂把 USB 知识做较为全面的整理,以供分享. USB device 什么是 USB device, 上图机智的小萌狗就是 USB device,你的鼠标是 USB device, 键盘是 USB device,U 盘更是典型的 USB device.说了这么多例子,还是得用一个专业的名词一语概之,所谓 USB,即是 Universal Serial Bus(通用串行总线),它是用来连接 USB device 和计算机,从