Creating a virtual HID device

I would like to create a virtual HID device (emulate it using a driver).

It should be visible to customers who implement standard HID discovery:

  • Call HidD_GetHidGuid () - Get the HID device class GUID
  • Call SetupDiGetClassDevs () - Get access to a set of devices that implement the HID interface
  • Call SetupDiEnumDeviceInterfaces () - For each device in the returned device set, get the interface information for all open HID interfaces.
  • Call SetupDiGetDeviceInterfaceDetail () - For each interface received in the previous call, get a detailed information block for this interface. This detailed information includes a string that can be passed to CreateFile () to open the Device descriptor.
  • Call SetupDiDestroyDeviceInfoList () - Free the device information set that was received in SetupDiGetClassDevs ().

The device must also support reading, so CreateFile / ReadFile will return the data I provided from the driver.

I don’t know where to start, because I don’t have much experience. in the kernel dev .: (

+6
source share
3 answers

Some people are lucky with the vmulti project as a base http://code.google.com/p/vmulti/

+6
source

You can write a driver, then use DevCon (Device Console Tool) with the install option.


cmdInstall :

Changing cmdUpdate to install the driver when there is no related hardware. It creates a new instance of the instance with the root enumeration and associates it with the installed hardware identifier specified on the command line (which must match the hardware identifier in INF). This cannot be done on a remote machine or in a Wow64 context.


http://code.msdn.microsoft.com/windowshardware/DevCon-Sample-4e95d71c

http://msdn.microsoft.com/en-us/library/windows/hardware/ff544707%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/windows/hardware/ff544780%28v=vs.85%29.aspx

+1
source

see the vhidmini ddk driver example. This was in version 1830 of the DDK, but not in the latest version. alternatively, the hidfake sample in Oney’s book.

See http://www.microsoft.com/mspress/books/sampchap/6262.aspx

0
source

Source: https://habr.com/ru/post/891540/


All Articles