mountmgr: Use the media kind to fill in the device type field on Mac OS.

This commit is contained in:
Charles Davis 2011-02-08 15:12:54 -07:00 committed by Alexandre Julliard
parent e57bbaab91
commit 9a1fb63840
4 changed files with 16 additions and 3 deletions

View File

@ -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,11 @@ 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;
break;
case DEVICE_UNKNOWN:
case DEVICE_HARDDISK:
case DEVICE_NETWORK: /* FIXME */
@ -541,6 +547,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;

View File

@ -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",

View File

@ -293,6 +293,7 @@ static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize,
case DEVICE_HARDDISK_VOL: type = DRIVE_FIXED; break;
case DEVICE_FLOPPY: type = DRIVE_REMOVABLE; break;
case DEVICE_CDROM: type = DRIVE_CDROM; break;
case DEVICE_DVD: type = DRIVE_CDROM; break;
case DEVICE_NETWORK: type = DRIVE_REMOTE; break;
case DEVICE_RAMDISK: type = DRIVE_RAMDISK; break;
}

View File

@ -47,6 +47,7 @@ enum device_type
DEVICE_HARDDISK_VOL,
DEVICE_FLOPPY,
DEVICE_CDROM,
DEVICE_DVD,
DEVICE_NETWORK,
DEVICE_RAMDISK
};