Acquire FCB resource (shared) before trying to attempt its data

svn path=/trunk/; revision=67910
This commit is contained in:
Pierre Schweitzer 2015-05-25 17:06:00 +00:00
parent c28fc5a816
commit 94d99f3fe3

View file

@ -246,6 +246,12 @@ NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext)
SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
BufferLength = Stack->Parameters.QueryFile.Length;
if (!ExAcquireResourceSharedLite(&Fcb->MainResource,
(BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
{
return NtfsMarkIrpContextForQueue(IrpContext);
}
switch (FileInformationClass)
{
case FileStandardInformation:
@ -301,6 +307,8 @@ NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext)
Status = STATUS_INVALID_PARAMETER;
}
ExReleaseResourceLite(&Fcb->MainResource);
if (NT_SUCCESS(Status))
Irp->IoStatus.Information =
Stack->Parameters.QueryFile.Length - BufferLength;