Rebase against 788fd4ee44fc9877b01888fdd3cd72b9ac88228e.

This commit is contained in:
Alistair Leslie-Hughes
2021-04-21 11:40:13 +10:00
parent 33d85bda8a
commit 39f66ddd9f
6 changed files with 20 additions and 1133 deletions

View File

@@ -1,4 +1,4 @@
From 4dc9c869816207037ba5031ccd41c0ac98c3f199 Mon Sep 17 00:00:00 2001
From db0ad0a517ca74f0b166d515eb9fdb15d06d695a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 19 Mar 2021 14:16:16 +0100
Subject: [PATCH] hidclass.sys: Use __wine_send_input to send device
@@ -23,8 +23,8 @@ with INPUT_HARDWARE type / WM_INPUT uMsg instead).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
---
dlls/hidclass.sys/Makefile.in | 2 +-
dlls/hidclass.sys/pnp.c | 36 +++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 1 deletion(-)
dlls/hidclass.sys/pnp.c | 38 +++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in
index 4b1e9338eb4..09281c118b4 100644
@@ -39,7 +39,7 @@ index 4b1e9338eb4..09281c118b4 100644
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
index 7b365d267ed..1d82215bbfe 100644
index de6f409a16b..9a1dcee192b 100644
--- a/dlls/hidclass.sys/pnp.c
+++ b/dlls/hidclass.sys/pnp.c
@@ -26,6 +26,7 @@
@@ -59,20 +59,21 @@ index 7b365d267ed..1d82215bbfe 100644
+
static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_pdo)
{
WCHAR device_id[MAX_DEVICE_ID_LEN], instance_id[MAX_DEVICE_ID_LEN], pdo_name[255];
@@ -109,6 +113,8 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
minidriver *minidriver;
HID_DESCRIPTOR descriptor;
BYTE *reportDescriptor;
WCHAR device_id[MAX_DEVICE_ID_LEN], instance_id[MAX_DEVICE_ID_LEN];
@@ -159,6 +163,8 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
WCHAR pdo_name[255];
USAGE page, usage;
NTSTATUS status;
+ RAWINPUT rawinput;
+ INPUT input;
INT i;
if ((status = get_device_id(bus_pdo, BusQueryDeviceID, device_id)))
@@ -242,6 +248,21 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
status = call_minidriver(IOCTL_HID_GET_DEVICE_ATTRIBUTES, fdo, NULL, 0, &attr, sizeof(attr));
@@ -247,6 +253,23 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
sizeof(HID_XFER_PACKET) + pdo_ext->u.pdo.preparsed_data->caps.InputReportByteLength);
HID_StartDeviceThread(child_pdo);
+
+ rawinput.header.dwType = RIM_TYPEHID;
+ rawinput.header.dwSize = offsetof(RAWINPUT, data.hid.bRawData[2]);
+ rawinput.header.hDevice = ULongToHandle(pdo_ext->u.pdo.rawinput_handle);
@@ -88,10 +89,11 @@ index 7b365d267ed..1d82215bbfe 100644
+ input.u.hi.wParamL = (WORD)(rawinput.header.dwSize >> 0);
+ __wine_send_input(0, &input, &rawinput);
+
fdo->Flags &= ~DO_DEVICE_INITIALIZING;
return STATUS_SUCCESS;
+ fdo->Flags &= ~DO_DEVICE_INITIALIZING;
}
@@ -388,6 +409,21 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
static NTSTATUS fdo_pnp(DEVICE_OBJECT *device, IRP *irp)
@@ -409,6 +432,21 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
case IRP_MN_REMOVE_DEVICE:
{
IRP *queued_irp;