We got a working minifilter driver. already developed a few years ago and only handled IRP_MJ_CREATE. It works well but when user replugin the same CD/DVD for Burn. I can’t get IRP_MJ_CREATE preoperation callback function or instanceSetup be called. Sometimes it also happens on RAW Volume on usb.
What would I do in general to intercept the same CD/DVD or raw volume when it replugined?
I found that when replugin the CD I can get irp of IRP_MN_VERIFY_VOLUME and if RAW CD I get irp IRP_MN_USER_FS_REQUEST with FSCTL_IS_VOLUME_DIRTY. Can I use this as notification of CD plugin? like below:
if (data->Iopb->MinorFunction == IRP_MN_USER_FS_REQUEST &&
ctx->getFileSystemType() == FLT_FSTYPE_RAW &&
data->Iopb->Parameters.FileSystemControl.Common.FsControlCode == FSCTL_IS_VOLUME_DIRTY)
{
// RAW CD/DVD plugin
}
if (data->Iopb->MinorFunction == IRP_MN_VERIFY_VOLUME)
{
// CDFS CD/DVD plugin
}