ntdll/cdrom : implement CDROM_Verify to work on Mac Os
cdavis at mymail.mines.edu
Fri Dec 31 14:50:34 CST 2010
On 12/31/10 1:11 PM, Ken Thomases wrote:
> I should add that this patch seem correct to me. It couldn't hurt to get Charles Davis's input, of course.
I agree, for now. He should at least put a comment in to the effect of
"if we got this far, there's already media in the drive."
> MSDN documents that the purpose of IOCTL_*_CHECK_VERIFY is to check if the media has changed. The Linux and FreeBSD implementations basically just check if there's media in the drive. On Mac OS X, the BSD device file just plain doesn't exist unless and until there's media mounted. There's no permanent BSD device file for the drive itself. So, if CDROM_Verify() is called, which requires that the BSD device file is opened and thus is present, that by itself implies that there's media in the drive. Therefore, CDROM_Verify() should just return success.
Makes sense. But the 'right' way to implement this on Mac OS is to ask
DiskArbitration to tell us when the media changes. (In fact, the right
way to implement this elsewhere is to ask udev or hald the same thing.)
Then we can return STATUS_VERIFY_REQUIRED (as documented) when the media
actually has changed. For now, though, Loïc's patch is OK.
AJ wants to eventually move some (all?) of the disk/CD/DVD/storage
IOCTLs into mountmgr anyway, where Wine's fake storage drivers are
hosted. Mountmgr already has infrastructure in place to talk to DA on
Mac OS and to hald on Linux/FreeBSD, so doing this the 'right' way will
be much easier there.
More information about the wine-devel