site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=1vH33u8DJNHDxGbk58znS6oPmD1phKjVItb457UH9i0=; b=JX2oP82iqto0JTXSeTeYV94jDyWaWaP/HbW+N230wV2mHEYJ4YTIDHg+e2sQH77r1v rnV3nRlk10NodiCA4SG0hSDIk5bWVR3GfW+Yn1nWSpzzIHoU7V4rV3TmxBa/psUOPrkl Wywcs6k9zc8j+3q3x6e1pW+2Nihr91bBbBHjE= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=snIovQxzdtjLpYu3z4GP/uRSlEHsNf6THtD1OxZiDoc0epmBocmI3LV+skGH8is8Rc 0TIQ6RGqFx3+PDRmiZ80PAkfLalFL03lB2wQPitmi/JfP7k2wIMbF8D60o5qiKFdcQ5z bYRXlywR+Qo5Z4uZQpHVWaeQ+AhV2IIBAbI70= 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 <devlists@shadowlab.org> 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com