Hi Chris,
Thanks for your inputs, yes i also tested the filter scheme and is working with other filesystems as well, by changing the init function. Basic need is that the device few sectors could be encrypted, i need to create a child media which would read the boot sector encrypt on the fly and allow it to mount. But not change anything on the drive and it remains encrypted on other system. Also, i need to control the access of external drives to read only.
Moving ahead i have following queries: 1. As the partition on the drives could be GUID partition scheme, Apple partition map and MBR partition map. I can use PDISK utility to change the "Content Hint" of Apple partition without destroying the drive to load my driver, what utility should i use to change type for other two. The drives volumes and partition already exists. 2. If both parent media drive and child media drive gets mounted if Content Hint of both are same, how i can detach parent. I have tried to use this function ((void) attachMediaObjectToDeviceTree(childMedia)) but the parent media of drive is not detached. Do i need modify this function to detach parent and only child media is attached. As this function comments suggests it does the same for boot volume, so i understand that it should work same for external drives.
bool attachMediaObjectToDeviceTree(IOMedia* media) { // // Attach the given media object to the device tree plane. //
IORegistryEntry* child;
DEBUG_LOG("%s[%p]::%s(%p)\n", getName(), this, __FUNCTION__, media);
if ((child = getParentEntry(gIOServicePlane))) {
IORegistryEntry* parent;
if ((parent = child->getParentEntry(gIODTPlane))) {
const char* location = child->getLocation(gIODTPlane); const char* name = child->getName(gIODTPlane);
if (media->attachToParent(parent, gIODTPlane)) { media->setLocation(location, gIODTPlane); media->setName(name, gIODTPlane);
child->detachFromParent(parent, gIODTPlane);
return true; } } }
return false; }
Thanks, Kumar On Jul 25, 2013, at 4:51 AM, Chris Suter wrote: Hi Kumar,
|