imagehlp: Use the IMAGE_FIRST_SECTION helper macro.
This commit is contained in:
parent
0ee4bec912
commit
60f0c1b30f
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue