Finding network mounted DVDs
Finding network mounted DVDs
- Subject: Finding network mounted DVDs
- From: P Teeson <email@hidden>
- Date: Wed, 09 Mar 2011 23:27:22 -0500
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 0xx\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 (email@hidden)
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:
This email sent to email@hidden