mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
[DRIVERS] Use IoForwardIrpSynchronously in drivers
Instead of having an own routine in each driver IoForwardIrpSynchronously can be used.
This commit is contained in:
parent
8e8f61989a
commit
7ed1883c8e
45 changed files with 238 additions and 866 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue