And queued events generated from initial device enumeration.
Instead of calling bus_create_hid_device.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winebus.sys/bus_udev.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index cca1bf5e168..78e74de842a 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1098,7 +1098,6 @@ static void udev_add_device(struct udev_device *dev) .input = -1, }; struct platform_private *private; - DEVICE_OBJECT *device = NULL; const char *subsystem; const char *devnode; int fd; @@ -1182,9 +1181,10 @@ static void udev_add_device(struct udev_device *dev) EnterCriticalSection(&udev_cs); list_add_tail(&device_list, &private->unix_device.entry); LeaveCriticalSection(&udev_cs); + private->udev_device = udev_device_ref(dev); + private->device_fd = fd;
- device = bus_create_hid_device(&desc, &private->unix_device); - if (!device) HeapFree(GetProcessHeap(), 0, private); + bus_event_queue_device_created(&event_queue, &private->unix_device, &desc); } #ifdef HAS_PROPER_INPUT_HEADER else if (strcmp(subsystem, "input") == 0) @@ -1195,23 +1195,12 @@ static void udev_add_device(struct udev_device *dev) EnterCriticalSection(&udev_cs); list_add_tail(&device_list, &private->unix_device.entry); LeaveCriticalSection(&udev_cs); - - device = bus_create_hid_device(&desc, &private->unix_device); - if (!device) HeapFree(GetProcessHeap(), 0, private); - } -#endif - - if (device) - { private->udev_device = udev_device_ref(dev); private->device_fd = fd; - IoInvalidateDeviceRelations(bus_pdo, BusRelations); - } - else - { - WARN("Ignoring device %s with subsystem %s\n", debugstr_a(devnode), subsystem); - close(fd); + + bus_event_queue_device_created(&event_queue, &private->unix_device, &desc); } +#endif }
static void try_remove_device(struct udev_device *dev)