[CLASS2]
authorPierre Schweitzer <pierre@reactos.org>
Tue, 3 Oct 2017 06:40:08 +0000 (06:40 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Tue, 3 Oct 2017 06:40:08 +0000 (06:40 +0000)
It's up to class drivers to handle MountMgr requests. So, make it handle them, even though that's just to fail because it's not implemented.
This will stop IOCTLs to be sent down in the storage stack.

svn path=/trunk/; revision=76032

reactos/drivers/storage/class/class2/class2.c

index 0a4c3d7..20f55ef 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <ntddk.h>
 #include <ntdddisk.h>
 
 #include <ntddk.h>
 #include <ntdddisk.h>
+#include <mountdev.h>
 #include <scsi.h>
 #include <include/class2.h>
 #include <stdio.h>
 #include <scsi.h>
 #include <include/class2.h>
 #include <stdio.h>
@@ -4040,6 +4041,17 @@ Return Value:
         goto SetStatusAndReturn;
     }
 
         goto SetStatusAndReturn;
     }
 
+    if (irpStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_MOUNTDEV_QUERY_DEVICE_NAME || 
+        irpStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_MOUNTDEV_QUERY_UNIQUE_ID ||
+        irpStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME) {
+        UNIMPLEMENTED;
+        Irp->IoStatus.Information = 0;
+        Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+        IoCompleteRequest(Irp, IO_NO_INCREMENT);
+        status = STATUS_NOT_IMPLEMENTED;
+        goto SetStatusAndReturn;
+    }
+
     srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
 
     if (srb == NULL) {
     srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);
 
     if (srb == NULL) {