mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:21:38 +00:00
[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:
parent
57888376d9
commit
e3b0a95319
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue