site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com 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; 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. _______________________________________________ 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... 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; And you didn't check the status message in the dissenter argument of your callback ? Regards This email sent to site_archiver@lists.apple.com
participants (1)
-
Jean-Daniel Dupas