Microsoft Windows CE 3.0  

USB Device Driver Load Process

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The USBD 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 USBD module uses to search for USB device drivers. In the descriptions, Group X_IDrefers to a key with the specified group set to one of the forms described in Registry Keys for USB Device Driversand 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_IDwith device class code only, such as Default\ DeviceClass\Default, loads before a driver specifying a Group1_IDwith device class and subclass code, such as Default\ DeviceClass_Subclass\Default. This allows Windows CE to conserve resources by loading as few drivers as possible. This procedure takes the following steps:

  1. The USBD 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\DLLsubkey. A driver registered in this way is loaded for all USB devices that are connected to the system.
  2. The USBD 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 Defaultfor 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\DLLsubkey. For more information on allowable forms, see Registry Keys for USB Device Drivers.
  3. The USBD 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\DLLsubkey.

    The searches in steps 1 through 3 may not yield a matching USB device driver to control the device as a whole; that is, the device may have multiple interfaces, but no driver identified in steps 1 through 3 may match all of the interfaces present on the device. If so, the USBD module takes the following steps to search for matching drivers for each interface present on the device, searching for the most general Group3_IDsubkey. If the USBD module finds a matching subkey, it loads the driver listed within the subkey's DriverName\DLLsubkey.

    Finally, if no appropriate USB device driver is located, the USBD module prompts a user to enter the name of a DLL containing the correct driver. The USBD module then loads the driver and calls the driver's USBInstallDriverfunction. USBInstallDrivershould create an appropriate subkey for the driver by calling the RegisterClientSettingsfunction so the next time that the USB device is attached, the USBD module can locate the correct driver without prompting a user.

    In some cases it may be necessary to specify the precedence order to a greater level of detail; for example, combining vendor- and device-class specifiers. In these cases, the Group X_IDvalues may be combined to generate other combinations. The precedence for such combinations is as follows, in descending order:

    1. Group1_ID\Default\Default
    2. Group1_ID\Group2_ID\Default
    3. Default\Group2_ID\Default
    4. Group1_ID\Group2_ID\Group3_ID
    5. Group1_ID\Default\Group3_ID
    6. Default\Group2_ID\Group3_ID
    7. Default\Default\Group3_ID

      If multiple drivers are registered at a particular precedence level, the USBD module loads the one with the most general form.



       Last updated on Tuesday, July 13, 2004

      © 2004 Microsoft Corporation. All rights reserved.