mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
[HAL]
- Fix device reporting to work with the IoReportDetectedDevice patch [HAL/ACPI] - Turn debugging off svn path=/trunk/; revision=53394
This commit is contained in:
parent
417749b6bf
commit
74b889b397
6 changed files with 40 additions and 43 deletions
|
@ -13,7 +13,7 @@
|
||||||
#include <acpi_drivers.h>
|
#include <acpi_drivers.h>
|
||||||
#include <list.h>
|
#include <list.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#define HAS_CHILDREN(d) ((d)->children.next != &((d)->children))
|
#define HAS_CHILDREN(d) ((d)->children.next != &((d)->children))
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
#include <poclass.h>
|
#include <poclass.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#ifdef ALLOC_PRAGMA
|
#ifdef ALLOC_PRAGMA
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <acpiioct.h>
|
#include <acpiioct.h>
|
||||||
#include <poclass.h>
|
#include <poclass.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <acpi_drivers.h>
|
#include <acpi_drivers.h>
|
||||||
|
|
||||||
#include <wdmguid.h>
|
#include <wdmguid.h>
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
/* INCLUDES *******************************************************************/
|
/* INCLUDES *******************************************************************/
|
||||||
|
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/* GLOBALS ********************************************************************/
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
/* INCLUDES *******************************************************************/
|
/* INCLUDES *******************************************************************/
|
||||||
|
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
typedef enum _EXTENSION_TYPE
|
typedef enum _EXTENSION_TYPE
|
||||||
|
@ -563,6 +563,10 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
switch (IdType)
|
switch (IdType)
|
||||||
{
|
{
|
||||||
case BusQueryDeviceID:
|
case BusQueryDeviceID:
|
||||||
|
/* HACK */
|
||||||
|
Id = L"Root\\ACPI_HAL";
|
||||||
|
break;
|
||||||
|
|
||||||
case BusQueryHardwareIDs:
|
case BusQueryHardwareIDs:
|
||||||
|
|
||||||
/* This is our hardware ID */
|
/* This is our hardware ID */
|
||||||
|
@ -609,21 +613,6 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
HalpPassIrpFromFdoToPdo(IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN PIRP Irp)
|
|
||||||
{
|
|
||||||
PFDO_EXTENSION FdoExtension;
|
|
||||||
|
|
||||||
/* Get the extension */
|
|
||||||
FdoExtension = DeviceObject->DeviceExtension;
|
|
||||||
|
|
||||||
/* Pass it to the attached device (our PDO) */
|
|
||||||
IoSkipCurrentIrpStackLocation(Irp);
|
|
||||||
return IoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject,
|
HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
@ -682,22 +671,11 @@ HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
/* Pass it to the PDO */
|
/* Pass it to the PDO */
|
||||||
DPRINT("Other IRP: %lx\n", Minor);
|
DPRINT("Other IRP: %lx\n", Minor);
|
||||||
return HalpPassIrpFromFdoToPdo(DeviceObject, Irp);
|
Status = Irp->IoStatus.Status;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* What happpened? */
|
/* Nowhere for the IRP to go since we also own the PDO */
|
||||||
if ((NT_SUCCESS(Status)) || (Status == STATUS_NOT_SUPPORTED))
|
|
||||||
{
|
|
||||||
/* Set the IRP status, unless this isn't understood */
|
|
||||||
if (Status != STATUS_NOT_SUPPORTED) Irp->IoStatus.Status = Status;
|
|
||||||
|
|
||||||
/* Pass it on */
|
|
||||||
DPRINT("Passing IRP to PDO\n");
|
|
||||||
return HalpPassIrpFromFdoToPdo(DeviceObject, Irp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Otherwise, we failed, so set the status and complete the request */
|
|
||||||
DPRINT1("IRP failed with status: %lx\n", Status);
|
|
||||||
Irp->IoStatus.Status = Status;
|
Irp->IoStatus.Status = Status;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -834,20 +812,42 @@ HalpDriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PDEVICE_OBJECT TargetDevice = NULL;
|
PDEVICE_OBJECT TargetDevice = NULL;
|
||||||
|
|
||||||
DPRINT("HAL: PnP Driver ENTRY!\n");
|
DPRINT("HAL: PnP Driver ENTRY!\n");
|
||||||
|
|
||||||
/* This is us */
|
/* This is us */
|
||||||
HalpDriverObject = DriverObject;
|
HalpDriverObject = DriverObject;
|
||||||
|
|
||||||
/* Set up add device */
|
/* Set up add device */
|
||||||
DriverObject->DriverExtension->AddDevice = HalpAddDevice;
|
DriverObject->DriverExtension->AddDevice = HalpAddDevice;
|
||||||
|
|
||||||
/* Set up the callouts */
|
/* Set up the callouts */
|
||||||
DriverObject->MajorFunction[IRP_MJ_PNP] = HalpDispatchPnp;
|
DriverObject->MajorFunction[IRP_MJ_PNP] = HalpDispatchPnp;
|
||||||
DriverObject->MajorFunction[IRP_MJ_POWER] = HalpDispatchPower;
|
DriverObject->MajorFunction[IRP_MJ_POWER] = HalpDispatchPower;
|
||||||
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = HalpDispatchWmi;
|
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = HalpDispatchWmi;
|
||||||
|
|
||||||
/* Tell the PnP about us */
|
/* Create the PDO */
|
||||||
|
Status = IoCreateDevice(DriverObject,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
FILE_DEVICE_CONTROLLER,
|
||||||
|
0,
|
||||||
|
FALSE,
|
||||||
|
&TargetDevice);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return Status;
|
||||||
|
|
||||||
|
TargetDevice->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||||
|
|
||||||
|
/* Set up the device stack */
|
||||||
|
Status = HalpAddDevice(DriverObject, TargetDevice);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
IoDeleteDevice(TargetDevice);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tell the PnP manager about us */
|
||||||
Status = IoReportDetectedDevice(DriverObject,
|
Status = IoReportDetectedDevice(DriverObject,
|
||||||
InterfaceTypeUndefined,
|
InterfaceTypeUndefined,
|
||||||
-1,
|
-1,
|
||||||
|
@ -857,9 +857,6 @@ HalpDriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||||
FALSE,
|
FALSE,
|
||||||
&TargetDevice);
|
&TargetDevice);
|
||||||
|
|
||||||
/* Now add us */
|
|
||||||
if (NT_SUCCESS(Status)) Status = HalpAddDevice(DriverObject, TargetDevice);
|
|
||||||
|
|
||||||
/* Return to kernel */
|
/* Return to kernel */
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue