NtfsMoonWalkID():
- Do not allow opening a file by ID if it's not in use any longer
- Do not attempt to create the full path, if an error occured during walk

svn path=/trunk/; revision=66265
This commit is contained in:
Pierre Schweitzer 2015-02-14 15:41:44 +00:00
parent 483c6f32a5
commit 4490614032

View file

@ -116,6 +116,11 @@ NtfsMoonWalkID(PDEVICE_EXTENSION DeviceExt,
break;
ASSERT(MftRecord->Ntfs.Type == NRH_FILE_TYPE);
if (!(MftRecord->Flags & FRH_IN_USE))
{
Status = STATUS_OBJECT_PATH_NOT_FOUND;
break;
}
FileName = GetBestFileNameFromRecord(MftRecord);
WritePosition -= FileName->NameLength;
@ -132,6 +137,9 @@ NtfsMoonWalkID(PDEVICE_EXTENSION DeviceExt,
ExFreePoolWithTag(MftRecord, TAG_NTFS);
if (!NT_SUCCESS(Status))
return Status;
OutPath->Length = (MAX_PATH - WritePosition - 1) * sizeof(WCHAR);
OutPath->MaximumLength = (MAX_PATH - WritePosition) * sizeof(WCHAR);
OutPath->Buffer = ExAllocatePoolWithTag(NonPagedPool, OutPath->MaximumLength, TAG_NTFS);