Hello everyone,
I am working on developing a HID driver for a device that consists of an FTDI chip and a touchscreen display. For now, the touchscreen device is recognized as a simple monitor, but I aim to write a USB HID driver to enable touch-point detection, multitouch gestures, etc.
I have reviewed the HID architecture and the associated challenges, particularly the "ownership conflict for the dispatch table" between KMDF and hidclass.sys. My understanding is based on the documentation, and I'd appreciate it if someone could confirm or correct the following:
The HID architecture requires that hidclass.sys own the dispatch table for HID minidrivers. However, KMDF also requires dispatch table ownership for proper handling of PnP, power, and I/O requests. To resolve this conflict, driver development typically involves splitting responsibilities:
Explicitly registering dispatch routines in a WDM style for HID class compliance.
Using KMDF’s EvtIoRead, EvtIoWrite, and other callback functions for general I/O operations.
Implementing HID-specific IRPs such as IOCTL_HID_GET_DESCRIPTOR, IOCTL_HID_READ_REPORT, IOCTL_HID_WRITE_REPORT, etc., since KMDF does not natively support these.
Given this, I have the following questions:
Is it absolutely necessary to write two levels of drivers—one in WDM and another in KMDF—for a HID touchscreen device?
Would it be feasible to combine WDM-style dispatch routines and KMDF callbacks into a single "hybrid" driver that conforms to both KMDF and WDM requirements?
My understanding is that KMDF allows writing WDM-style code within it, so I am considering merging the two approaches into one driver to avoid having two separate drivers.
Currently, I plan to take the HIDFX2 sample as a base and start developing the driver. I would be grateful for any expert advice, suggestions, or feedback on this approach, especially since this is my first attempt at writing a HID driver. I do have prior experience working with a USBFX2 board, albeit quite some time ago.
Thank you in advance for your insights!