USBSTOR.SYS 生成的标识符

从 Windows 2000 开始,作系统为许多 USB 大容量存储设备提供本机支持。 The Usbstor.inf installation file contains device IDs for those devices that are explicitly supported. If the USB hub driver enumerates one of these devices, the operating system will automatically load the USB storage port driver, Usbstor.sys.

The device IDs for USB mass storage devices in Usbstor.inf take the usual form for USB device IDs composed by using information in the USB device's device descriptor:

USB\VID_v(4)&PID_d(4)&REV_r(4)

Where:

  • v(4) is the 4-digit vendor code that the USB committee assigns to the vendor.

  • d(4) is the 4-digit product code that the vendor assigns to the device.

  • r(4) is the revision code.

In addition to these device IDs, Usbstor.inf contains compatible IDs for class 8 ATAPI CD-ROM and removable media devices that support bulk-only transport:

USB\CLASS_08&SUBCLASS_02&PROT_50

USB\CLASS_08&SUBCLASS_05&PROT_50

USB\CLASS_08&SUBCLASS_06&PROT_50

Where:

  • 类 08h = 大容量存储设备。

  • 子类 02h = SFF-8020i ATAPI CD-ROM 设备。

  • 子类 05h = SFF-8070i ATAPI 可移动媒体。

  • 子类 06h = 泛型 SCSI 媒体。

  • 协议 50h = 仅大容量传输协议。

If the data retrieved from the device's device descriptor matches any of these compatible IDs, the operating system will load Usbstor.sys.

加载后,USB 存储端口驱动程序会为每个设备的逻辑单元创建新的 PDO。 For more information, see the example device stack created by Usbstor.sys illustrated in Device Object Example for a USB Mass Storage Device.

当 PnP 管理器查询新创建的 PDO 的设备标识字符串时,USB 存储端口驱动程序会创建一组从设备的 SCSI 查询数据派生的新设备、硬件和兼容的 ID。 设备 ID 格式如下所示:

USBSTOR\v(8)p(16)r(4)

Where:

  • v(8) is an 8-character vendor identifier.

  • p(16) is a 16-character product identifier.

  • r(4) is a 4-character revision level value.

磁盘驱动器的设备 ID 示例如下所示:

USBSTOR\SEAGATE_ST39102LW_______0004

USB 存储端口驱动程序生成的硬件 ID 如下所示:

USBSTOR\t*v(8)p(16)r(4)

USBSTOR\t*v(8)p(16)

USBSTOR\t*v(8)

USBSTOR\v(8)p(16)r(1)

v(8)p(16)r(1)

USBSTOR\GenericTypeString

GenericTypeString

Where:

  • t* is a SCSI device type code of variable length.

  • v(8) is an 8-character vendor identifier.

  • p(16) is a 16-character product identifier.

  • r(4) is a 4-character revision level value. In these additional identifiers, r(1) represents just the first character of the revision identifier.

下表包含 USB 存储端口驱动程序用于生成标识符字符串的 SCSI 设备类型代码。

SCSI 类型代码 Device type Generic type

DIRECT_ACCESS_DEVICE (0)

磁盘或 SFloppy

GenDisk 或 GenSFloppy

SEQUENTIAL_ACCESS_DEVICE (1)

Sequential

GenSequential

WRITE_ONCE_READ_MULTIPLE_DEVICE (4)

Worm

GenWorm

READ_ONLY_DIRECT_ACCESS_DEVICE (5)

CdRom

GenCdRom

OPTICAL_DEVICE (7)

Optical

GenOptical

MEDIUM_CHANGER (8)

Changer

GenChanger

默认类型(以前未列出的所有值)

Other

UsbstorOther

这些示例显示了 USB 存储端口驱动程序生成的硬件 ID:

USBSTOR\DiskSEAGATE_ST39102LW_______0004

USBSTOR\DiskSEAGATE_ST39102LW_______

USBSTOR\DiskSEAGATE_

USBSTOR\SEAGATE_ST39102LW_______0

SEAGATE_ST39102LW_______0

USBSTOR\GenDisk

GenDisk

USB 存储端口驱动程序生成两个兼容的 ID。

USBSTOR\t*

USBSTOR\RAW

where t* is a SCSI device type code of variable length.

USB 存储端口驱动程序生成的兼容 ID 通过以下示例进行说明:

USBSTOR\Disk

USBSTOR\RAW