Re: disktool unmount
Re: disktool unmount
- Subject: Re: disktool unmount
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 17 Dec 2008 16:55:57 +0100
Le 17 déc. 08 à 16:43, Rakesh Singhal a écrit :
I used the following code for unmounting:
funUnmount(char* DrivePath)
{
DADiskRef disk = NULL;
DASessionRef session = NULL;
session = DASessionCreate ( kCFAllocatorDefault );
if(session == NULL)
{
printf("session NULL\n");
return 0;
}
disk = DADiskCreateFromBSDName ( kCFAllocatorDefault, session,
DrivePath);
if(disk == NULL)
{
printf("disk NULL\n");
return 0;
}
printf("disk session %p ref %p\n", session, disk);
// Eject the whole disk with all the volumes
DADiskRef whole;
unsigned flags;
whole = DADiskCopyWholeDisk( disk );
if(whole)
{
DADiskUnmount( whole, kDADiskUnmountOptionWhole,
SafeRemovalCallback, ( void * ) ( flags & (1 << 1) ) );
}
else
{
printf("Failed to get whole disk !\n");
}
}
I tried to use DADiskUnmount() API with disk also instead of whole. I
defined SafeRemovalCallback function also and it was called also but
my pendrive was still mounted.
And you didn't check the status message in the dissenter argument of
your callback ?
Regards
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden