mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
- 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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user