[NTVDM]: Fix the fix of r67238 (inversion min/max).
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 18 Apr 2015 15:38:51 +0000 (15:38 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 18 Apr 2015 15:38:51 +0000 (15:38 +0000)
svn path=/trunk/; revision=67261

reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c

index 079499c..f415de1 100644 (file)
@@ -1910,7 +1910,7 @@ VOID NTAPI VgaReadMemory(ULONG Address, PVOID Buffer, ULONG Size)
     PUCHAR BufPtr = (PUCHAR)Buffer;
 
     DPRINT("VgaReadMemory: Address 0x%08X, Size %lu\n", Address, Size);
-    Address = min(max(Address, VgaGetVideoLimitAddress() - 1), VgaGetVideoBaseAddress());
+    Address = min(max(Address, VgaGetVideoBaseAddress()), VgaGetVideoLimitAddress());
     Size = min(Size, VgaGetVideoLimitAddress() - Address + 1);
 
     /* Ignore if video RAM access is disabled */
@@ -1939,7 +1939,7 @@ BOOLEAN NTAPI VgaWriteMemory(ULONG Address, PVOID Buffer, ULONG Size)
     PUCHAR BufPtr = (PUCHAR)Buffer;
 
     DPRINT("VgaWriteMemory: Address 0x%08X, Size %lu\n", Address, Size);
-    Address = min(max(Address, VgaGetVideoLimitAddress() - 1), VgaGetVideoBaseAddress());
+    Address = min(max(Address, VgaGetVideoBaseAddress()), VgaGetVideoLimitAddress());
     Size = min(Size, VgaGetVideoLimitAddress() - Address + 1);
 
     /* Ignore if video RAM access is disabled */