[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Mon, 25 May 2015 12:55:51 +0000 (12:55 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 25 May 2015 12:55:51 +0000 (12:55 +0000)
Handle IRP_MJ_FILE_SYSTEM_CONTROL with the dispatch routine

svn path=/trunk/; revision=67905

reactos/drivers/filesystems/ntfs/dispatch.c
reactos/drivers/filesystems/ntfs/fsctl.c
reactos/drivers/filesystems/ntfs/ntfs.c
reactos/drivers/filesystems/ntfs/ntfs.h

index 88fff13..613e5cf 100644 (file)
@@ -104,6 +104,10 @@ NtfsDispatch(PNTFS_IRP_CONTEXT IrpContext)
         case IRP_MJ_CREATE:
             Status = NtfsCreate(IrpContext);
             break;
+
+        case IRP_MJ_FILE_SYSTEM_CONTROL:
+            Status = NtfsFileSystemControl(IrpContext);
+            break;
     }
 
     ASSERT((!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
index c3bf552..71a02a9 100644 (file)
@@ -866,20 +866,19 @@ NtfsUserFsRequest(PDEVICE_OBJECT DeviceObject,
 
 
 NTSTATUS
-NTAPI
-NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
-                         PIRP Irp)
+NtfsFileSystemControl(PNTFS_IRP_CONTEXT IrpContext)
 {
-    PIO_STACK_LOCATION Stack;
     NTSTATUS Status;
+    PIRP Irp;
+    PDEVICE_OBJECT DeviceObject;
 
     DPRINT1("NtfsFileSystemControl() called\n");
 
-    Stack = IoGetCurrentIrpStackLocation(Irp);
-
+    DeviceObject = IrpContext->DeviceObject;
+    Irp = IrpContext->Irp;
     Irp->IoStatus.Information = 0;
 
-    switch (Stack->MinorFunction)
+    switch (IrpContext->MinorFunction)
     {
         case IRP_MN_KERNEL_CALL:
             DPRINT1("NTFS: IRP_MN_USER_FS_REQUEST\n");
@@ -901,15 +900,11 @@ NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
             break;
 
         default:
-            DPRINT1("NTFS FSC: MinorFunction %d\n", Stack->MinorFunction);
+            DPRINT1("NTFS FSC: MinorFunction %d\n", IrpContext->MinorFunction);
             Status = STATUS_INVALID_DEVICE_REQUEST;
             break;
     }
 
-    Irp->IoStatus.Status = Status;
-
-    IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
     return Status;
 }
 
index 274ec82..5599701 100644 (file)
@@ -131,7 +131,7 @@ NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
     DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NtfsFsdDispatch;
     DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION]   = NtfsFsdDispatch;
     DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL]        = NtfsFsdDispatch;
-    DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL]      = NtfsFsdFileSystemControl;
+    DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL]      = NtfsFsdDispatch;
     DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]           = NtfsFsdDispatch;
 
     return;
index 20e3016..ab0facd 100644 (file)
@@ -644,10 +644,8 @@ NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext);
 
 /* fsctl.c */
 
-DRIVER_DISPATCH NtfsFsdFileSystemControl;
-NTSTATUS NTAPI
-NtfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject,
-                         PIRP Irp);
+NTSTATUS
+NtfsFileSystemControl(PNTFS_IRP_CONTEXT IrpContext);
 
 
 /* mft.c */