[bus/pnp] Enqueue IRP_MN_QUERY_DEVICE_RELATIONS IRP
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Mon, 20 Dec 2010 05:42:54 +0000 (00:42 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Mon, 20 Dec 2010 05:42:54 +0000 (00:42 -0500)
src/winvblock/bus/pnp.c

index 8e6db10..66c7b9d 100644 (file)
@@ -146,6 +146,16 @@ static NTSTATUS STDCALL bus_pnp__query_dev_relations_(
     struct device__type * walker;
     PDEVICE_RELATIONS dev_relations;
 
+    if (!(io_stack_loc->Control & SL_PENDING_RETURNED)) {
+        /* Enqueue the IRP. */
+        status = WvBusEnqueueIrp(bus, irp);
+        if (status != STATUS_PENDING)
+          /* Problem. */
+          return driver__complete_irp(irp, 0, status);
+        /* Ok. */
+        return status;
+      }
+    /* If we get here, we should be called by WvBusProcessWorkItems() */
     if (
         io_stack_loc->Parameters.QueryDeviceRelations.Type != BusRelations ||
         irp->IoStatus.Information