[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 25 Feb 2016 20:49:31 +0000 (20:49 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 25 Feb 2016 20:49:31 +0000 (20:49 +0000)
Add a missing lock

svn path=/trunk/; revision=70787

reactos/drivers/filesystems/ntfs/dirctl.c

index c19bf6b..82b8a7c 100644 (file)
@@ -363,6 +363,13 @@ NtfsQueryDirectory(PNTFS_IRP_CONTEXT IrpContext)
 
     DPRINT("Buffer=%p tofind=%S\n", Buffer, Ccb->DirectorySearchPattern);
 
+    if (!ExAcquireResourceExclusiveLite(&DeviceExtension->DirResource,
+                                        BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
+    {
+        ExReleaseResourceLite(&Fcb->MainResource);
+        return STATUS_PENDING;
+    }
+
     while (Status == STATUS_SUCCESS && BufferLength > 0)
     {
         Status = NtfsFindFileAt(DeviceExtension,
@@ -469,6 +476,7 @@ NtfsQueryDirectory(PNTFS_IRP_CONTEXT IrpContext)
         Buffer0->NextEntryOffset = 0;
     }
 
+    ExReleaseResourceLite(&DeviceExtension->DirResource);
     ExReleaseResourceLite(&Fcb->MainResource);
 
     if (FileIndex > 0)