Hi Antoine, On Wed, Sep 26, 2012 at 6:23 PM, Antoine Missout <antoine.missout@metakine.com> wrote:
Assume a DVD in the drive and mounted.
When I get exclusive access via SCSITaskDeviceInterface->ObtainExclusiveAccess after unmounting it, and then later I release it via ReleaseExclusiveAccess, the OS will remount it as expected.
However, if the display is locked while ReleaseExclusiveAccess is called, the DVD will get ejected instead of remounted.
I suspect this behaviour is down to the Disk Arbitration system - it assigns inserted media (or newly unclaimed media) to the currently logged-in user and tries to mount as that user. When the display is locked, that counts as no user being logged in, hence no mount happens.
How can I avoid this ?
I'm not exactly sure - if you have any kind of user space element to your driver, I'd try adding disk arbitration awareness to that and get it to grab the media (DADiskClaim()), or maybe eject approval is more appropriate in your case (DARegisterDiskEjectApprovalCallback()). I guess the question is also what you actually want to happen - mount the media when the user logs back in? Should it be owned by a specific user or should another user get it in the case of user switching? Hope that helps to get you started. phil -- http://philjordan.eu/ - Phil Jordan, software development contractor _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com