Loading USB Device Drivers (Windows CE 5.0)
The USB driver module takes the following steps when loading drivers, stopping as soon as it finds a driver that accepts control of the device. The following rules describe the algorithm that the USB driver module uses to search for USB device drivers. In the descriptions, GroupX_ID refers to a key with the specified group set to one of the forms described in USB Host Controller Driver Registry Settings and the remaining groups set to Default.
If multiple drivers are registered within the same group, the one that contains the simplest form is loaded first. For example, a driver specifying a Group1_ID with device class code only, such as Default\DeviceClass\Default, loads before a driver specifying a Group1_ID with device class and subclass code, such as Default\DeviceClass_Subclass\Default. This allows conservation of resources by loading as few drivers as possible. This following steps show the sequence for the procedure:
The USB driver module searches for a subkey with the name Default\Default\Default.
If present, the module loads the driver listed within the Default\Default\Default\DriverName\DLL subkey. A driver registered in this way is loaded for all USB devices that are connected to the system.
The USB driver module searches for a vendor-specific driver.
Vendor-specific drivers are identified by searching for the most general Group1_ID subkey that matches the device descriptor information. The most general subkey is the one that has a matching Group1_ID subkey containing the simplest allowable form and Default for the Group2_ID and Group3_ID subkeys. If a matching subkey is found, the module loads the driver that is listed within the subkey's DriverName\DLL subkey.
The USB driver module searches for a device class-specific driver.
Class-specific drivers are identified by searching for the most general Group2_ID subkey. If a matching subkey is found, the module loads the driver listed within the subkey's DriverName\DLL subkey.
The searches in this procedure might not yield a matching USB device driver to control the device as a whole. In this search path, if there are multiple interfaces in the device, one target and one interface driver might be loaded. The device might have multiple interfaces, but no driver identified in the procedure might match all of the interfaces present on the device. If so, the USB driver module searches for matching drivers for each interface present on the device, searching for the most general Group3_ID subkey. If the USB driver module finds a matching subkey, it loads the driver listed within the subkey's DriverName\DLL subkey.
The USB driver module follows this process to search for matching drivers:
If no appropriate USB device driver is located, the USB driver module prompts a user to enter the name of a DLL containing the correct driver.
The USB driver module loads the driver, and then calls the driver's USBInstallDriver function.
USBInstallDriver should create an appropriate subkey for the driver by calling the LPREGISTER_CLIENT_SETTINGS function so the next time that the USB device is attached, the USB driver module can locate the correct driver without prompting a user.
In some cases the USB driver module specifies the precedence order to a greater level of detail, for example, combining vendor and device-class specifiers. When this is necessary, the GroupX_ID values might be combined to generate other combinations.
The following list shows the precedence, in descending order, for combining GroupX_ID values:
- Group1_ID\Default\Default
- Group1_ID\Group2_ID\Default
- Default\Group2_ID\Default
- Group1_ID\Group2_ID\Group3_ID
- Group1_ID\Default\Group3_ID
- Default\Group2_ID\Group3_ID
- Default\Default\Group3_ID
If multiple drivers are registered at a particular precedence level, the USB driver module loads the one with the most general form.
See Also
Implementing USB Host Controller Drivers | Installing, Attaching, and Detaching USB Drivers | USB Host Controller Driver Reference | USB Host Driver Reference
Send Feedback on this topic to the authors