Commit bc524e92 authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid loading programs into the DOS memory area.

parent a4771071
...@@ -395,10 +395,11 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f ...@@ -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",
filename, nt->OptionalHeader.ImageBase,
(nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)? (nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)?
"stripped during link" : "unknown reason" ); "relocation records are stripped" : "no relocation records present" );
return 0; return 0;
} }
...@@ -822,4 +823,3 @@ void PE_InitTls( void ) ...@@ -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, ...@@ -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)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment