https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a8414f665b00a75f488a2…
commit a8414f665b00a75f488a2f51e3f375c889a8bd20
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Feb 24 12:29:34 2019 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Tue Feb 26 09:58:53 2019 +0100
[HDAUDBUS] Implement HDA_Unload. Stub HDA_Power and HDA_SystemControl.
---
drivers/wdm/audio/hdaudbus/hdaudbus.cpp | 63 +++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
b/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
index 0202385a82..3e1ef9d526 100644
--- a/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
+++ b/drivers/wdm/audio/hdaudbus/hdaudbus.cpp
@@ -8,7 +8,10 @@
#include "hdaudbus.h"
DRIVER_DISPATCH HDA_Pnp;
+DRIVER_DISPATCH HDA_SystemControl;
+DRIVER_DISPATCH HDA_Power;
DRIVER_ADD_DEVICE HDA_AddDevice;
+DRIVER_UNLOAD HDA_Unload;
extern "C" DRIVER_INITIALIZE DriverEntry;
PVOID
@@ -206,6 +209,55 @@ HDA_Pnp(
}
}
+NTSTATUS
+NTAPI
+HDA_SystemControl(
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp)
+{
+ NTSTATUS Status;
+ PHDA_FDO_DEVICE_EXTENSION FDODeviceExtension;
+
+ FDODeviceExtension =
static_cast<PHDA_FDO_DEVICE_EXTENSION>(DeviceObject->DeviceExtension);
+
+ if (FDODeviceExtension->IsFDO)
+ {
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(FDODeviceExtension->LowerDevice, Irp);
+ }
+ else
+ {
+ Status = Irp->IoStatus.Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
+}
+
+NTSTATUS
+NTAPI
+HDA_Power(
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp)
+{
+ NTSTATUS Status;
+ PHDA_FDO_DEVICE_EXTENSION FDODeviceExtension;
+
+ FDODeviceExtension =
static_cast<PHDA_FDO_DEVICE_EXTENSION>(DeviceObject->DeviceExtension);
+
+ if (FDODeviceExtension->IsFDO)
+ {
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ return PoCallDriver(FDODeviceExtension->LowerDevice, Irp);
+ }
+ else
+ {
+ Status = Irp->IoStatus.Status;
+ PoStartNextPowerIrp(Irp);
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
+}
NTSTATUS
NTAPI
@@ -238,6 +290,14 @@ HDA_AddDevice(
return Status;
}
+
+VOID
+NTAPI
+HDA_Unload(
+ _In_ PDRIVER_OBJECT DriverObject)
+{
+}
+
extern "C"
{
NTSTATUS
@@ -246,7 +306,10 @@ DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPathName)
{
+ DriverObject->DriverUnload = HDA_Unload;
DriverObject->DriverExtension->AddDevice = HDA_AddDevice;
+ DriverObject->MajorFunction[IRP_MJ_POWER] = HDA_Power;
+ DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = HDA_SystemControl;
DriverObject->MajorFunction[IRP_MJ_PNP] = HDA_Pnp;
return STATUS_SUCCESS;