mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[ACPI]
- Add stubs for ACPI_INTERFACE_STANDARD and write all of the glue code for IRP_MN_QUERY_INTERFACE svn path=/trunk/; revision=46353
This commit is contained in:
parent
b52502476e
commit
fc1acf8469
3 changed files with 145 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
</directory>
|
||||
<file>osl.c</file>
|
||||
<file>acpienum.c</file>
|
||||
<file>interface.c</file>
|
||||
<file>pnp.c</file>
|
||||
<file>power.c</file>
|
||||
<file>buspdo.c</file>
|
||||
|
|
|
@ -176,6 +176,12 @@ Bus_PDO_PnP (
|
|||
|
||||
break;
|
||||
|
||||
case IRP_MN_QUERY_INTERFACE:
|
||||
|
||||
status = Bus_PDO_QueryInterface(DeviceData, Irp);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
|
||||
|
||||
|
|
138
reactos/drivers/bus/acpi/interface.c
Normal file
138
reactos/drivers/bus/acpi/interface.c
Normal file
|
@ -0,0 +1,138 @@
|
|||
#include <ntddk.h>
|
||||
|
||||
#include <acpi.h>
|
||||
|
||||
#include <acpisys.h>
|
||||
#include <acpi_bus.h>
|
||||
#include <acpi_drivers.h>
|
||||
|
||||
#include <wdmguid.h>
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
AcpiInterfaceReference(PVOID Context)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
AcpiInterfaceDereference(PVOID Context)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
AcpiInterfaceConnectVector(PDEVICE_OBJECT Context,
|
||||
ULONG GpeNumber,
|
||||
KINTERRUPT_MODE Mode,
|
||||
BOOLEAN Shareable,
|
||||
PGPE_SERVICE_ROUTINE ServiceRoutine,
|
||||
PVOID ServiceContext,
|
||||
PVOID *ObjectContext)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
AcpiInterfaceDisconnectVector(PDEVICE_OBJECT Context,
|
||||
PVOID ObjectContext)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
AcpiInterfaceEnableEvent(PDEVICE_OBJECT Context,
|
||||
PVOID ObjectContext)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
AcpiInterfaceDisableEvent(PDEVICE_OBJECT Context,
|
||||
PVOID ObjectContext)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
AcpiInterfaceClearStatus(PDEVICE_OBJECT Context,
|
||||
PVOID ObjectContext)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
AcpiInterfaceNotificationsRegister(PDEVICE_OBJECT Context,
|
||||
PDEVICE_NOTIFY_CALLBACK NotificationHandler,
|
||||
PVOID NotificationContext)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
VOID
|
||||
AcpiInterfaceNotificationsUnregister(PDEVICE_OBJECT Context,
|
||||
PDEVICE_NOTIFY_CALLBACK NotificationHandler)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
Bus_PDO_QueryInterface(PPDO_DEVICE_DATA DeviceData,
|
||||
PIRP Irp)
|
||||
{
|
||||
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||
PACPI_INTERFACE_STANDARD AcpiInterface;
|
||||
|
||||
if (IrpSp->Parameters.QueryInterface.Version != 1)
|
||||
{
|
||||
DPRINT1("Invalid version number: %d\n",
|
||||
IrpSp->Parameters.QueryInterface.Version);
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (RtlCompareMemory(IrpSp->Parameters.QueryInterface.InterfaceType,
|
||||
&GUID_ACPI_INTERFACE_STANDARD, sizeof(GUID)) == sizeof(GUID))
|
||||
{
|
||||
DPRINT("GUID_ACPI_INTERFACE_STANDARD\n");
|
||||
|
||||
if (IrpSp->Parameters.QueryInterface.Size < sizeof(ACPI_INTERFACE_STANDARD))
|
||||
{
|
||||
DPRINT1("Buffer too small! (%d)\n", IrpSp->Parameters.QueryInterface.Size);
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
AcpiInterface = (PACPI_INTERFACE_STANDARD)IrpSp->Parameters.QueryInterface.Interface;
|
||||
|
||||
AcpiInterface->InterfaceReference = AcpiInterfaceReference;
|
||||
AcpiInterface->InterfaceDereference = AcpiInterfaceDereference;
|
||||
AcpiInterface->GpeConnectVector = AcpiInterfaceConnectVector;
|
||||
AcpiInterface->GpeDisconnectVector = AcpiInterfaceDisconnectVector;
|
||||
AcpiInterface->GpeEnableEvent = AcpiInterfaceEnableEvent;
|
||||
AcpiInterface->GpeDisableEvent = AcpiInterfaceDisableEvent;
|
||||
AcpiInterface->GpeClearStatus = AcpiInterfaceClearStatus;
|
||||
AcpiInterface->RegisterForDeviceNotifications = AcpiInterfaceNotificationsRegister;
|
||||
AcpiInterface->UnregisterForDeviceNotifications = AcpiInterfaceNotificationsUnregister;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Invalid GUID\n");
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue