From: Tim Clem tclem@codeweavers.com
Volumes with kCFURLVolumeIsBrowsableKey set to false are invisible to users. These are generally system volumes or temporary ones (like Chrome update disk images) that we should ignore. --- dlls/mountmgr.sys/diskarb.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/mountmgr.sys/diskarb.c b/dlls/mountmgr.sys/diskarb.c index 4817cfc61d6..63986c3df93 100644 --- a/dlls/mountmgr.sys/diskarb.c +++ b/dlls/mountmgr.sys/diskarb.c @@ -65,6 +65,7 @@ static void appeared_callback( DADiskRef disk, void *context ) CFDictionaryRef dict = DADiskCopyDescription( disk ); const void *ref; char device[64]; + CFURLRef volume_url; char mount_point[PATH_MAX]; size_t model_len = 0; GUID guid, *guid_ptr = NULL; @@ -87,11 +88,23 @@ static void appeared_callback( DADiskRef disk, void *context ) strcpy( device, "/dev/r" ); CFStringGetCString( ref, device + 6, sizeof(device) - 6, kCFStringEncodingASCII );
- if ((ref = CFDictionaryGetValue( dict, CFSTR("DAVolumePath") ))) - CFURLGetFileSystemRepresentation( ref, true, (UInt8 *)mount_point, sizeof(mount_point) ); + if ((volume_url = CFDictionaryGetValue( dict, CFSTR("DAVolumePath") ))) + CFURLGetFileSystemRepresentation( volume_url, true, (UInt8 *)mount_point, sizeof(mount_point) ); else mount_point[0] = 0;
+ if (volume_url && CFURLCopyResourcePropertyForKey( volume_url, kCFURLVolumeIsBrowsableKey, &ref, NULL )) + { + Boolean is_browsable = CFBooleanGetValue( ref ); + CFRelease( ref ); + + if (!is_browsable) + { + TRACE( "ignoring volume %s, uuid %s: not browsable\n", device, wine_dbgstr_guid(guid_ptr) ); + goto done; + } + } + if ((ref = CFDictionaryGetValue( dict, CFSTR("DAMediaKind") ))) { if (!CFStringCompare( ref, CFSTR("IOCDMedia"), 0 ))