I have been developing a bit of a file system driver here, and
this IRP is giving me a hard time. My filter is more of a
monitoring project (similar to filemon). All I would like it
to do DbgPrint out data from the IRP’s passing by.
Unfortunately something I am doing in my code is blocking
normal function of the Filesystem. I am attaching to my G:
partition and can tell when I am, since all of a sudden, the
G: drive appears, but has no functionality. I think it may be
broken in my IRP_MJ_CREATE function because i get repeated
IRP_MJ_CREATE IRPS when it tries to use the G: device. As of
now I have a minimal function:
NTSTATUS FileIOMicCreate(PDEVICE_OBJECT DeviceObject,
PIRP Irp){
PDEVICE_EXTENSION deviceExtension;
deviceExtension = (PDEVICE_EXTENSION)
DeviceObject->DeviceExtension;
printdbgs((“IRP_MJ_CREATE\n”));
PrintIrpInfo(Irp);
if(deviceExtension->started == DEVICE_STARTED) {
printdbg((“skipping…\n”));
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(deviceExtension->nextInStack, Irp);
} else {
printdbg((“completeing…\n”));
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
}
If someone could explain to me the proper use of IRP_MJ_CREATE
I would be very grateful.
Thanks,
J.J.