Unloading virtual DVD

I have a virtual DVD which is giving me problems with ejection. Although they
are virtual I will refer to ‘eject drive’ and ‘dismount media’

After being prodded by a call from a user program to dismount media my program
responds to a suitable SCSIOP_GET_EVENT_STATUS with
NOTIFICATION_MEDIA_EVENT_EJECT_REQUEST. For cd this results in the volume being
removed from the system. However for dvd media nothing happens in response to
this event. In either case my simulation will refuse further requests for that
media.

This is not a problem until I choose to remove the virtual drive. In this case
a call IoRequestDeviceEject and the drive recieves IRP_MN_QUERY_REMOVE_DEVICE.
If the last media had been cd the rest of the PnP sequence is processed and the
drive is gone. If the last media had been dvd IRP_MN_QUERY_REMOVE_DEVICE is the
last PnP ioctl seen and device eject is suspended. My driver can not unload. If
I use a checked UDFS.sys UDFS grumbles a debug message but does not detach.

If I send a IOCTL_STORAGE_CHECK_VERIFY from a user mode program, not always an
option, between dismounting a dvd and ejecting the dvd the drive letter is set
to its empty state and I can then eject the drive.

I would like to be able to send this IOCTL_STORAGE_CHECK_VERIFY to the volume
from by driver but I have no idea how to do it. I know how to send it to the
cdrom stack but that does nothing the cdrom drivers already knows the media has
gone it is the file system that is persisting.

I tried to send it to UDFS by using the DEVICE_OBJECT->Vbp->DeviceObject which
points to UDFS device object. This result in a Blue screen when UDFS looks at
the unprovided file object (udfs!UdfDecodeFileObject+0x8 from windbg)

How can I tell the file system the media had gone?


This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email


On Thu, 20 Nov 2008 15:51:57 +0000, you wrote:

1: need know windows how to check medium change
please check WDK or DDK source code: autorun.c
2: use bustrace hook device CDB command, device eject/load process
Device Mode
only support “Test Unit Ready” command
support “Test Unit Ready” + “Get event status notification” command
request notification class: 001b, 100b
more CDB command: 0x46, 0x51, 0xDB…

Best Wishes.

Thankyou, I was not using Operational Change events. It solved the problem.


This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email