[PATCH 4/5] mountmgr.sys: Also unlink a:: drive when removing a dos device

GOUJON Alexandre ale.goujon at gmail.com
Wed Aug 31 08:03:50 CDT 2011

On 08/31/2011 01:16 PM, Alexandre Julliard wrote:
> Alexandre Goujon<ale.goujon at gmail.com>  writes:
>> @@ -818,6 +818,7 @@ NTSTATUS remove_dos_device( int letter, const char *udi )
>>           if ((path = get_dosdevices_path(&p )))
>>           {
>>               p[0] = 'a' + drive->drive;
>> +            unlink( path );
> That's not done on purpose, to make it more likely that we use the same
> drive letter next time the device is mounted.
Sorry but your explanation doesn't convince me.

Here is a simple test case:
- open winecfg then the Drives tab
- make sure your fstab contains a mount point for a block device like 
- click Autodetect then apply
- $ls -l .wine/dosdevices/
  you should see something like k: pointing to the mounted point like 
/media/cdrom et k:: pointing to /dev/cdrom with k the right letter
- remove k then apply
  k: has been removed but not k::

What happened : when you click on the apply button, 
apply_drive_changes() is called, then mountmgr_ioctl(), then 
define_unix_drive(), then remove_dos_device() which unlink() k: but not k::

More information about the wine-devel mailing list