[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 3 May 2015 18:36:58 +0000 (18:36 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 3 May 2015 18:36:58 +0000 (18:36 +0000)
Handle the file query information IRP major with the dispatch routine

svn path=/trunk/; revision=67540

reactos/drivers/filesystems/ntfs/dispatch.c
reactos/drivers/filesystems/ntfs/finfo.c
reactos/drivers/filesystems/ntfs/ntfs.c
reactos/drivers/filesystems/ntfs/ntfs.h
reactos/drivers/filesystems/ntfs/volinfo.c

index 4670f45..11d833a 100644 (file)
@@ -68,6 +68,10 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
             case IRP_MJ_SET_VOLUME_INFORMATION:
                 Status = NtfsSetVolumeInformation(IrpContext);
                 break;
+
+            case IRP_MJ_QUERY_INFORMATION:
+                Status = NtfsQueryInformation(IrpContext);
+                break;
         }
     }
     else
index 1275329..3931a2a 100644 (file)
@@ -222,9 +222,7 @@ NtfsGetNetworkOpenInformation(PNTFS_FCB Fcb,
  * FUNCTION: Retrieve the specified file information
  */
 NTSTATUS
-NTAPI
-NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
-                        PIRP Irp)
+NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext)
 {
     FILE_INFORMATION_CLASS FileInformationClass;
     PIO_STACK_LOCATION Stack;
@@ -232,13 +230,17 @@ NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
     PNTFS_FCB Fcb;
     PVOID SystemBuffer;
     ULONG BufferLength;
+    PIRP Irp;
+    PDEVICE_OBJECT DeviceObject;
     NTSTATUS Status = STATUS_SUCCESS;
 
-    DPRINT1("NtfsQueryInformation(%p, %p)\n", DeviceObject, Irp);
+    DPRINT1("NtfsQueryInformation(%p)\n", IrpContext);
 
-    Stack = IoGetCurrentIrpStackLocation(Irp);
+    Irp = IrpContext->Irp;
+    Stack = IrpContext->Stack;
+    DeviceObject = IrpContext->DeviceObject;
     FileInformationClass = Stack->Parameters.QueryFile.FileInformationClass;
-    FileObject = Stack->FileObject;
+    FileObject = IrpContext->FileObject;
     Fcb = FileObject->FsContext;
 
     SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
index 613dcda..f43185d 100644 (file)
@@ -123,7 +123,7 @@ NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
     DriverObject->MajorFunction[IRP_MJ_CLOSE]                    = NtfsFsdClose;
     DriverObject->MajorFunction[IRP_MJ_READ]                     = NtfsFsdRead;
     DriverObject->MajorFunction[IRP_MJ_WRITE]                    = NtfsFsdWrite;
-    DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION]        = NtfsFsdQueryInformation;
+    DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION]        = NtfsFsdDispatch;
     DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NtfsFsdDispatch;
     DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION]   = NtfsFsdDispatch;
     DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL]        = NtfsFsdDirectoryControl;
index af77242..2eccf7d 100644 (file)
@@ -642,10 +642,8 @@ NtfsReadFCBAttribute(PNTFS_VCB Vcb,
 
 /* finfo.c */
 
-DRIVER_DISPATCH NtfsFsdQueryInformation;
-NTSTATUS NTAPI
-NtfsFsdQueryInformation(PDEVICE_OBJECT DeviceObject,
-                        PIRP Irp);
+NTSTATUS
+NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext);
 
 
 /* fsctl.c */
index 41823e1..4ffcc90 100644 (file)
@@ -253,7 +253,7 @@ NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext)
 
     Irp = IrpContext->Irp;
     DeviceObject = IrpContext->DeviceObject;
-    Stack = IoGetCurrentIrpStackLocation(Irp);
+    Stack = IrpContext->Stack;
     FsInformationClass = Stack->Parameters.QueryVolume.FsInformationClass;
     BufferLength = Stack->Parameters.QueryVolume.Length;
     SystemBuffer = Irp->AssociatedIrp.SystemBuffer;