Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winebus.sys/bus_udev.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index bd70a66f2cd..9aa01b48304 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -92,6 +92,7 @@ static struct udev *udev_context = NULL; static struct udev_monitor *udev_monitor; static int deviceloop_control[2]; static int udev_monitor_fd; +static struct list event_queue = LIST_INIT(event_queue);
static const WCHAR hidraw_busidW[] = {'H','I','D','R','A','W',0}; static const WCHAR lnxev_busidW[] = {'L','N','X','E','V',0}; @@ -1173,16 +1174,10 @@ static void try_add_device(struct udev_device *dev)
static void try_remove_device(struct udev_device *dev) { - DEVICE_OBJECT *device = NULL; - - device = bus_find_hid_device(hidraw_busidW, dev); + bus_event_queue_device_removed(&event_queue, hidraw_busidW, dev); #ifdef HAS_PROPER_INPUT_HEADER - if (device == NULL) device = bus_find_hid_device(lnxev_busidW, dev); + bus_event_queue_device_removed(&event_queue, lnxev_busidW, dev); #endif - if (!device) return; - - bus_unlink_hid_device(device); - IoInvalidateDeviceRelations(bus_pdo, BusRelations); }
static void build_initial_deviceset(void) @@ -1339,6 +1334,7 @@ error:
NTSTATUS udev_bus_wait(void *args) { + struct bus_event *result = args; struct pollfd pfd[2];
pfd[0].fd = udev_monitor_fd; @@ -1350,12 +1346,14 @@ NTSTATUS udev_bus_wait(void *args)
while (1) { + if (bus_event_queue_pop(&event_queue, result)) return STATUS_PENDING; if (poll(pfd, 2, -1) <= 0) continue; if (pfd[1].revents) break; process_monitor_event(udev_monitor); }
TRACE("UDEV main loop exiting\n"); + bus_event_queue_destroy(&event_queue); udev_monitor_unref(udev_monitor); udev_unref(udev_context); udev_context = NULL;