Windows Driver Kit: Buses
Enumeration of the Composite Parent Device
When a new USB device is plugged into a Microsoft Windows machine, the USB bus driver creates a physical device object (PDO) for the device and generates a PnP event to report the new PDO. The operating system then queries the bus driver for the hardward IDs associated with the PDO.
For all USB devices, the USB bus driver reports a device ID with the following format: USB\VID_xxxx&PID_yyyy (xxxx and yyyy are taken directly from idVendor and idProduct fields of the device descriptor, respectively). The bus driver also reports a compatible identifier (ID) of USB\COMPOSITE, if the device meets the following requirements:
- The device class field of the device descriptor (bDeviceClass) must contain a value of zero, or the class (bDeviceClass), subclass (bDeviceSubClass), and protocol (bDeviceProtocol) fields of the device descriptor must have the values 0xEF, 0x02 and 0x01 respectively, as explained in USB Interface Association Descriptor.
- The device must have multiple interfaces.
- The device must have a single configuration.
After retrieving the hardware and compatible IDs for the new PDO, the operating system searches the INF files in the inf subdirectory of the Windows installation (and, possibly, a vendor-provided floppy disk). If one of the INF files contains a match for the device ID, Windows loads the driver that is indicated by that INF file and the generic parent driver does not come into play. If no INF file contains the device ID, and the PDO has a compatible ID, Windows searches for the compatible ID. This produces a match in usb.inf and causes the operating system to load the USB Common Class Generic Parent Driver.
If you want the generic parent driver to manage your device, but your device does not have the characteristics necessary to ensure that the system will generate a compatible ID of USB\COMPOSITE, you will have to provide an INF file that loads the generic parent driver. The INF file should contain a needs/includes section that references usb.inf.
If your composite device has multiple configurations, the INF file you provide must specify which configuration the generic parent should use in the registry. The necessary registry keys are described in Selecting the Configuration for a Multiple-Interface (Composite) USB Device.