PDWORD RelocationTable;
PWORD RelocWord;
LPSTR CmdLinePtr = (LPSTR)CommandLine;
+ BYTE OldStrategy = DosAllocStrategy;
DPRINT1("DosLoadExecutable(%d, %s, %s, %s, 0x%08X, 0x%08X)\n",
LoadType,
/* Make sure it does not pass 0xFFFF */
if (ExeSize > 0xFFFF) ExeSize = 0xFFFF;
+ if (Header->e_minalloc == 0 && Header->e_maxalloc == 0)
+ {
+ /* This program should be loaded high */
+ DosAllocStrategy = DOS_ALLOC_LAST_FIT;
+ }
+
/* Try to allocate that much memory */
Segment = DosAllocateMemory((WORD)ExeSize, &MaxAllocSize);
if (Segment) DosFreeMemory(Segment);
}
+ /* Restore the old allocation strategy */
+ DosAllocStrategy = OldStrategy;
+
/* Unmap the file*/
if (Address != NULL) UnmapViewOfFile(Address);