Device Stacks for Generic HIDClass Devices

The following figure shows a generic device stack for a HIDClass device that includes a function or filter driver for HID collections.

Diagram illustrating a generic device stack for an HIDClass device

The following device objects are created for a generic HIDClass device:

  • A system-supplied or vendor-supplied bus or port driver creates a physical device object (PDO) for an input device attached to the bus or port (required).

    System-supplied drivers support USB HID buses and game ports (I/O port 201). Vendors can supply a driver for custom devices.

  • The system-supplied HID class driver creates a functional device object (FDO) for the input device (required).

    The HID class driver communicates with the device through a HID minidriver. If a system-supplied HID minidriver cannot operate the input device, the vendor must supply a minidriver.

  • The HID class driver creates a PDO for each HID collection that the input device supports (required).

    The input device can support more than one collection. For example, a keyboard with an integrated mouse might have a collection for the standard keyboard controls and a different collection for the mouse.

  • A system-supplied or vendor-supplied function or filter driver creates an FDO or a filter DO for a HID collection (device-specific).

    System-supplied HID mapper drivers support USB keyboard, mouse, and joystick devices. Vendor function or filter drivers are not required to support HID collections.

    If a vendor-supplied function driver creates an FDO or filter DO for a HID collection, it should not use the FsContext field of FILE_OBJECT to store file object-specific data. The FsContext field is reserved for the HID class driver. If another driver in the stack needs to store file object-specific context data, it should use the FsContext2 field instead.

    Note   If there are multiple devices attached to the PDO, there is no built-in mechanism to determine which device can use the FsContext2 field.

User-mode components can directly access HID collections by opening the collection's PDO and using the HID support routines.

 

 

Send comments about this topic to Microsoft

Build date: 4/28/2012