Question

Tony3180 on Thu, 17 Dec 2020 14:44:02


Hello,

I am trying the vritual hid framework

https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/virtual-hid-framework--vhf-

and HIDinjector example https://github.com/hansmbakker/HIDInjector.

I am able to build the driver and get it  installed.

However when I install the driver, I get the following error message from the kernel

DimpHidAddDevice: Failed to open device \\?\HID#HID_DEVICE_SYSTEM_VHF&Col03#2&22422b2e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} (err=32).
DimpHidAddDevice: Failed to open device \\?\HID#HID_DEVICE_SYSTEM_VHF&Col01#2&22422b2e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD (err=5).
DimpHidAddDevice: Failed to open device \\?\HID#HID_DEVICE_SYSTEM_VHF&Col02#2&22422b2e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} (err=5).

I can see from the device manager that the driver device and VHF keyboard and mouse devices.

However, when I run the testing program, there is no keyinput and mouse input.

I confirmed that

status = VhfReadReportSubmit(DeviceContext->VhfHandle, &transferPacket);

in the driver has been called.

The virtual HID devices do not seem to work.

Please help me with the problem.

Thanks!


Replies

Andrew Yang [MSFT] on Thu, 17 Dec 2020 19:23:59


The "DimpHidAddDevice" errors can be ignored. It's from a system component that would attempt to access newly arrived HID devices. It's normal to see its failure with some HID devices like keyboards and mice which are exclusively accessed by other system components.

It might be useful to simplify the test app to send keyboard inputs only and then examine every HID report that HIDINJECTOR_VhfSubmitReadReport sends via VhfReadReportSubmit and the return value of VhfReadReportSubmit to make sure they look right. Also, you may consider adding WPP and enable inflight trace recorder to the driver if setting breakpoints in the kernel debugging every time seems a bit difficult.

For more information regarding WPP tracing and inflight trace recorder, please refer to this page.

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/wpp-software-tracing

BTW, what do you want to do with the virtual keyboard/mouse/touch?