[libbus,driver] Move WvProbeDisks call out of bus library
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Mon, 3 Jan 2011 04:39:38 +0000 (23:39 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Mon, 3 Jan 2011 04:40:24 +0000 (23:40 -0500)
Other drivers don't want to probe for WinVBlock disks
for an IRP_MJ_PNP IRP_MN_QUERY_DEVICE_RELATIONS IRP.

src/winvblock/driver.c
src/winvblock/libbus/pnp.c

index 62cfd95..2b422ef 100644 (file)
@@ -42,6 +42,7 @@
 #include "mount.h"
 #include "filedisk.h"
 #include "ramdisk.h"
+#include "probe.h"
 #include "debug.h"
 
 /* From bus.c */
@@ -468,8 +469,11 @@ static NTSTATUS WvIrpPnp(
     Debug_IrpStart(dev_obj, irp);
     #endif
     /* Check for a bus IRP. */
-    if (dev_obj == WvBus.Fdo)
-      return WvlBusPnpIrp(&WvBus, irp, io_stack_loc->MinorFunction);
+    if (dev_obj == WvBus.Fdo) {
+        if (io_stack_loc->MinorFunction == IRP_MN_QUERY_DEVICE_RELATIONS)
+          WvProbeDisks();
+        return WvlBusPnpIrp(&WvBus, irp, io_stack_loc->MinorFunction);
+      }
     /* WvDevFromDevObj() checks for a NULL dev_obj */
     dev = WvDevFromDevObj(dev_obj);
     /* Check that the device exists. */
index 090ebde..b77c7fd 100644 (file)
@@ -35,7 +35,6 @@
 #include "irp.h"
 #include "bus.h"
 #include "debug.h"
-#include "probe.h"
 
 static NTSTATUS STDCALL WvlBusPnpIoCompletion(
     IN PDEVICE_OBJECT dev_obj,
@@ -165,7 +164,6 @@ static NTSTATUS STDCALL WvlBusPnpQueryDevRelations(
             irp->IoStatus.Status
           );
       }
-    WvProbeDisks();
     dev_relations = wv_malloc(
         sizeof *dev_relations +
           (sizeof (PDEVICE_OBJECT) * bus->BusPrivate_.NodeCount)