Re: [PATCH] [ImageHlp]: MapAndLoad
Eric Pouech <eric.pouech(a)wanadoo.fr> writes:
@@ -199,7 +204,10 @@ BOOL WINAPI MapAndLoad(LPSTR pszImageNam ((LPBYTE) &pNtHeader->OptionalHeader + pNtHeader->FileHeader.SizeOfOptionalHeader); pLoadedImage->NumberOfSections =3D pNtHeader->FileHeader.NumberOfSec= tions; - pLoadedImage->SizeOfImage =3D pNtHeader->OptionalHeader.SizeOfI= mage; + /* we need to return the size of image which has been mapped */ + pLoadedImage->SizeOfImage =3D pNtHeader->OptionalHeader.SizeOfH= eaders; + for (i =3D 0; i < pLoadedImage->NumberOfSections; i++) + pLoadedImage->SizeOfImage +=3D pLoadedImage->Sections[i].SizeOf= RawData;
There's no reason that the SizeOfRawData fields would add up to the size of the mapping. You have to use GetFileSize() if you need the true size. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard