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:
parent
5da459f1f2
commit
3985b7c599
1 changed files with 10 additions and 0 deletions
|
@ -276,6 +276,16 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
|
||||||
};
|
};
|
||||||
struct iohid_device *impl;
|
struct iohid_device *impl;
|
||||||
CFStringRef str;
|
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.vid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVendorIDKey)));
|
||||||
desc.pid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDProductIDKey)));
|
desc.pid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDProductIDKey)));
|
||||||
|
|
Loading…
Add table
Reference in a new issue