mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 10:23:22 +00:00
[NTVDM]
Fill the part of the buffer that was supposed to receive memory data above the MAX_ADDRESS with 0xFF. svn path=/trunk/; revision=67707
This commit is contained in:
parent
41b8d0a78c
commit
365727d3e7
|
@ -73,8 +73,16 @@ VOID WINAPI EmulatorReadMemory(PFAST486_STATE State, ULONG Address, PVOID Buffer
|
||||||
/* If the A20 line is disabled, mask bit 20 */
|
/* If the A20 line is disabled, mask bit 20 */
|
||||||
if (!A20Line) Address &= ~(1 << 20);
|
if (!A20Line) Address &= ~(1 << 20);
|
||||||
|
|
||||||
if (Address >= MAX_ADDRESS) return;
|
if ((Address + Size - 1) >= MAX_ADDRESS)
|
||||||
Size = min(Size, MAX_ADDRESS - Address);
|
{
|
||||||
|
ULONG ExtraStart = (Address < MAX_ADDRESS) ? MAX_ADDRESS - Address : 0;
|
||||||
|
|
||||||
|
/* Fill the memory that was above the limit with 0xFF */
|
||||||
|
RtlFillMemory((PVOID)((ULONG_PTR)Buffer + ExtraStart), Size - ExtraStart, 0xFF);
|
||||||
|
|
||||||
|
if (Address < MAX_ADDRESS) Size = MAX_ADDRESS - Address;
|
||||||
|
else return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Read while calling fast memory hooks */
|
/* Read while calling fast memory hooks */
|
||||||
MemRead(Address, Buffer, Size);
|
MemRead(Address, Buffer, Size);
|
||||||
|
|
Loading…
Reference in a new issue