Update NTOSKRNL/CC/ccpinsupport.cpp

Loop was prematurely terminating  due to wrong condition 
of if(BeyondLastByte.QuadPart < LocalFileOffset.QuadPart + RemainingLength)
we are mapping across the length, 
itroduced some guard checks 
if(localbcb != nullptr)
   {
    CcSetDirtyPinnedData(localbcb, nullptr);
    *Bcb = localbcb;
   }  to fix some test case where it was failing
This commit is contained in:
Dibyamartanda Samanta 2024-08-07 15:28:55 +02:00 committed by CodingWorkshop Signing Team
parent 10527bf405
commit 47bfb48ebb
Signed by: CodingWorkshop Signing Team
GPG Key ID: 6DC88369C82795D2

View File

@ -795,7 +795,7 @@ CcPreparePinWrite(
} }
return false; return false;
} }
if(BeyondLastByte.QuadPart < LocalFileOffset.QuadPart + RemainingLength) if(BeyondLastByte.QuadPart > LocalFileOffset.QuadPart + RemainingLength)
break; break;
} }
@ -810,8 +810,11 @@ CcPreparePinWrite(
RtlZeroMemory(*Buffer, Length); RtlZeroMemory(*Buffer, Length);
} }
if(localbcb != nullptr)
{
CcSetDirtyPinnedData(localbcb, nullptr); CcSetDirtyPinnedData(localbcb, nullptr);
*Bcb = localbcb; *Bcb = localbcb;
}
return true; return true;
} }