From 85fbfed5eb5316fee02fab725a2a7656b25096b9 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 19 Apr 2021 18:11:23 -0500 Subject: [PATCH] Rebase against 06ab0677587fbbb83ef73efa7ed22bf85dcb6836. --- ...-versions-of-RtlEnterCriticalSection.patch | 10 ++-- patches/patchinstall.sh | 2 +- ...-__wine_send_input-to-send-device-no.patch | 18 +++---- ...ign-rawinput-handles-through-device-.patch | 47 +++++++++---------- staging/upstream-commit | 2 +- 5 files changed, 37 insertions(+), 42 deletions(-) diff --git a/patches/ntdll-CriticalSection/0002-ntdll-Add-inline-versions-of-RtlEnterCriticalSection.patch b/patches/ntdll-CriticalSection/0002-ntdll-Add-inline-versions-of-RtlEnterCriticalSection.patch index f33f3283..8ae7c0c7 100644 --- a/patches/ntdll-CriticalSection/0002-ntdll-Add-inline-versions-of-RtlEnterCriticalSection.patch +++ b/patches/ntdll-CriticalSection/0002-ntdll-Add-inline-versions-of-RtlEnterCriticalSection.patch @@ -1,4 +1,4 @@ -From e1c9210a92b5b3fda4767f3a9ba12eff5427314f Mon Sep 17 00:00:00 2001 +From dd8ab6d50d5a84d8b40fd8541184c4cc462e7bd0 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 5 Aug 2017 03:38:38 +0200 Subject: [PATCH] ntdll: Add inline versions of RtlEnterCriticalSection / @@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Add inline versions of RtlEnterCriticalSection / 1 file changed, 34 insertions(+) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index e50d48dc3cc..13a9123eb06 100644 +index 1e00dcda2ec..631876c9862 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -26,6 +26,7 @@ @@ -57,9 +57,9 @@ index e50d48dc3cc..13a9123eb06 100644 + } +} + - /* load order */ - - #ifdef _WIN64 + struct dllredirect_data + { + ULONG size; -- 2.30.2 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 9883be36..ba06f7d2 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "749f8c25e262cb049289e7c96bb390edcafa1021" + echo "06ab0677587fbbb83ef73efa7ed22bf85dcb6836" } # Show version information diff --git a/patches/user32-rawinput-hid/0005-hidclass.sys-Use-__wine_send_input-to-send-device-no.patch b/patches/user32-rawinput-hid/0005-hidclass.sys-Use-__wine_send_input-to-send-device-no.patch index 98de9fdf..2c7b5802 100644 --- a/patches/user32-rawinput-hid/0005-hidclass.sys-Use-__wine_send_input-to-send-device-no.patch +++ b/patches/user32-rawinput-hid/0005-hidclass.sys-Use-__wine_send_input-to-send-device-no.patch @@ -1,4 +1,4 @@ -From d39f9ed6bba9a603b415c3882e89fd9c8cc4ae10 Mon Sep 17 00:00:00 2001 +From 4dc9c869816207037ba5031ccd41c0ac98c3f199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 19 Mar 2021 14:16:16 +0100 Subject: [PATCH] hidclass.sys: Use __wine_send_input to send device @@ -27,7 +27,7 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in -index 58bb2b5088f..ced4196d24a 100644 +index 4b1e9338eb4..09281c118b4 100644 --- a/dlls/hidclass.sys/Makefile.in +++ b/dlls/hidclass.sys/Makefile.in @@ -1,6 +1,6 @@ @@ -35,11 +35,11 @@ index 58bb2b5088f..ced4196d24a 100644 IMPORTLIB = hidclass -IMPORTS = hal ntoskrnl +IMPORTS = hal ntoskrnl user32 - DELAYIMPORTS = setupapi EXTRADLLFLAGS = -mno-cygwin + diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c -index 6e13596a32c..0fce6685b62 100644 +index 7b365d267ed..1d82215bbfe 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -26,6 +26,7 @@ @@ -50,8 +50,8 @@ index 6e13596a32c..0fce6685b62 100644 #include "wine/debug.h" #include "wine/asm.h" #include "wine/list.h" -@@ -101,6 +102,9 @@ static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCH - return status; +@@ -97,6 +98,9 @@ static UINT32 alloc_rawinput_handle(void) + return InterlockedIncrement(&counter); } +/* make sure bRawData can hold two bytes without requiring additional allocation */ @@ -60,7 +60,7 @@ index 6e13596a32c..0fce6685b62 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]; -@@ -112,6 +116,8 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b +@@ -109,6 +113,8 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b minidriver *minidriver; HID_DESCRIPTOR descriptor; BYTE *reportDescriptor; @@ -69,7 +69,7 @@ index 6e13596a32c..0fce6685b62 100644 INT i; if ((status = get_device_id(bus_pdo, BusQueryDeviceID, device_id))) -@@ -238,6 +244,21 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b +@@ -242,6 +248,21 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b HID_StartDeviceThread(child_pdo); @@ -91,7 +91,7 @@ index 6e13596a32c..0fce6685b62 100644 fdo->Flags &= ~DO_DEVICE_INITIALIZING; return STATUS_SUCCESS; } -@@ -384,6 +405,21 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp) +@@ -388,6 +409,21 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp) case IRP_MN_REMOVE_DEVICE: { IRP *queued_irp; diff --git a/patches/user32-rawinput-hid/0017-hidclass.sys-Assign-rawinput-handles-through-device-.patch b/patches/user32-rawinput-hid/0017-hidclass.sys-Assign-rawinput-handles-through-device-.patch index cc6931d9..e3c11a87 100644 --- a/patches/user32-rawinput-hid/0017-hidclass.sys-Assign-rawinput-handles-through-device-.patch +++ b/patches/user32-rawinput-hid/0017-hidclass.sys-Assign-rawinput-handles-through-device-.patch @@ -1,56 +1,51 @@ -From 5e5233a4389f6e4b89337c502c91ea003cd48c5c Mon Sep 17 00:00:00 2001 +From 0f24bf7b15e0e22fda2106e8573b5422b80eaa04 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Wed, 10 Feb 2021 13:23:33 +0100 Subject: [PATCH] hidclass.sys: Assign rawinput handles through device properties. --- - dlls/hidclass.sys/device.c | 13 +++++++++++++ + dlls/hidclass.sys/pnp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c -index 887d7212c89..fafb7118e99 100644 ---- a/dlls/hidclass.sys/device.c -+++ b/dlls/hidclass.sys/device.c -@@ -32,11 +32,14 @@ +diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c +index 1d82215bbfe..7eaa28a411d 100644 +--- a/dlls/hidclass.sys/pnp.c ++++ b/dlls/hidclass.sys/pnp.c +@@ -25,6 +25,8 @@ + #include "ntddmou.h" #include "ddk/hidtypes.h" #include "ddk/wdm.h" - #include "devguid.h" ++#include "initguid.h" +#include "devpkey.h" - #include "ntddmou.h" - - WINE_DEFAULT_DEBUG_CHANNEL(hid); - WINE_DECLARE_DEBUG_CHANNEL(hid_report); + #include "regstr.h" + #include "winuser.h" + #include "wine/debug.h" +@@ -87,6 +89,8 @@ static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCH + return irp_status.u.Status; + } +DEFINE_DEVPROPKEY(DEVPROPKEY_HID_HANDLE, 0xbc62e415, 0xf4fe, 0x405c, 0x8e, 0xda, 0x63, 0x6f, 0xb5, 0x9f, 0x08, 0x98, 2); + /* user32 reserves 1 & 2 for winemouse and winekeyboard, * keep this in sync with user_private.h */ #define WINE_MOUSE_HANDLE 1 -@@ -55,6 +58,7 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device) - HDEVINFO devinfo; - BASE_DEVICE_EXTENSION *ext; - USAGE usage, page; -+ NTSTATUS status; - - ext = device->DeviceExtension; - page = ext->u.pdo.preparsed_data->caps.UsagePage; -@@ -93,6 +97,15 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device) +@@ -241,6 +245,15 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b else - ext->u.pdo.rawinput_handle = alloc_rawinput_handle(); + pdo_ext->u.pdo.rawinput_handle = alloc_rawinput_handle(); -+ status = IoSetDevicePropertyData(device, &DEVPROPKEY_HID_HANDLE, LOCALE_NEUTRAL, ++ status = IoSetDevicePropertyData(child_pdo, &DEVPROPKEY_HID_HANDLE, LOCALE_NEUTRAL, + PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32, -+ sizeof(ext->u.pdo.rawinput_handle), &ext->u.pdo.rawinput_handle); ++ sizeof(pdo_ext->u.pdo.rawinput_handle), &pdo_ext->u.pdo.rawinput_handle); + if (status != STATUS_SUCCESS) + { + FIXME("failed to set device property %x\n", status); + return status; + } + - return STATUS_SUCCESS; + pdo_ext->u.pdo.poll_interval = DEFAULT_POLL_INTERVAL; - error: + pdo_ext->u.pdo.ring_buffer = RingBuffer_Create( -- 2.30.2 diff --git a/staging/upstream-commit b/staging/upstream-commit index 23166e21..c39fb277 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -749f8c25e262cb049289e7c96bb390edcafa1021 +06ab0677587fbbb83ef73efa7ed22bf85dcb6836