[Wine-patches] [eterwine 1/3] Revert "mountmgr: Fix some regressions."

Alexander Morozov amorozov на etersoft.ru
Вт Май 15 20:05:47 MSK 2012


This reverts commit d73744fd1aeff0f2dd37f6d1b6fc007ce84cb643.
---
 dlls/mountmgr.sys/usbhub.c |   23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/dlls/mountmgr.sys/usbhub.c b/dlls/mountmgr.sys/usbhub.c
index ed4951e..533c298 100644
--- a/dlls/mountmgr.sys/usbhub.c
+++ b/dlls/mountmgr.sys/usbhub.c
@@ -263,9 +263,12 @@ static NTSTATUS get_node_conn_info( struct DeviceInstance *inst, void *buff,
                     conn_info->CurrentConfigurationValue = config;
                 libusb_close( husb );
             }
-            conn_info->ConnectionStatus = 1;
-            *outsize = sizeof(*conn_info);
-            status = STATUS_SUCCESS;
+            if (!ret)
+            {
+                conn_info->ConnectionStatus = 1;
+                *outsize = sizeof(*conn_info);
+                status = STATUS_SUCCESS;
+            }
             break;
         }
     }
@@ -292,20 +295,24 @@ static NTSTATUS get_node_conn_info( struct DeviceInstance *inst, void *buff,
         if (++index == conn_info->ConnectionIndex)
         {
             usb_dev_handle *husb;
+            int ret = -1;
 
             memcpy( &conn_info->DeviceDescriptor, &dev->descriptor,
                     sizeof(USB_DEVICE_DESCRIPTOR) );
             husb = usb_open( inst->dev );
             if (husb)
             {
-                usb_control_msg( husb, 1 << 7, USB_REQ_GET_CONFIGURATION,
+                ret = usb_control_msg( husb, 1 << 7, USB_REQ_GET_CONFIGURATION,
                         0, 0, (char *)&conn_info->CurrentConfigurationValue,
                         sizeof(UCHAR), 0 );
                 usb_close( husb );
             }
-            conn_info->ConnectionStatus = 1;
-            *outsize = sizeof(*conn_info);
-            status = STATUS_SUCCESS;
+            if (ret >= 0)
+            {
+                conn_info->ConnectionStatus = 1;
+                *outsize = sizeof(*conn_info);
+                status = STATUS_SUCCESS;
+            }
             break;
         }
     return status;
@@ -1203,7 +1210,7 @@ static NTSTATUS WINAPI usbhub_dispatch_pnp( DEVICE_OBJECT *device, IRP *irp )
                                        'V','i','d','_','%','0','4','x','&',
                                        'P','i','d','_','%','0','4','x',0};
     static const WCHAR root_hub_idW[] = {'U','S','B','\\',
-                                         'R','O','O','T','_','H','U','B','\\',0};
+                                         'R','O','O','T','_','H','U','B',0};
 
     struct PdoExtension *dx;
     IO_STACK_LOCATION *irpsp;
-- 
1.7.9.7



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