mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 16:41:40 +00:00
[NTFS]
Implement the downward fashion of FSCTL_GET_NTFS_FILE_RECORD and always return a file record which is in use CORE-8725 svn path=/trunk/; revision=65601
This commit is contained in:
parent
7427f826d0
commit
5e1a81a596
1 changed files with 16 additions and 7 deletions
|
@ -626,14 +626,23 @@ GetNtfsFileRecord(PDEVICE_EXTENSION DeviceExt,
|
|||
InputBuffer = (PNTFS_FILE_RECORD_INPUT_BUFFER)Irp->AssociatedIrp.SystemBuffer;
|
||||
|
||||
MFTRecord = InputBuffer->FileReferenceNumber.QuadPart;
|
||||
Status = ReadFileRecord(DeviceExt, MFTRecord, FileRecord);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed reading record: %I64x\n", MFTRecord);
|
||||
ExFreePoolWithTag(FileRecord, TAG_NTFS);
|
||||
return Status;
|
||||
}
|
||||
DPRINT1("Requesting: %I64x\n", MFTRecord);
|
||||
|
||||
do
|
||||
{
|
||||
Status = ReadFileRecord(DeviceExt, MFTRecord, FileRecord);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
if (FileRecord->Flags & FRH_IN_USE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
--MFTRecord;
|
||||
} while (TRUE);
|
||||
|
||||
DPRINT1("Returning: %I64x\n", MFTRecord);
|
||||
OutputBuffer = (PNTFS_FILE_RECORD_OUTPUT_BUFFER)Irp->AssociatedIrp.SystemBuffer;
|
||||
OutputBuffer->FileReferenceNumber.QuadPart = MFTRecord;
|
||||
OutputBuffer->FileRecordLength = DeviceExt->NtfsInfo.BytesPerFileRecord;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue