Hi Folks,
We are writing a mass storage driver, in which we
want to read some data from one partition and write the same data on another
partition within the single write() routine of
driver.
The code snippet for getting all the IOMedia
objects in a single write() routine
is as follows.
void
MyDriver::write(IOService* provider, UInt64
byteStart, IOMemoryDescriptor* buffer, IOStorageCompletion
completion)
{
OSDictionary* services =
IOService::serviceMatching(kIOMediaClass);
if(!services)
return;
OSIterator*
iterator =
IOService::getMatchingServices(services);
if
(!iterator)
return;
while (1)
{
IOService* service = OSDynamicCast(IOService,
iterator->getNextObject());
if(!service)
{
break;
}
char Name[MAX_NAME];
memset((void*)Name,0,MAX_NAME);
sprintf(Name,"%s",
service->getName());
}
}
In
while loop we are getting all IOMedia objects. But we want only specific IOMedia
object.
Is
there any API at kernel level to match the two IOMedia objects such as IOObjectConformsTo().
Thanks
in advance.
Thanks
& Regards,
Mekhala