Aric Stewart : winebus.sys: Add UID to IOHID devices.
Alexandre Julliard
julliard at winehq.org
Thu Mar 21 17:21:19 CDT 2019
Module: wine
Branch: master
Commit: 9491a5e58aaabae7a42f00a642087604eec86434
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9491a5e58aaabae7a42f00a642087604eec86434
Author: Aric Stewart <aric at codeweavers.com>
Date: Wed Mar 20 14:10:05 2019 -0500
winebus.sys: Add UID to IOHID devices.
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winebus.sys/bus_iohid.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c
index 95077ac..41a383d 100644
--- a/dlls/winebus.sys/bus_iohid.c
+++ b/dlls/winebus.sys/bus_iohid.c
@@ -286,7 +286,7 @@ static const platform_vtbl iohid_vtbl =
static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *sender, IOHIDDeviceRef IOHIDDevice)
{
DEVICE_OBJECT *device;
- DWORD vid, pid, version;
+ DWORD vid, pid, version, uid;
CFStringRef str = NULL;
WCHAR serial_string[256];
BOOL is_gamepad = FALSE;
@@ -298,6 +298,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
version = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVersionNumberKey)));
str = IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDSerialNumberKey));
if (str) CFStringToWSTR(str, serial_string, ARRAY_SIZE(serial_string));
+ uid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDLocationIDKey)));
if (IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad) ||
IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick))
@@ -344,7 +345,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
}
}
- device = bus_create_hid_device(iohid_driver_obj, busidW, vid, pid, version, 0, str?serial_string:NULL, is_gamepad, &GUID_DEVCLASS_IOHID, &iohid_vtbl, sizeof(struct platform_private));
+ device = bus_create_hid_device(iohid_driver_obj, busidW, vid, pid, version, uid, str?serial_string:NULL, is_gamepad, &GUID_DEVCLASS_IOHID, &iohid_vtbl, sizeof(struct platform_private));
if (!device)
ERR("Failed to create device\n");
else
More information about the wine-cvs
mailing list