Commit 9491a5e5 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

winebus.sys: Add UID to IOHID devices.

parent 15f85201
...@@ -286,7 +286,7 @@ static const platform_vtbl iohid_vtbl = ...@@ -286,7 +286,7 @@ static const platform_vtbl iohid_vtbl =
static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *sender, IOHIDDeviceRef IOHIDDevice) static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *sender, IOHIDDeviceRef IOHIDDevice)
{ {
DEVICE_OBJECT *device; DEVICE_OBJECT *device;
DWORD vid, pid, version; DWORD vid, pid, version, uid;
CFStringRef str = NULL; CFStringRef str = NULL;
WCHAR serial_string[256]; WCHAR serial_string[256];
BOOL is_gamepad = FALSE; BOOL is_gamepad = FALSE;
...@@ -298,6 +298,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void * ...@@ -298,6 +298,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
version = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVersionNumberKey))); version = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVersionNumberKey)));
str = IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDSerialNumberKey)); str = IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDSerialNumberKey));
if (str) CFStringToWSTR(str, serial_string, ARRAY_SIZE(serial_string)); if (str) CFStringToWSTR(str, serial_string, ARRAY_SIZE(serial_string));
uid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDLocationIDKey)));
if (IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad) || if (IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad) ||
IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick)) IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick))
...@@ -344,7 +345,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void * ...@@ -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) if (!device)
ERR("Failed to create device\n"); ERR("Failed to create device\n");
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment