[HDAUDBUS] Use IoForwardIrpSynchronously instead of HDA_SyncForwardIrp.

This commit is contained in:
Thomas Faber 2019-02-24 12:23:45 +01:00
parent 789cfd3ddc
commit b05e5b0340
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
3 changed files with 6 additions and 64 deletions

View file

@ -540,7 +540,12 @@ HDA_FDOStartDevice(
ASSERT(DeviceExtension->IsFDO == TRUE);
/* forward irp to lower device */
Status = HDA_SyncForwardIrp(DeviceExtension->LowerDevice, Irp);
if (!IoForwardIrpSynchronously(DeviceExtension->LowerDevice, Irp))
{
ASSERT(FALSE);
return STATUS_INVALID_DEVICE_REQUEST;
}
Status = Irp->IoStatus.Status;
if (!NT_SUCCESS(Status))
{
// failed to start

View file

@ -31,60 +31,6 @@ FreeItem(
ExFreePool(Item);
}
NTSTATUS
NTAPI
HDA_SyncForwardIrpCompletionRoutine(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context)
{
if (Irp->PendingReturned)
{
KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
}
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS
NTAPI
HDA_SyncForwardIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
KEVENT Event;
NTSTATUS Status;
/* Initialize event */
KeInitializeEvent(&Event, NotificationEvent, FALSE);
/* Copy irp stack location */
IoCopyCurrentIrpStackLocationToNext(Irp);
/* Set completion routine */
IoSetCompletionRoutine(Irp,
HDA_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
HDA_FdoPnp(
_In_ PDEVICE_OBJECT DeviceObject,

View file

@ -170,12 +170,3 @@ NTSTATUS
HDA_PDOHandleQueryInterface(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/* hdaudbus.cpp*/
NTSTATUS
NTAPI
HDA_SyncForwardIrp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);