Eric Pouech eric.pouech@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.