[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

@ -31,46 +31,6 @@ USBSTOR_SyncForwardIrpCompletionRoutine(
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS
NTAPI
USBCCGP_SyncForwardIrp(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
KEVENT Event;
NTSTATUS Status;
/* Initialize event */
KeInitializeEvent(&Event, NotificationEvent, FALSE);
/* Copy irp stack location */
IoCopyCurrentIrpStackLocationToNext(Irp);
/* Set completion routine */
IoSetCompletionRoutine(Irp,
USBSTOR_SyncForwardIrpCompletionRoutine,
&Event,
TRUE,
TRUE,
TRUE);
/* Call driver */
Status = IoCallDriver(DeviceObject, Irp);
/* Check if pending */
if (Status == STATUS_PENDING)
{
/* Wait for the request to finish */
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
/* Copy status code */
Status = Irp->IoStatus.Status;
}
/* Done */
return Status;
}
NTSTATUS
USBCCGP_SyncUrbRequest(
IN PDEVICE_OBJECT DeviceObject,