[RFC] mountmgr.sys: keep track of local disks when requested in winecfg

Ben Klein shacklein at gmail.com
Tue Apr 14 08:27:23 CDT 2009

I submitted this to wine-patches a while ago and haven't seen it go
in. I'm confident it is correct and proper, but I'd like some feedback
(which I've also asked for before) from more experienced devs.

The problem is that when you set a drive to "Local disk" in winecfg,
the setting isn't remembered/stored and instead it reverts to the
"autodetect" method. I traced the problem to mountmgr.c, where
define_unix_drive (ultimately called when changes are made to the
winecfg "Drives" tab) has no case for the
DRIVE_FIXED/DEVICE_HARDDISK_VOL/"Local disk" option (which is already
in query_unix_drive) and it reverts to DEVICE_UNKNOWN which is handled
as an "autodetect" and no registry entry is stored. The patch below
fixes this, so setting "Local disk" in winecfg creates a registry
entry that sets the drive type to "hd", which is then correctly
reported by query_unix_drive.

There is a bug report for this problem.

diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c
index 00112b9..d2b1515 100644
--- a/dlls/mountmgr.sys/mountmgr.c
+++ b/dlls/mountmgr.sys/mountmgr.c
@@ -264,6 +264,7 @@ static NTSTATUS define_unix_drive( const void
*in_buff, SIZE_T insize )
         case DRIVE_REMOTE:    type = DEVICE_NETWORK; break;
         case DRIVE_CDROM:     type = DEVICE_CDROM; break;
         case DRIVE_RAMDISK:   type = DEVICE_RAMDISK; break;
+        case DRIVE_FIXED:     type = DEVICE_HARDDISK_VOL; break;
         return add_dos_device( letter - 'a', NULL, device, mount_point, type );

More information about the wine-devel mailing list