[DRIVERS] Use IoForwardIrpSynchronously in drivers

Instead of having an own routine in each driver
IoForwardIrpSynchronously can be used.
This commit is contained in:
Victor Perevertkin 2022-01-04 03:56:52 +03:00
parent 8e8f61989a
commit 7ed1883c8e
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
45 changed files with 238 additions and 866 deletions

View file

@ -29,29 +29,6 @@ USBSTOR_SyncForwardIrpCompletionRoutine(
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS
NTAPI
USBSTOR_SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
KEVENT Event;
NTSTATUS Status;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
IoSetCompletionRoutine(Irp, USBSTOR_SyncForwardIrpCompletionRoutine, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
// wait for the request to finish
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = Irp->IoStatus.Status;
}
return Status;
}
NTSTATUS
NTAPI
USBSTOR_GetBusInterface(