HIDDriverKit driver fails to dispatch events

HI,

I have a simple IOUserHIDEventDriver derived class for a regular mouse which *only* logs messages for the incoming HID reports.

The driver successfully loads when the USB transmitter is plugged in and I can receive the HID reports. I can also see that dispatchRelativePointerEvent()(for testing I overrode this method) is being called in response to the HID reports.

But the cursor refuses to move! It's as if the dispatch function fails to push the HID reports back into the subsystem for further processing.

I do have SIP disabled (or else the driver won't be loaded). I tried running the app (which loads the driver) from /Applications, but that doesn't work either. My entitlements all look fine too.

What could be going on?

TIA
Answered by harikvpy in 626583022
Figured out the problem.

It's quite silly actually. All DriverKit drivers have to call RegisterService() from Start(). This was not explicitly called out in HIDDriverKit docs. And I didn't go through the DriverKit docs thoroughly enough before starting off with the HIDDriverKit.

Oh well..
Accepted Answer
Figured out the problem.

It's quite silly actually. All DriverKit drivers have to call RegisterService() from Start(). This was not explicitly called out in HIDDriverKit docs. And I didn't go through the DriverKit docs thoroughly enough before starting off with the HIDDriverKit.

Oh well..

I ran into the same issue. I had copied code from IOUserHIDEventDriver.cpp which doesn't call RegisterService() - even though it says "An IOUserHIDEventDriver object is a fully functional driver..." on the docs page.

Adding the RegisterService call fixed my issue too. Better docs are needed.

HIDDriverKit driver fails to dispatch events
 
 
Q