- Bypass the completion routines from kernel if there is a

reading or writing request to the storage device.

svn path=/trunk/; revision=7371
This commit is contained in:
Hartmut Birr
2003-12-31 15:07:10 +00:00
parent e612170f41
commit b6526368dc
+37
View File
@@ -19,6 +19,29 @@
/* FUNCTIONS ***************************************************************/
NTSTATUS STDCALL
VfatReadWriteCompletion (IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context)
{
PMDL Mdl;
DPRINT("VfatReadBlockDeviceCompletion(DeviceObject %x, Irp %x, Context %x)\n",
DeviceObject, Irp, Context);
while ((Mdl = Irp->MdlAddress))
{
Irp->MdlAddress = Mdl->Next;
IoFreeMdl(Mdl);
}
*Irp->UserIosb = Irp->IoStatus;
KeSetEvent(Irp->UserEvent, IO_NO_INCREMENT, FALSE);
IoFreeIrp(Irp);
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS
VfatReadDisk (IN PDEVICE_OBJECT pDeviceObject,
IN PLARGE_INTEGER ReadOffset,
@@ -57,6 +80,13 @@ VfatReadDisk (IN PDEVICE_OBJECT pDeviceObject,
Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME;
}
IoSetCompletionRoutine(Irp,
VfatReadWriteCompletion,
NULL,
TRUE,
TRUE,
TRUE);
DPRINT ("Calling IO Driver... with irp %x\n", Irp);
Status = IoCallDriver (pDeviceObject, Irp);
@@ -111,6 +141,13 @@ VfatWriteDisk (IN PDEVICE_OBJECT pDeviceObject,
return (STATUS_UNSUCCESSFUL);
}
IoSetCompletionRoutine(Irp,
VfatReadWriteCompletion,
NULL,
TRUE,
TRUE,
TRUE);
DPRINT ("Calling IO Driver...\n");
Status = IoCallDriver (pDeviceObject, Irp);