From 3d8efb5447b644c0d9a0695229f554d504725a75 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Tue, 23 Feb 2016 20:45:11 +0000 Subject: [PATCH] [NTFS] Moar locking Any resemblance to previous commit, living or dead, is purely coincidental svn path=/trunk/; revision=70778 --- reactos/drivers/filesystems/ntfs/close.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reactos/drivers/filesystems/ntfs/close.c b/reactos/drivers/filesystems/ntfs/close.c index 79ef82c9326..008f4530fd8 100644 --- a/reactos/drivers/filesystems/ntfs/close.c +++ b/reactos/drivers/filesystems/ntfs/close.c @@ -101,8 +101,21 @@ NtfsClose(PNTFS_IRP_CONTEXT IrpContext) FileObject = IrpContext->FileObject; DeviceExtension = DeviceObject->DeviceExtension; + if (!ExAcquireResourceExclusiveLite(&DeviceExtension->DirResource, + BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT))) + { + return NtfsMarkIrpContextForQueue(IrpContext); + } + Status = NtfsCloseFile(DeviceExtension, FileObject); + ExReleaseResourceLite(&DeviceExtension->DirResource); + + if (Status == STATUS_PENDING) + { + return NtfsMarkIrpContextForQueue(IrpContext); + } + IrpContext->Irp->IoStatus.Information = 0; return Status; } -- 2.17.1