wine-staging/patches/user32-rawinput-hid/0017-hidclass.sys-Assign-rawinput-handles-through-device-.patch

49 lines
1.5 KiB
Diff
Raw Normal View History

From 613004e02a06a93598c45f323fe5b4cd9c989194 Mon Sep 17 00:00:00 2001
From: Arkadiusz Hiler <ahiler@codeweavers.com>
Date: Wed, 10 Feb 2021 13:23:33 +0100
Subject: [PATCH] hidclass.sys: Assign rawinput handles through device
properties.
---
dlls/hidclass.sys/device.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c
index 551816aa4fe..fb571bea314 100644
--- a/dlls/hidclass.sys/device.c
+++ b/dlls/hidclass.sys/device.c
@@ -33,11 +33,14 @@
#include "initguid.h"
#include "devguid.h"
+#include "devpkey.h"
#include "ntddmou.h"
WINE_DEFAULT_DEBUG_CHANNEL(hid);
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
+DEFINE_DEVPROPKEY(DEVPROPKEY_HID_HANDLE, 0xbc62e415, 0xf4fe, 0x405c, 0x8e, 0xda, 0x63, 0x6f, 0xb5, 0x9f, 0x08, 0x98, 2);
+
NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT **device)
{
WCHAR dev_name[255];
@@ -144,6 +147,15 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device)
else
ext->rawinput_handle = alloc_rawinput_handle();
+ status = IoSetDevicePropertyData(device, &DEVPROPKEY_HID_HANDLE, LOCALE_NEUTRAL,
+ PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32,
+ sizeof(ext->rawinput_handle), &ext->rawinput_handle);
+ if (status != STATUS_SUCCESS)
+ {
+ FIXME("failed to set device property %x\n", status);
+ return status;
+ }
+
return STATUS_SUCCESS;
error:
--
2.30.2