[NTOS]: C Pointer Math will bite even the most experienced programmer in the ass. Fix wrong calculation which led to ASSERTs and memory corruption (since the last revision).

svn path=/trunk/; revision=49208
This commit is contained in:
Sir Richard 2010-10-19 17:39:22 +00:00
parent 3e8034d4a5
commit ef6bc56d6f

View file

@ -843,7 +843,7 @@ MI_GET_PROTOTYPE_PTE_FOR_VPN(IN PMMVAD Vad,
PMMPTE ProtoPte;
/* Find the offset within the VAD's prototype PTEs */
ProtoPte = Vad->FirstPrototypePte + ((Vpn - Vad->StartingVpn) * sizeof(MMPTE));
ProtoPte = Vad->FirstPrototypePte + (Vpn - Vad->StartingVpn);
ASSERT(ProtoPte <= Vad->LastContiguousPte);
return ProtoPte;
}