[Wine-patches] [eterhack] mountmgr.sys: Fix problems after merge.

Alexander Morozov amorozov на etersoft.ru
Вт Окт 6 17:28:48 MSD 2009


----------- следующая часть -----------
From 3d4eb23cb62d5d88b1e9d40f85ff64e799e3e350 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 6 Oct 2009 17:22:40 +0400
Subject: [eterhack] mountmgr.sys: Fix problems after merge.

---
 dlls/mountmgr.sys/device.c |    4 ++--
 dlls/mountmgr.sys/hal.c    |   12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 0348310..5a0f707 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -903,7 +903,7 @@ found:
     }
 
     if (bus == BusTypeUsb && vendor && product && revision && serial)
-        register_usbstor_device( device, vendor, product, revision, serial );
+        register_usbstor_device( drive, vendor, product, revision, serial );
 
     if (udi) notify = drive->drive;
 
@@ -1020,7 +1020,7 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
     {
         DWORD len = min( sizeof(dev->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength );
 
-        memcpy( irp->MdlAddress->StartVa, &dev->devnum, len );
+        memcpy( irp->AssociatedIrp.SystemBuffer, &dev->devnum, len );
         irp->IoStatus.Information = len;
         status = STATUS_SUCCESS;
         break;
diff --git a/dlls/mountmgr.sys/hal.c b/dlls/mountmgr.sys/hal.c
index 86d99f8..e87ee0c 100644
--- a/dlls/mountmgr.sys/hal.c
+++ b/dlls/mountmgr.sys/hal.c
@@ -170,6 +170,7 @@ static void new_device( LibHalContext *ctx, const char *udi )
     char *vendor = NULL;
     char *product = NULL;
     char *revision = NULL;
+    char *current = NULL;
     char *prev = NULL;
     char *serial = NULL;
     char *sysfs_path;
@@ -209,8 +210,10 @@ static void new_device( LibHalContext *ctx, const char *udi )
     product = p_libhal_device_get_property_string( ctx, parent, "info.product", NULL );
     revision = p_libhal_device_get_property_string( ctx, parent, "storage.firmware_version", NULL );
 
+    if (!(current = p_libhal_device_get_property_string( ctx, udi, "info.parent", NULL )))
+        goto done;
     do {
-        prev = p_libhal_device_get_property_string( ctx, parent, "info.parent", NULL );
+        prev = p_libhal_device_get_property_string( ctx, current, "info.parent", NULL );
         if (prev)
         {
             serial = p_libhal_device_get_property_string( ctx, prev, "usb_device.serial", NULL );
@@ -225,10 +228,10 @@ static void new_device( LibHalContext *ctx, const char *udi )
                 p_libhal_free_string( sysfs_path );
             }
         }
-        p_libhal_free_string( parent );
-        parent = prev;
+        p_libhal_free_string( current );
+        current = prev;
         prev = NULL;
-    } while (parent && !serial);
+    } while (current && !serial);
 
     if (p_libhal_device_get_property_bool( ctx, parent, "storage.removable", &error ))
     {
@@ -249,6 +252,7 @@ done:
     if (vendor) p_libhal_free_string( vendor );
     if (product) p_libhal_free_string( product );
     if (revision) p_libhal_free_string( revision );
+    if (current) p_libhal_free_string( current );
     if (serial) p_libhal_free_string( serial );
     p_dbus_error_free( &error );
 }
-- 
1.6.4.2



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