Don't attempt to read a sparse run of the disk.

Patch by Trevor Thompson

CORE-10998

svn path=/trunk/; revision=71159
This commit is contained in:
Pierre Schweitzer 2016-04-14 20:39:55 +00:00
parent db73e15d85
commit 82c9e05743

View file

@ -243,13 +243,19 @@ ReadAttribute(PDEVICE_EXTENSION Vcb,
ReadLength = (ULONG)min(DataRunLength * Vcb->NtfsInfo.BytesPerCluster - (Offset - CurrentOffset), Length); ReadLength = (ULONG)min(DataRunLength * Vcb->NtfsInfo.BytesPerCluster - (Offset - CurrentOffset), Length);
if (DataRunStartLCN == -1) if (DataRunStartLCN == -1)
{
RtlZeroMemory(Buffer, ReadLength); RtlZeroMemory(Buffer, ReadLength);
Status = NtfsReadDisk(Vcb->StorageDevice, Status = STATUS_SUCCESS;
DataRunStartLCN * Vcb->NtfsInfo.BytesPerCluster + Offset - CurrentOffset, }
ReadLength, else
Vcb->NtfsInfo.BytesPerSector, {
(PVOID)Buffer, Status = NtfsReadDisk(Vcb->StorageDevice,
FALSE); DataRunStartLCN * Vcb->NtfsInfo.BytesPerCluster + Offset - CurrentOffset,
ReadLength,
Vcb->NtfsInfo.BytesPerSector,
(PVOID)Buffer,
FALSE);
}
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
Length -= ReadLength; Length -= ReadLength;