Re: disktool unmount
Re: disktool unmount
- Subject: Re: disktool unmount
- From: "Rakesh Singhal" <email@hidden>
- Date: Wed, 17 Dec 2008 21:51:55 +0530
I do not remember the value of dissenter in callback but I printed all
values. But if is not NULL then what can be the issue and how to
handle. Is there any other way to unmount the drive or can we use API
unmount(const char *dir, int flags)?
On Wed, Dec 17, 2008 at 9:25 PM, Jean-Daniel Dupas
<email@hidden> wrote:
>
> 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