[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 3 May 2015 18:25:55 +0000 (18:25 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 3 May 2015 18:25:55 +0000 (18:25 +0000)
Store stack & FO in IRP context

svn path=/trunk/; revision=67539

reactos/drivers/filesystems/ntfs/misc.c
reactos/drivers/filesystems/ntfs/ntfs.h

index 071fe1b..2544b37 100644 (file)
@@ -67,7 +67,6 @@ NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
                        PIRP Irp)
 {
     PNTFS_IRP_CONTEXT IrpContext;
-    PIO_STACK_LOCATION IoStackLocation;
 
     TRACE_(NTFS, "NtfsAllocateIrpContext()\n");
 
@@ -83,16 +82,17 @@ NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
     IrpContext->Identifier.Size = sizeof(NTFS_IRP_CONTEXT);
     IrpContext->Irp = Irp;
     IrpContext->DeviceObject = DeviceObject;
-    IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
-    IrpContext->MajorFunction = IoStackLocation->MajorFunction;
-    IrpContext->MinorFunction = IoStackLocation->MinorFunction;
+    IrpContext->Stack = IoGetCurrentIrpStackLocation(Irp);
+    IrpContext->MajorFunction = IrpContext->Stack->MajorFunction;
+    IrpContext->MinorFunction = IrpContext->Stack->MinorFunction;
+    IrpContext->FileObject = IrpContext->Stack->FileObject;
     IrpContext->IsTopLevel = (IoGetTopLevelIrp() == Irp);
 
-    if (IoStackLocation->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL ||
-        IoStackLocation->MajorFunction == IRP_MJ_DEVICE_CONTROL ||
-        IoStackLocation->MajorFunction == IRP_MJ_SHUTDOWN ||
-        (IoStackLocation->MajorFunction != IRP_MJ_CLEANUP &&
-         IoStackLocation->MajorFunction != IRP_MJ_CLOSE &&
+    if (IrpContext->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL ||
+        IrpContext->MajorFunction == IRP_MJ_DEVICE_CONTROL ||
+        IrpContext->MajorFunction == IRP_MJ_SHUTDOWN ||
+        (IrpContext->MajorFunction != IRP_MJ_CLEANUP &&
+         IrpContext->MajorFunction != IRP_MJ_CLOSE &&
          IoIsOperationSynchronous(Irp)))
     {
         IrpContext->Flags |= IRPCONTEXT_CANWAIT;
index 3f2e55c..af77242 100644 (file)
@@ -397,12 +397,14 @@ typedef struct
 {
     NTFSIDENTIFIER Identifier;
     ULONG Flags;
+    PIO_STACK_LOCATION Stack;
     UCHAR MajorFunction;
     UCHAR MinorFunction;
     WORK_QUEUE_ITEM WorkQueueItem;
     PIRP Irp;
     BOOLEAN IsTopLevel;
     PDEVICE_OBJECT DeviceObject;
+    PFILE_OBJECT FileObject;
     NTSTATUS SavedExceptionCode;
 } NTFS_IRP_CONTEXT, *PNTFS_IRP_CONTEXT;