changeofpace / MouClassInputInjection

MouClassInputInjection implements a kernel interface for injecting mouse input data packets into the input data stream of HID USB mouse devices.
MIT License
290 stars 82 forks source link

Failed to move the mouse. #13

Closed sahalsaad closed 3 years ago

sahalsaad commented 3 years ago

Hi, When I try to use the mouse function, it failed with the below error message:

17:48:15.661  ERR  5988:2436  MouiiCL.exe      Processing IOCTL_INJECT_MOUSE_MOVEMENT_INPUT. 
17:48:15.661  DBG  5988:2436  MouiiCL.exe      Injecting mouse movement input data.  (ProcessId = 0xFB0, IndicatorFlags = 0x000, MovementX = 20, MovementY = 20) 
17:48:15.661  ERR  5988:2436  MouiiCL.exe      Unexpected indicator flags. (movement type) 

The click working fine. Only move does not work. Environment: Windows 10 20H2 running in vmware. Any help will be appreciated!

Thanks!

changeofpace commented 3 years ago

You are trying to inject a relative movement command (MOUSE_MOVE_RELATIVE), but your mouse movement device generates absolute movement command packets. i.e., You are trying to inject weird packets that do not match the behavior of your mouse. I should update the MouInjectInputPacketUnsafe function to allow this mismatch behavior so the user can do what they want without checks.

changeofpace commented 3 years ago

You can inject an input packet without validation using MouInjectInputPacketUnsafe and MiiInjectMouseInputPacketUnsafe. Look at ntddmou.h for information about the fields.