[HALX86] Restore Windows compatibility on reporting device IDs
authorVictor Perevertkin <victor.perevertkin@reactos.org>
Sun, 31 Jan 2021 02:37:27 +0000 (05:37 +0300)
committerVictor Perevertkin <victor.perevertkin@reactos.org>
Sun, 31 Jan 2021 02:37:27 +0000 (05:37 +0300)
And forwarding IRPs from FDO to PDO

This along with 8aff2c9de7cf45dd306e447b0c27a379f827fe4c reverts the commit 74b889b3977594229a78d87066dfc22c1f9b46b8

hal/halx86/acpi/halpnpdd.c
hal/halx86/legacy/halpnpdd.c

index 03c1952..3f3d895 100644 (file)
@@ -561,10 +561,6 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
     switch (IdType)
     {
         case BusQueryDeviceID:
-            /* HACK */
-            Id = L"Root\\ACPI_HAL";
-            break;
-
         case BusQueryHardwareIDs:
 
             /* This is our hardware ID */
@@ -676,11 +672,26 @@ HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject,
             default:
 
                 DPRINT("Other IRP: %lx\n", Minor);
-                Status = Irp->IoStatus.Status;
+                Status = STATUS_NOT_SUPPORTED;
                 break;
         }
 
-        /* Nowhere for the IRP to go since we also own the PDO */
+        /* What happpened? */
+        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 */
+            IoSkipCurrentIrpStackLocation(Irp);
+            return IoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
+        }
+
+        /* Otherwise, we failed, so set the status and complete the request */
+        DPRINT1("IRP failed with status: %lx\n", Status);
         Irp->IoStatus.Status = Status;
         IoCompleteRequest(Irp, IO_NO_INCREMENT);
         return Status;
index 716b0d2..b2c03f2 100644 (file)
@@ -559,10 +559,6 @@ HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject,
     switch (IdType)
     {
         case BusQueryDeviceID:
-            /* HACK */
-            Id = L"Root\\PCI_HAL";
-            break;
-
         case BusQueryHardwareIDs:
 
             /* This is our hardware ID */
@@ -673,11 +669,26 @@ HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject,
             default:
 
                 DPRINT("Other IRP: %lx\n", Minor);
-                Status = Irp->IoStatus.Status;
+                Status = STATUS_NOT_SUPPORTED;
                 break;
         }
 
-        /* Nowhere for the IRP to go since we also own the PDO */
+        /* What happpened? */
+        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 */
+            IoSkipCurrentIrpStackLocation(Irp);
+            return IoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
+        }
+
+        /* Otherwise, we failed, so set the status and complete the request */
+        DPRINT1("IRP failed with status: %lx\n", Status);
         Irp->IoStatus.Status = Status;
         IoCompleteRequest(Irp, IO_NO_INCREMENT);
         return Status;