[MPlayer-dev-eng] [PATCH] Make GetModuleHandle(NULL) return a valid pointer

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Mar 4 18:33:28 CET 2010


On Thu, Mar 04, 2010 at 05:20:55PM +0100, Steinar H. Gunderson wrote:
> GetModuleHandle(NULL) doesn't actually return a handle in Windows; in
> practice, it returns a pointer to the base of the image mapped into memory.
> (It may be that Windows 7 changes this behavior, though; I've seen
> indications to that but haven't checked myself.) Some codecs expect to
> be able to take this adderss and check for a PE header there; thus, return 
> 0x10000000 instead of 1, which at least has a pretty big chance of containing
> a PE header, given that it's the default DLL load address.

Maybe you could somehow figure out the real load address where we have a proper
PE header or something like that?



More information about the MPlayer-dev-eng mailing list