[PATCH v3 3/4] user32: Use IOCTL_HID_GET_WINE_RAWINPUT_HANDLE to retrieve the raw input handle.

Rémi Bernon rbernon at codeweavers.com
Thu Jun 9 13:32:52 CDT 2022


From: Zebediah Figura <zfigura at codeweavers.com>

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/user32/rawinput.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index 4dc240b58b3..e7ff854e3b5 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -39,14 +39,11 @@
 
 #include "initguid.h"
 #include "ddk/hidclass.h"
-#include "devpkey.h"
 #include "ntddmou.h"
 #include "ntddkbd.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(rawinput);
 
-DEFINE_DEVPROPKEY(DEVPROPKEY_HID_HANDLE, 0xbc62e415, 0xf4fe, 0x405c, 0x8e, 0xda, 0x63, 0x6f, 0xb5, 0x9f, 0x08, 0x98, 2);
-
 struct device
 {
     SP_DEVICE_INTERFACE_DETAIL_DATA_W *detail;
@@ -119,13 +116,6 @@ static struct device *add_device( HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface,
         return FALSE;
     }
 
-    if (!SetupDiGetDevicePropertyW(set, &device_data, &DEVPROPKEY_HID_HANDLE, &type, (BYTE *)&handle, sizeof(handle), NULL, 0) ||
-        type != DEVPROP_TYPE_UINT32)
-    {
-        ERR("Failed to get device handle, error %#lx.\n", GetLastError());
-        return NULL;
-    }
-
     if (!(detail = malloc(size)))
     {
         ERR("Failed to allocate memory.\n");
@@ -146,6 +136,15 @@ static struct device *add_device( HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface,
         return NULL;
     }
 
+    status = NtDeviceIoControlFile( file, NULL, NULL, NULL, &io,
+                                    IOCTL_HID_GET_WINE_RAWINPUT_HANDLE,
+                                    NULL, 0, &handle, sizeof(handle) );
+    if (status)
+    {
+        ERR( "Failed to get raw input handle, status %#lx.\n", status );
+        goto fail;
+    }
+
     memset( &info, 0, sizeof(info) );
     info.cbSize = sizeof(info);
     info.dwType = type;
-- 
2.36.1




More information about the wine-devel mailing list