[SCSIPORT] Better error messages when receiving unexpected IOCTLs of mount manager
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 23 Nov 2014 13:48:12 +0000 (13:48 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 23 Nov 2014 13:48:12 +0000 (13:48 +0000)
svn path=/trunk/; revision=65454

reactos/drivers/storage/scsiport/scsiport.c

index 0db7e81..0585b0d 100644 (file)
@@ -34,6 +34,7 @@
 #include <scsi.h>
 #include <ntddscsi.h>
 #include <ntdddisk.h>
 #include <scsi.h>
 #include <ntddscsi.h>
 #include <ntdddisk.h>
+#include <mountdev.h>
 
 #define NDEBUG
 #include <debug.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -2877,8 +2878,20 @@ ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject,
           break;
 
       default:
           break;
 
       default:
-          if ('M' == (Stack->Parameters.DeviceIoControl.IoControlCode >> 16)) {
-            DPRINT1("  got ioctl intended for the mount manager: 0x%lX\n", Stack->Parameters.DeviceIoControl.IoControlCode);
+          if (DEVICE_TYPE_FROM_CTL_CODE(Stack->Parameters.DeviceIoControl.IoControlCode) == MOUNTDEVCONTROLTYPE)
+          {
+            switch (Stack->Parameters.DeviceIoControl.IoControlCode)
+            {
+            case IOCTL_MOUNTDEV_QUERY_DEVICE_NAME:
+                DPRINT1("Got unexpected IOCTL_MOUNTDEV_QUERY_DEVICE_NAME\n");
+                break;
+            case IOCTL_MOUNTDEV_QUERY_UNIQUE_ID:
+                DPRINT1("Got unexpected IOCTL_MOUNTDEV_QUERY_UNIQUE_ID\n");
+                break;
+            default:
+                DPRINT1("  got ioctl intended for the mount manager: 0x%lX\n", Stack->Parameters.DeviceIoControl.IoControlCode);
+                break;
+            }
           } else {
             DPRINT1("  unknown ioctl code: 0x%lX\n", Stack->Parameters.DeviceIoControl.IoControlCode);
           }
           } else {
             DPRINT1("  unknown ioctl code: 0x%lX\n", Stack->Parameters.DeviceIoControl.IoControlCode);
           }