[NTOSKRNL]

While attempting to read data from disk in CcReadVirtualAddress(), always align our read size by pages.
That means that even on boundaries, we will read a complete page.
This fixes FSD relying on Cc to properly align reads and thus poorly failing in disk.sys because of unaligned reads.
Notably, it helps MS FastFAT loading a bit farther in ReactOS (but it still fails :-().
This also fixes a few kmtests.

CORE-11003
CORE-11819

svn path=/trunk/; revision=72186
This commit is contained in:
Pierre Schweitzer 2016-08-10 11:52:30 +00:00
parent 57888376d9
commit e3b0a95319

View file

@ -65,7 +65,7 @@ NTAPI
CcReadVirtualAddress (
PROS_VACB Vacb)
{
ULONG Size;
ULONG Size, Pages;
PMDL Mdl;
NTSTATUS Status;
IO_STATUS_BLOCK IoStatus;
@ -77,7 +77,10 @@ CcReadVirtualAddress (
Size = VACB_MAPPING_GRANULARITY;
}
Mdl = IoAllocateMdl(Vacb->BaseAddress, Size, FALSE, FALSE, NULL);
Pages = BYTES_TO_PAGES(Size);
ASSERT(Pages * PAGE_SIZE <= VACB_MAPPING_GRANULARITY);
Mdl = IoAllocateMdl(Vacb->BaseAddress, Pages * PAGE_SIZE, FALSE, FALSE, NULL);
if (!Mdl)
{
return STATUS_INSUFFICIENT_RESOURCES;