From 0799e8403b1b74371fc27bff07adc96598cdd120 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 15 Sep 2005 15:09:12 +0000 Subject: [PATCH] Use the NT descriptor address as start of the data section, since the BaseOfData field isn't present in Win64. --- libs/wine/loader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/wine/loader.c b/libs/wine/loader.c index 42703a69cf9..ea264044887 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -289,17 +289,19 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) *nt = *nt_descr; code_start = page_size; - data_start = ((BYTE *)nt->OptionalHeader.BaseOfData - addr) & ~page_mask; + data_start = ((BYTE *)nt_descr - addr) & ~page_mask; data_end = (((BYTE *)nt->OptionalHeader.SizeOfImage - addr) + page_mask) & ~page_mask; nt->FileHeader.NumberOfSections = nb_sections; nt->OptionalHeader.BaseOfCode = code_start; +#ifndef _WIN64 nt->OptionalHeader.BaseOfData = data_start; +#endif nt->OptionalHeader.SizeOfCode = data_start - code_start; nt->OptionalHeader.SizeOfInitializedData = data_end - data_start; nt->OptionalHeader.SizeOfUninitializedData = 0; nt->OptionalHeader.SizeOfImage = data_end; - nt->OptionalHeader.ImageBase = (DWORD)addr; + nt->OptionalHeader.ImageBase = (ULONG_PTR)addr; fixup_rva_ptrs( &nt->OptionalHeader.AddressOfEntryPoint, addr, 1 );