Alexandre Julliard : mountmgr: Require at least one of device or mount point to match when looking for an existing volume .

Alexandre Julliard julliard at winehq.org
Wed Dec 21 12:38:07 CST 2011


Module: wine
Branch: master
Commit: e85a5b2ee96c2b03e415a5b6236454fe2363fe1b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e85a5b2ee96c2b03e415a5b6236454fe2363fe1b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 21 10:56:52 2011 +0100

mountmgr: Require at least one of device or mount point to match when looking for an existing volume.

---

 dlls/mountmgr.sys/device.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 2d4116c..c6ba0b9 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -422,6 +422,8 @@ static struct volume *find_matching_volume( const char *udi, const char *device,
 
     LIST_FOR_EACH_ENTRY( volume, &volumes_list, struct volume, entry )
     {
+        int match = 0;
+
         /* when we have a udi we only match drives added manually */
         if (udi && volume->udi) continue;
         /* and when we don't have a udi we only match dynamic drives */
@@ -429,8 +431,17 @@ static struct volume *find_matching_volume( const char *udi, const char *device,
 
         disk_device = volume->device;
         if (disk_device->type != type) continue;
-        if (device && disk_device->unix_device && strcmp( device, disk_device->unix_device )) continue;
-        if (mount_point && disk_device->unix_mount && strcmp( mount_point, disk_device->unix_mount )) continue;
+        if (device && disk_device->unix_device)
+        {
+            if (strcmp( device, disk_device->unix_device )) continue;
+            match++;
+        }
+        if (mount_point && disk_device->unix_mount)
+        {
+            if (strcmp( mount_point, disk_device->unix_mount )) continue;
+            match++;
+        }
+        if (!match) continue;
         TRACE( "found matching volume %s for device %s mount %s type %u\n",
                debugstr_guid(&volume->guid), debugstr_a(device), debugstr_a(mount_point), type );
         return grab_volume( volume );




More information about the wine-cvs mailing list