Store stack & FO in IRP context

svn path=/trunk/; revision=67539
This commit is contained in:
Pierre Schweitzer 2015-05-03 18:25:55 +00:00
parent 0e1b711195
commit 7a305fc01f
2 changed files with 11 additions and 9 deletions

View 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;

View 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;