Author: aandrejevic
Date: Sun Dec 15 05:02:59 2013
New Revision: 61275
URL: 
http://svn.reactos.org/svn/reactos?rev=61275&view=rev
Log:
[FAST486]
Fix the calculation of PageLength for the last page.
Modified:
    branches/ntvdm/lib/fast486/common.inl
Modified: branches/ntvdm/lib/fast486/common.inl
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.inl?re…
==============================================================================
--- branches/ntvdm/lib/fast486/common.inl       [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/common.inl       [iso-8859-1] Sun Dec 15 05:02:59 2013
@@ -160,7 +160,7 @@
             if (Page == PAGE_ALIGN(LinearAddress + Size - 1))
             {
                 /* Read only a part of the page */
-                PageLength = PAGE_OFFSET(LinearAddress) + Size - PageOffset;
+                PageLength = PAGE_OFFSET(LinearAddress + Size - 1) - PageOffset + 1;
             }
             /* Read the memory */
@@ -228,7 +228,7 @@
             if (Page == PAGE_ALIGN(LinearAddress + Size - 1))
             {
                 /* Write only a part of the page */
-                PageLength = PAGE_OFFSET(LinearAddress) + Size - PageOffset;
+                PageLength = PAGE_OFFSET(LinearAddress + Size - 1) - PageOffset + 1;
             }
             /* Write the memory */