1

I'm working on creating a virtual HID device in Windows 10. To help me with developing the drivers, I've been analyzing the example provided here: https://github.com/Microsoft/Windows-driver-samples/tree/master/hid/vhidmini2.

One thing that they do has me stumped: in app/testvhid.c, the application sends data to the driver by finding the device interface of the driver, and sending data to that. However, the driver never calls WdfDeviceCreateDeviceInterface, which I had assumed was required to create a device interface. In fact, there appears to be no mention of interfaces at all in the driver code.

My question is: how would one go about accessing an interface for an HID device, when no calls to WdfDeviceCreateDeviceInterface have been made?

bacowan
  • 165
  • 2
  • 12

1 Answers1

0

HID device has VID/PID and Usage and Usage page information as the attributes, which you can see in the sample source code. The way testvhid.c does is that it enumerates all the HID devices in the system and select the device that matches the VID/PID or Usage/UsagePage you want. FYI, user-mode module calls HidD_GetAttributes() to get the information.

Jesse Ahn
  • 69
  • 7