forked from Mirrors/wine-wine
Avoid loading programs into the DOS memory area.
parent
a47710717b
commit
bc524e92d2
|
@ -395,10 +395,11 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f
|
||||||
{
|
{
|
||||||
if (nt->OptionalHeader.ImageBase == 0x400000)
|
if (nt->OptionalHeader.ImageBase == 0x400000)
|
||||||
ERR("Standard load address for a Win32 program (0x00400000) not available - security-patched kernel ?\n");
|
ERR("Standard load address for a Win32 program (0x00400000) not available - security-patched kernel ?\n");
|
||||||
ERR( "FATAL: Need to relocate %s, but no relocation records present (%s). Try to run that file directly !\n",
|
else
|
||||||
filename,
|
ERR( "FATAL: Need to relocate %s from addr %p, but %s\n",
|
||||||
(nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)?
|
filename, nt->OptionalHeader.ImageBase,
|
||||||
"stripped during link" : "unknown reason" );
|
(nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)?
|
||||||
|
"relocation records are stripped" : "no relocation records present" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,4 +823,3 @@ void PE_InitTls( void )
|
||||||
TlsSetValue( wm->tlsindex, mem );
|
TlsSetValue( wm->tlsindex, mem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -513,6 +513,7 @@ static LPVOID map_image( HANDLE hmapping, int fd, char *base, DWORD total_size,
|
||||||
|
|
||||||
/* zero-map the whole range */
|
/* zero-map the whole range */
|
||||||
|
|
||||||
|
if (base < (char *)0x110000) base = 0; /* make sure the DOS area remains free */
|
||||||
if ((ptr = wine_anon_mmap( base, total_size,
|
if ((ptr = wine_anon_mmap( base, total_size,
|
||||||
PROT_READ | PROT_WRITE | PROT_EXEC, 0 )) == (char *)-1)
|
PROT_READ | PROT_WRITE | PROT_EXEC, 0 )) == (char *)-1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue