Set a flag in the IRP context when an IRP can wait on locking

svn path=/trunk/; revision=67538
This commit is contained in:
Pierre Schweitzer 2015-05-03 18:17:39 +00:00
parent 344e771eb2
commit 0e1b711195
2 changed files with 12 additions and 0 deletions

View file

@ -88,6 +88,16 @@ NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
IrpContext->MinorFunction = IoStackLocation->MinorFunction;
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 &&
IoIsOperationSynchronous(Irp)))
{
IrpContext->Flags |= IRPCONTEXT_CANWAIT;
}
return IrpContext;
}

View file

@ -391,6 +391,8 @@ typedef struct {
UCHAR Data[1];
} REPARSE_POINT_ATTRIBUTE, *PREPARSE_POINT_ATTRIBUTE;
#define IRPCONTEXT_CANWAIT 0x1
typedef struct
{
NTFSIDENTIFIER Identifier;