You must fully implement "check verify" and all related removable media handling in your vdisk - DO_VERIFY_VOLUME and so on.
--
Maxim S. Shatskih
Windows DDK MVP
http://www.storagecraft.com
"Mathieu" <> wrote in message news:4ae8df9c$0$894$...
>
> Hello, I developed a driver to mount a logical drive on an image file (.
> RAW). It works perfect! By cons when I unmount the logical drive and
> remount the logical drive pointing to another image file (. RAW) windows
> keep the old file because some filenames and the FAT are buffered. When
> i unmount the logical Drive I do not use IoDeleteDevice by cons I delete
> the symlink \\.\X: with api iodeletesymboliclink, and use
> DefineDosDevice for removing the logicial drive mapped to
> \\device\DeviceImg. When I unmount i inactivate the device with a only
> flag remember. When the device is unmounted I return a NTSTATUS error
> code such STATUS_MEDIA_REMOVED , not work if used.
>
> {
> KdPrintferror(("[VDUM] IOCTL not used index %d.\n",index));
> status=STATUS_DEVICE_REMOVED;
> irp->IoStatus.Status=status;
> irp->IoStatus.Information = 0; goto fin; } else { } .. ..
> irp->IoStatus.Status = status;
> if (status!=STATUS_PENDING)
> IoCompleteRequest(irp, IO_NO_INCREMENT);
>
> Conclusion: How to ask windows to purge the buffer that stores the names
> of files on disk \\device\DeviceImg with out call IoDeleteDevice?? Thank
> you very much.
>
>
> My wish: when I dismounted and went up the logical drive to another
> image file (. RAW) I want to empty the buffer storing the FAT
> directories and file names, so I can see my files stored in another
> image file . Thank you