[PATCH] mountmgr: Use the media kind to fill in the device type field on Mac OS.
Charles Davis
cdavis at mymail.mines.edu
Tue Feb 8 16:12:54 CST 2011
---
dlls/mountmgr.sys/device.c | 6 ++++++
dlls/mountmgr.sys/diskarb.c | 10 +++++++---
dlls/mountmgr.sys/mountmgr.h | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 702f3ff..5d322f1 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -219,6 +219,7 @@ static NTSTATUS create_disk_device( enum device_type type, struct disk_device **
format = floppyW;
break;
case DEVICE_CDROM:
+ case DEVICE_DVD:
format = cdromW;
break;
case DEVICE_RAMDISK:
@@ -258,6 +259,10 @@ static NTSTATUS create_disk_device( enum device_type type, struct disk_device **
device->devnum.DeviceNumber = i;
device->devnum.PartitionNumber = ~0u;
break;
+ case DEVICE_DVD:
+ device->devnum.DeviceType = FILE_DEVICE_DVD;
+ device->devnum.DeviceNumber = i;
+ device->devnum.PartitionNumber = ~0u;
case DEVICE_UNKNOWN:
case DEVICE_HARDDISK:
case DEVICE_NETWORK: /* FIXME */
@@ -541,6 +546,7 @@ static int add_drive( const char *device, enum device_type type )
last = 2;
break;
case DEVICE_CDROM:
+ case DEVICE_DVD:
first = 3;
last = 26;
break;
diff --git a/dlls/mountmgr.sys/diskarb.c b/dlls/mountmgr.sys/diskarb.c
index 0c188ff..d3912ca 100644
--- a/dlls/mountmgr.sys/diskarb.c
+++ b/dlls/mountmgr.sys/diskarb.c
@@ -64,11 +64,15 @@ static void appeared_callback( DADiskRef disk, void *context )
else
mount_point[0] = 0;
- if ((ref = CFDictionaryGetValue( dict, CFSTR("DAVolumeKind") )))
+ if ((ref = CFDictionaryGetValue( dict, CFSTR("DAMediaKind") )))
{
- if (!CFStringCompare( ref, CFSTR("cd9660"), 0 ) ||
- !CFStringCompare( ref, CFSTR("udf"), 0 ))
+ if (!CFStringCompare( ref, CFSTR("IOCDMedia"), 0 ))
type = DEVICE_CDROM;
+ if (!CFStringCompare( ref, CFSTR("IODVDMedia"), 0 ) ||
+ !CFStringCompare( ref, CFSTR("IOBDMedia"), 0 ))
+ type = DEVICE_DVD;
+ if (!CFStringCompare( ref, CFSTR("IOMedia"), 0 ))
+ type = DEVICE_HARDDISK;
}
TRACE( "got mount notification for '%s' on '%s' uuid %s\n",
diff --git a/dlls/mountmgr.sys/mountmgr.h b/dlls/mountmgr.sys/mountmgr.h
index 3d57ba1..da1312c 100644
--- a/dlls/mountmgr.sys/mountmgr.h
+++ b/dlls/mountmgr.sys/mountmgr.h
@@ -47,6 +47,7 @@ enum device_type
DEVICE_HARDDISK_VOL,
DEVICE_FLOPPY,
DEVICE_CDROM,
+ DEVICE_DVD,
DEVICE_NETWORK,
DEVICE_RAMDISK
};
--
1.7.4.rc3
More information about the wine-patches
mailing list