Drivers for HID Devices
The Microsoft class driver for HID devices, HIDCLASS.SYS, provides the overall framework for WDM drivers that manage HID devices on all the Windows platforms. Microsoft also supplies a HIDCLASS minidriver named HIDUSB.SYS to handle USB devices whose device or interface descriptor indicates that they belong to the HID class. Consequently, if your USB device belongs to the HID class, you may not have to write a special-purpose driver at all because the Microsoft class driver and minidriver fully support the USB specifications.
If you re designing a USB device that includes some HID-like functionality, don t forget that you can make it a composite device by defining several interfaces. The generic parent driver will separate the functions of your device so that the system will load the standard Microsoft drivers for the HID function.
Microsoft also provides drivers for standard PS2 keyboards and mice, and for serial-port mice. These drivers, along with HIDCLASS, sit below class filter drivers named KBDCLASS and MOUCLASS, which present a consistent interface to higher-level components.
You might need to write a custom minidriver to replace HIDUSB.SYS if your USB device or interface provides or consumes structured reports but doesn t belong to the HID class. In such a case, your minidriver will furnish a faux HID descriptor to HIDCLASS, and it will also create structured reports matching that descriptor in response to input events.
Even with a true HID-class USB device, you might have to write your own minidriver to support custom functionality. I ve used this approach to build drivers for several specialized devices, including a gaming mouse with lots of buttons and lights and a head-tracking device that delivers sensor values that must be transformed into position reports. In these cases, the devices are nominally HID-class USB devices, but my clients want the devices to deliver different reports from the ones generated by the firmware. It was not practical in these cases to put the custom functionality into firmware.
Finally, if you have a non-USB device (other than a standard keyboard or mouse) that includes HID-like functionality, a custom HIDCLASS minidriver is the only practical way to make that device accessible to DirectX and thence to existing applications.