mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[HDAUDBUS] Implement HDA_Unload. Stub HDA_Power and HDA_SystemControl.
This commit is contained in:
parent
25b22131ca
commit
a8414f665b
1 changed files with 63 additions and 0 deletions
|
@ -8,7 +8,10 @@
|
||||||
#include "hdaudbus.h"
|
#include "hdaudbus.h"
|
||||||
|
|
||||||
DRIVER_DISPATCH HDA_Pnp;
|
DRIVER_DISPATCH HDA_Pnp;
|
||||||
|
DRIVER_DISPATCH HDA_SystemControl;
|
||||||
|
DRIVER_DISPATCH HDA_Power;
|
||||||
DRIVER_ADD_DEVICE HDA_AddDevice;
|
DRIVER_ADD_DEVICE HDA_AddDevice;
|
||||||
|
DRIVER_UNLOAD HDA_Unload;
|
||||||
extern "C" DRIVER_INITIALIZE DriverEntry;
|
extern "C" DRIVER_INITIALIZE DriverEntry;
|
||||||
|
|
||||||
PVOID
|
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
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -238,6 +290,14 @@ HDA_AddDevice(
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
HDA_Unload(
|
||||||
|
_In_ PDRIVER_OBJECT DriverObject)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -246,7 +306,10 @@ DriverEntry(
|
||||||
_In_ PDRIVER_OBJECT DriverObject,
|
_In_ PDRIVER_OBJECT DriverObject,
|
||||||
_In_ PUNICODE_STRING RegistryPathName)
|
_In_ PUNICODE_STRING RegistryPathName)
|
||||||
{
|
{
|
||||||
|
DriverObject->DriverUnload = HDA_Unload;
|
||||||
DriverObject->DriverExtension->AddDevice = HDA_AddDevice;
|
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;
|
DriverObject->MajorFunction[IRP_MJ_PNP] = HDA_Pnp;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in a new issue