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

Dmitry Timoshkov dtimoshkov на etersoft.ru
Пн Июл 6 13:00:33 MSK 2015


This fixes random crashes on start up with USB stick plugged-in.
---
 dlls/mountmgr.sys/usbhub.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/mountmgr.sys/usbhub.c b/dlls/mountmgr.sys/usbhub.c
index 3abec7d..01f9318 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 DWORD CALLBACK initialize_usbhub( void *arg )
+static void initialize_usbhub( void )
 {
     static const WCHAR usbhub_started_eventW[] = {'_','_','w','i','n','e',
                                                   '_','U','s','b','h','u','b',
@@ -2331,7 +2331,6 @@ static DWORD CALLBACK initialize_usbhub( void *arg )
     CloseHandle( event );
     if (monitor)
         loop_udev( monitor );
-    return 0;
 }
 
 #endif  /* defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB_1) */
@@ -2339,16 +2338,12 @@ static DWORD CALLBACK initialize_usbhub( void *arg )
 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;
 
-    thread = CreateThread( NULL, 0, initialize_usbhub, NULL, 0, NULL );
-    if (!thread) return STATUS_UNSUCCESSFUL;
-    CloseHandle( thread );
+    initialize_usbhub();
 #else
     TRACE( "USB support not compiled in\n" );
 #endif
-- 
2.4.5



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