[Wine-patches] [eter-2.1] Revert "mountmgr.sys: Initialize usbhub.sys synchronously."

Dmitry Timoshkov dtimoshkov на etersoft.ru
Ср Июл 22 12:25:02 MSK 2015


This reverts commit 89382b4986528b34caa2228e101962829d94e3b7.

loop_udev() runs an infinite loop and must run in a separate thread.
---
 dlls/mountmgr.sys/usbhub.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/mountmgr.sys/usbhub.c b/dlls/mountmgr.sys/usbhub.c
index 01f9318..3abec7d 100644
--- a/dlls/mountmgr.sys/usbhub.c
+++ b/dlls/mountmgr.sys/usbhub.c
@@ -2306,7 +2306,7 @@ static void loop_udev( void *mon )
 
 #endif  /* HAVE_LIBUDEV */
 
-static void initialize_usbhub( void )
+static DWORD CALLBACK initialize_usbhub( void *arg )
 {
     static const WCHAR usbhub_started_eventW[] = {'_','_','w','i','n','e',
                                                   '_','U','s','b','h','u','b',
@@ -2331,6 +2331,7 @@ static void initialize_usbhub( void )
     CloseHandle( event );
     if (monitor)
         loop_udev( monitor );
+    return 0;
 }
 
 #endif  /* defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB_1) */
@@ -2338,12 +2339,16 @@ static void initialize_usbhub( void )
 NTSTATUS WINAPI usbhub_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
 {
 #if defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB_1)
+    HANDLE thread;
+
     usbhub_driver = driver;
     driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = usbhub_ioctl;
     driver->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = usbhub_internal_ioctl;
     driver->MajorFunction[IRP_MJ_PNP] = usbhub_dispatch_pnp;
 
-    initialize_usbhub();
+    thread = CreateThread( NULL, 0, initialize_usbhub, NULL, 0, NULL );
+    if (!thread) return STATUS_UNSUCCESSFUL;
+    CloseHandle( thread );
 #else
     TRACE( "USB support not compiled in\n" );
 #endif
-- 
2.4.5



Подробная информация о списке рассылки Wine-patches