Monday, 12 September 2011


Loading USB and HID drivers depends on Registry keys.
The USB driver tries to find the best fitting driver for an attached device.
Typical Registry keys are

But what exactly is coded with "Default\Default\3"?
You may guess, it is somehow related to the vendor and the type of the device.

The easy part is to google/bing (can Bing be used as a verb?) the USB Class Codes at
In this example "3" stands for the Interface "HID (Human Interface Device)"
and "1_2" stands for HID Mouse,

The Microsoft online help hides the syntax anywhere in the middle of this article:
In my own words it stats:
Group1_ID = Default|DeviceVendorID[_DeviceProductID[_DeviceReleaseNumber]]
Group2_ID = Default|DeviceClassCode[_DeviceSubclassCode[_DeviceProtocolCode]]
Group3_ID = Default|InterfaceClassCode[_InterfaceSubclassCode[_InterfaceProtocolCode]]

The following two pieces of the puzzle are missing:
* The syntax is similar for HID devices.
* All numbers are DECIMAL! This includes VendorIDs and DeviceIDs!

VendorID: 0x045e=1118 Microsoft Corp.
DeviceID: 0x0040=64 Wheel Mouse Optical


Contrary to this example you should write a general-purpose and Vendor-INdependent driver.

Tschüß Holger


garzanti said...

Hi Holger,

I think is somehow logical what it is going to be loaded. All the operating systems, not only Windows, in order to create this illusion of Plug'n'Play rely on the USB descriptor which is provided by the attached device.

First the OS or the host will look at the Vendor ID, Product ID to identify the proper driver, while the serial number is going to be used for uniqueness.

If based on Vendor ID/Product ID couldn't help to identify the proper driver, the next information used will be class id/sub class id. For example, it will tell me that is a HID - human interaction device. But the HIDs are great variety and it is going to be used also interface and protocol which will tell the OS: "I am an audio, keyboard, mouse, etc". So in this second case it will be loaded a generic driver: audio, keyboard, mouse, etc.

There is no exact default, it may be a generic driver or a manufacturer driver from case to case.

I would recomend for further reading Jan Axelson book: - USB Complete Fourth Edition.

Holger Moltrecht said...

Hi Garzanti,
thank you for your great completion.
The issue I tried to explain was more simple:
How to add the correct Registry Settings for a certain device?

Tschüß Holger