hidclass.sys: Only send WM_INPUT messages for HID devices.

And not for the internal WINEXINPUT devices.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-09-22 12:27:26 +02:00 committed by Alexandre Julliard
parent 9d5e9b5f42
commit 09895076c6
1 changed files with 20 additions and 17 deletions

View File

@ -190,27 +190,30 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack
KIRQL irql;
IRP *irp;
size = offsetof( RAWINPUT, data.hid.bRawData[packet->reportBufferLen] );
if (!(rawinput = malloc( size ))) ERR( "Failed to allocate rawinput data!\n" );
else
if (IsEqualGUID( ext->class_guid, &GUID_DEVINTERFACE_HID ))
{
INPUT input;
size = offsetof( RAWINPUT, data.hid.bRawData[packet->reportBufferLen] );
if (!(rawinput = malloc( size ))) ERR( "Failed to allocate rawinput data!\n" );
else
{
INPUT input;
rawinput->header.dwType = RIM_TYPEHID;
rawinput->header.dwSize = size;
rawinput->header.hDevice = ULongToHandle( ext->u.pdo.rawinput_handle );
rawinput->header.wParam = RIM_INPUT;
rawinput->data.hid.dwCount = 1;
rawinput->data.hid.dwSizeHid = packet->reportBufferLen;
memcpy( rawinput->data.hid.bRawData, packet->reportBuffer, packet->reportBufferLen );
rawinput->header.dwType = RIM_TYPEHID;
rawinput->header.dwSize = size;
rawinput->header.hDevice = ULongToHandle( ext->u.pdo.rawinput_handle );
rawinput->header.wParam = RIM_INPUT;
rawinput->data.hid.dwCount = 1;
rawinput->data.hid.dwSizeHid = packet->reportBufferLen;
memcpy( rawinput->data.hid.bRawData, packet->reportBuffer, packet->reportBufferLen );
input.type = INPUT_HARDWARE;
input.hi.uMsg = WM_INPUT;
input.hi.wParamH = 0;
input.hi.wParamL = 0;
__wine_send_input( 0, &input, rawinput );
input.type = INPUT_HARDWARE;
input.hi.uMsg = WM_INPUT;
input.hi.wParamH = 0;
input.hi.wParamL = 0;
__wine_send_input( 0, &input, rawinput );
free( rawinput );
free( rawinput );
}
}
if (!(last_report = hid_report_create( packet )))