Re: Scsi exclusive access weird behavior
Re: Scsi exclusive access weird behavior
- Subject: Re: Scsi exclusive access weird behavior
- From: Phil Jordan <email@hidden>
- Date: Thu, 27 Sep 2012 10:49:17 +0200
Hi Antoine,
On Wed, Sep 26, 2012 at 6:23 PM, Antoine Missout
<email@hidden> 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden