[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Wed, 29 Oct 2014 18:42:05 +0000 (18:42 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 29 Oct 2014 18:42:05 +0000 (18:42 +0000)
Finally, move old stuff back from disk.sys to ntfs.sys now it can be properly reached on volume opening:
- Halfplement NtfsUserFsRequest() and add support for IRP_MN_USER_FS_REQUEST in NtfsFsdFileSystemControl()
- Also, use the proper FSCTL code: FSCTL_GET_NTFS_VOLUME_DATA which exists and is documented instead of FSCTL_GET_NTFS_VOLUME_DATA. Spotted by Christoph.

CORE-8725

svn path=/trunk/; revision=65106

reactos/drivers/filesystems/ntfs/fsctl.c

index b57e12a..e91ac68 100644 (file)
@@ -526,6 +526,34 @@ NtfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
 }
 
 
+static
+NTSTATUS
+NtfsUserFsRequest(PDEVICE_OBJECT DeviceObject,
+                  PIRP Irp)
+{
+    NTSTATUS Status;
+    PIO_STACK_LOCATION Stack;
+
+    DPRINT1("NtfsUserFsRequest(%p, %p)\n", DeviceObject, Irp);
+
+    Stack = IoGetCurrentIrpStackLocation(Irp);
+    switch (Stack->Parameters.FileSystemControl.FsControlCode)
+    {
+        case FSCTL_GET_NTFS_VOLUME_DATA:
+            UNIMPLEMENTED;
+            Status = STATUS_NOT_IMPLEMENTED;
+            break;
+
+        default:
+            DPRINT1("Invalid user request: %x\n", Stack->Parameters.FileSystemControl.FsControlCode);
+            Status = STATUS_INVALID_DEVICE_REQUEST;
+            break;
+    }
+
+    return Status;
+}
+
+
 NTSTATUS
 NTAPI
 NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
@@ -541,11 +569,14 @@ NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
     switch (Stack->MinorFunction)
     {
         case IRP_MN_KERNEL_CALL:
-        case IRP_MN_USER_FS_REQUEST:
-            DPRINT("NTFS: IRP_MN_USER_FS_REQUEST/IRP_MN_KERNEL_CALL\n");
+            DPRINT1("NTFS: IRP_MN_USER_FS_REQUEST\n");
             Status = STATUS_INVALID_DEVICE_REQUEST;
             break;
 
+        case IRP_MN_USER_FS_REQUEST:
+            Status = NtfsUserFsRequest(DeviceObject, Irp);
+            break;
+
         case IRP_MN_MOUNT_VOLUME:
             DPRINT("NTFS: IRP_MN_MOUNT_VOLUME\n");
             Status = NtfsMountVolume(DeviceObject, Irp);
@@ -557,7 +588,7 @@ NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
             break;
 
         default:
-            DPRINT("NTFS FSC: MinorFunction %d\n", Stack->MinorFunction);
+            DPRINT1("NTFS FSC: MinorFunction %d\n", Stack->MinorFunction);
             Status = STATUS_INVALID_DEVICE_REQUEST;
             break;
     }