Commit 60f0c1b3 authored by Alexandre Julliard's avatar Alexandre Julliard

imagehlp: Use the IMAGE_FIRST_SECTION helper macro.

parent 0ee4bec9
......@@ -188,9 +188,7 @@ BOOL WINAPI MapAndLoad(PCSTR pszImageName, PCSTR pszDllPath, PLOADED_IMAGE pLoad
pLoadedImage->hFile = hFile;
pLoadedImage->MappedAddress = mapping;
pLoadedImage->FileHeader = pNtHeader;
pLoadedImage->Sections = (PIMAGE_SECTION_HEADER)
((LPBYTE) &pNtHeader->OptionalHeader +
pNtHeader->FileHeader.SizeOfOptionalHeader);
pLoadedImage->Sections = IMAGE_FIRST_SECTION(pNtHeader);
pLoadedImage->NumberOfSections = pNtHeader->FileHeader.NumberOfSections;
pLoadedImage->SizeOfImage = GetFileSize(hFile, NULL);
pLoadedImage->Characteristics = pNtHeader->FileHeader.Characteristics;
......
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