1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winebus.sys: Do not attempt to open keyboard and mouse HID devices on macOS.

Doing so triggers a permissions prompt for input monitoring.

Patch originally by Rémi Bernon.
This commit is contained in:
Tim Clem 2024-02-06 09:40:07 -08:00 committed by Alexandre Julliard
parent 5da459f1f2
commit 3985b7c599

View file

@ -276,6 +276,16 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
};
struct iohid_device *impl;
CFStringRef str;
UINT usage_page, usage;
usage_page = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDPrimaryUsagePageKey)));
usage = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDPrimaryUsageKey)));
if (usage_page == HID_USAGE_PAGE_GENERIC && (usage == HID_USAGE_GENERIC_MOUSE || usage == HID_USAGE_GENERIC_KEYBOARD))
{
TRACE("Ignoring mouse / keyboard device\n");
return;
}
desc.vid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVendorIDKey)));
desc.pid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDProductIDKey)));