ChangeLog: * loader/pe_image.c: do_relocations: process relocation blocks with a VirtualAddress of 0, stop once SizeOfBlock == 0. * memory/virtual.c: map_image: map the PE header readonly. Andrew andrew@transgaming.com
Index: loader/pe_image.c =================================================================== RCS file: /home/wine/wine/loader/pe_image.c,v retrieving revision 1.100 diff -u -p -r1.100 pe_image.c --- loader/pe_image.c 2001/10/25 19:52:12 1.100 +++ loader/pe_image.c 2001/11/23 18:43:16 @@ -401,7 +401,7 @@ static int do_relocations( char *base, c if ((nt->OptionalHeader.ImageBase & 0x80000000) && !((DWORD)base & 0x80000000)) ERR( "Forced to relocate system DLL (base > 2GB). This is not good.\n" ); - for ( ; ((char *)rel < base + dir->VirtualAddress + dir->Size) && rel->VirtualAddress; + for ( ; ((char *)rel < base + dir->VirtualAddress + dir->Size) && rel->SizeOfBlock; rel = (IMAGE_BASE_RELOCATION*)((char*)rel + rel->SizeOfBlock)) { char *page = base + rel->VirtualAddress; Index: memory/virtual.c =================================================================== RCS file: /home/wine/wine/memory/virtual.c,v retrieving revision 1.70 diff -u -p -r1.70 virtual.c --- memory/virtual.c 2001/11/06 20:57:23 1.70 +++ memory/virtual.c 2001/11/23 18:43:16 @@ -512,7 +512,7 @@ static LPVOID map_image( HANDLE hmapping /* map the header */ - if (VIRTUAL_mmap( fd, ptr, header_size, 0, 0, PROT_READ | PROT_WRITE, + if (VIRTUAL_mmap( fd, ptr, header_size, 0, 0, PROT_READ, MAP_PRIVATE | MAP_FIXED, &removable ) == (char *)-1) goto error; dos = (IMAGE_DOS_HEADER *)ptr; nt = (IMAGE_NT_HEADERS *)(ptr + dos->e_lfanew);