https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b05e5b034062303c4646a…
commit b05e5b034062303c4646aa3bbd38c68ecb087f60
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Feb 24 12:23:45 2019 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Tue Feb 26 09:50:50 2019 +0100
[HDAUDBUS] Use IoForwardIrpSynchronously instead of HDA_SyncForwardIrp.
---
drivers/wdm/audio/hdaudbus/fdo.cpp | 7 ++++-
drivers/wdm/audio/hdaudbus/hdaudbus.cpp | 54 ---------------------------------
drivers/wdm/audio/hdaudbus/hdaudbus.h | 9 ------
3 files changed, 6 insertions(+), 64 deletions(-)
diff --git a/drivers/wdm/audio/hdaudbus/fdo.cpp b/drivers/wdm/audio/hdaudbus/fdo.cpp
index 6bbadf3746..3df33c907b 100644
--- a/drivers/wdm/audio/hdaudbus/fdo.cpp
+++ b/drivers/wdm/audio/hdaudbus/fdo.cpp
@@ -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
diff --git a/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
b/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
index b8eacba435..440d75ae58 100644
--- a/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
+++ b/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
@@ -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,
diff --git a/drivers/wdm/audio/hdaudbus/hdaudbus.h
b/drivers/wdm/audio/hdaudbus/hdaudbus.h
index 1496f6de24..fa7f04a70a 100644
--- a/drivers/wdm/audio/hdaudbus/hdaudbus.h
+++ b/drivers/wdm/audio/hdaudbus/hdaudbus.h
@@ -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);
-