From 0e1b711195e4f4f6e35227d23769f70920a85240 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 3 May 2015 18:17:39 +0000 Subject: [PATCH] [NTFS] Set a flag in the IRP context when an IRP can wait on locking svn path=/trunk/; revision=67538 --- reactos/drivers/filesystems/ntfs/misc.c | 10 ++++++++++ reactos/drivers/filesystems/ntfs/ntfs.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/reactos/drivers/filesystems/ntfs/misc.c b/reactos/drivers/filesystems/ntfs/misc.c index 128f787f237..071fe1b479b 100644 --- a/reactos/drivers/filesystems/ntfs/misc.c +++ b/reactos/drivers/filesystems/ntfs/misc.c @@ -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; } diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 5efb1e97fef..3f2e55c8e71 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -391,6 +391,8 @@ typedef struct { UCHAR Data[1]; } REPARSE_POINT_ATTRIBUTE, *PREPARSE_POINT_ATTRIBUTE; +#define IRPCONTEXT_CANWAIT 0x1 + typedef struct { NTFSIDENTIFIER Identifier;