Zebediah Figura : wineusb.sys: Move the event threads to IRP_MN_START_DEVICE.

Alexandre Julliard julliard at winehq.org
Tue Jul 12 16:44:21 CDT 2022


Module: wine
Branch: master
Commit: 0427ccb141950bd73721d952536dab18730527ff
URL:    https://gitlab.winehq.org/wine/wine/-/commit/0427ccb141950bd73721d952536dab18730527ff

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Tue Jul  5 23:28:38 2022 -0500

wineusb.sys: Move the event threads to IRP_MN_START_DEVICE.

To correspond with the shutdown in IRP_MN_REMOVE_DEVICE.

---

 dlls/wineusb.sys/wineusb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c
index 66fe3778d64..c7363739bcf 100644
--- a/dlls/wineusb.sys/wineusb.c
+++ b/dlls/wineusb.sys/wineusb.c
@@ -487,6 +487,9 @@ static NTSTATUS fdo_pnp(IRP *irp)
         }
 
         case IRP_MN_START_DEVICE:
+            libusb_event_thread = CreateThread(NULL, 0, libusb_event_thread_proc, NULL, 0, NULL);
+            event_thread = CreateThread(NULL, 0, event_thread_proc, NULL, 0, NULL);
+
             if ((ret = libusb_hotplug_register_callback(NULL,
                     LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT,
                     LIBUSB_HOTPLUG_ENUMERATE, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY,
@@ -1154,9 +1157,6 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
         return STATUS_UNSUCCESSFUL;
     }
 
-    libusb_event_thread = CreateThread(NULL, 0, libusb_event_thread_proc, NULL, 0, NULL);
-    event_thread = CreateThread(NULL, 0, event_thread_proc, NULL, 0, NULL);
-
     driver->DriverExtension->AddDevice = driver_add_device;
     driver->DriverUnload = driver_unload;
     driver->MajorFunction[IRP_MJ_PNP] = driver_pnp;




More information about the wine-cvs mailing list