In my app I want to find all mounted DVD volumes, including those mounted from 
other Macs on my network.
The reason is that I want the user to be able to choose the one they want.

Here is the code I am using to find them (based on the CDROM sample from Apple):

kern_return_t FindEjectableDVDMedia(io_iterator_t *mediaIterator)
{
    kern_return_t               kernResult; 
    CFMutableDictionaryRef      classesToMatch;
        
    // DVD media are instances of class kIODVDMediaClass
    classesToMatch = IOServiceMatching(kIODVDMediaClass); 
        
    if (classesToMatch == NULL) {
        printf("IOServiceMatching returned a NULL dictionary.\n");
    }
    else {
        CFDictionaryAddValue(classesToMatch, CFSTR(kIOMediaEjectableKey), 
kCFBooleanTrue); 
    }
    
     kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, 
classesToMatch, mediaIterator);    
    if (KERN_SUCCESS != kernResult) {
        printf("IOServiceGetMatchingServices returned 0x%08x\n", kernResult);
    }
    
    return kernResult;
}

However when I do
        nextMedia = IOIteratorNext(mediaIterator);
in my loop for all devices it returns 0 after the first iteration.
So apparently I have not found the network mounted DVD.
But DVDPlayer sees it as a mounted disk and will play the movie.

I mounted the network DVD using the Finder and "Connect to server..."
The server is my wife's Mac running Tiger and sure enough the DVD was mounted.
(But as I said shows up on my desktop with the rectangular disk icon on my Snow 
Leopard 10.6
rather than the circular DVD icon for the DVD on my local machine.)

Your advice is solicited and appreciated.  TIA

Peter_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to