Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Hello,
I am trying to understand better the concept of Multi-function HIDClass driver mentioned in the HW ID section of HIDClass docs:
Unfortunately Google/Gihub are not helping me much with this topic.
Where can I get info / examples? How can I create one and how flexible it is? Where/how I define the multiple functions? I understand how to define multiple TLCs so HiDClass will create each with a different HW ID but for multi-function I have found no info.
My goal is creating a single HID driver that can have two different functions, each possibly with multiple TLCs. Then I can use a single rawPDO to interface/talk with it from user mode (this is a software driver to simulate different HID devices). The alternative would be creating/installing two separate (almost identical) HID drivers, one per HID device type, each with a separate rawPDO interface so user space apps can talk to them. I think this is less clean due to the multiple drivers installation so if multi-function allows me having a single driver it would be significantly cleaner.
Thanks in advance!
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Internals & Software Drivers | 4-8 Dec 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Comments
Are you the same person as "J Bernard" who just asked essentially the same question?
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
Hi Tim,
no, I am not J Bernard, what a coincidence. I assume you refer to the question "Is it possible to use WCID with the composite parent of a multi-interface device ?" I read the answer and still I am a bit clueless about the way I would configure multi-function for software HID devices (my question).
I am guessing that I can use "composite" as a keyword with Google as from your comment looks like composite == multi-function? I also now realized that in the MSFT article it mentions: "z(2) two hex digits 0x00-0xFF Interface number (only used with composite USB devices.)" so I am wondering if what I want to do is even possible or only available if the transport is USB. Right now my driver is simply a lower filter of mshidkmdf.
Thanks.
I was hoping Doron would chime it; he is truly the HID expert.
Yes, I believe they are using the phrase "multi-function" to refer to multiple interfaces. A USB device can have multiple interfaces -- even multiple HID interfaces. Absent an IAD descriptor, each interface is assigned to a driver. Each of those interfaces can have one or more top-level collections. Each top-level collection results in a separate HID device.
So, I don't think they are introducing anything new on this page. I think they're just trying to show you what the HID hardware IDs would be for the various combinations of one/many interfaces and one/many top-level collections.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
Correct, HID multifunction devices can be made both as generic USB multifunction (interfaces) and as multiple TLCs on the same function/interface.
I did both variants in firmware some time ago, the latter with three TLCs: keyboard, mouse and function keys. Worked well with Win 10.
But there may be complications, as IIRC Windows may cache USB descriptors (including the HID report descriptors). This may interfere with your "simulation".
So, agree with Mr. Roberts - Doron's opinion would be very useful.
Well, sort of. For a multi-interface device, usbccgp will create multiple PDOs, so there will be multiple instances of the HID class driver. Each instance handles one interface. It will create a PDO for each top-level collection.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.