Author: aandrejevic Date: Thu May 7 00:36:14 2015 New Revision: 67587
URL: http://svn.reactos.org/svn/reactos?rev=67587&view=rev Log: [NTVDM] Fix the calculation of the executable's base size.
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] Thu May 7 00:36:14 2015 @@ -409,7 +409,8 @@ Header = (PIMAGE_DOS_HEADER)Address;
/* Get the base size of the file, in paragraphs (rounded up) */ - BaseSize = (((Header->e_cp - 1) * 512) + Header->e_cblp + 0x0F) >> 4; + BaseSize = (((Header->e_cp - (Header->e_cblp != 0)) * 512) + + Header->e_cblp - Header->e_cparhdr + 0x0F) >> 4;
if (LoadType != DOS_LOAD_OVERLAY) {