Hi Charles,
Are the DKIOCPREVENT and DKIOCALLOW ioctls necessary? DiskArbitration already has a facility for clients to refuse mount/unmount/eject requests.
http://developer.apple.com/mac/library/documentation/Darwin/Reference/DiscAr...
Among other things, if Wine uses your driver to lock the media and then crashes, is there any way for the user to recover and unlock the media? Also, I don't know enough about the driver model to know if multiple user clients can compete or conflict for locking the media. For example, if two processes lock the media and only one unlocks it, is it locked or unlocked? DiskArbitration avoids these pitfalls.
Also, at http://xnu-extras.git.sourceforge.net/git/gitweb.cgi?p=xnu-extras/xnu-extras;a=blob;f=ExtMediaBSDClient.cpp;h=154dbd709476e682e86f14891b2fbc9fb9efa311;hb=HEAD#l154, there's a mismatch between "path+6" and "pathlen-5", no? That's an argument for using strlcat, instead, isn't it?
(By no means does the above mean I've done a thorough code review. It's just something I noticed.)
Regards, Ken