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

Steinar H. Gunderson sgunderson at bigfoot.com
Thu Mar 4 17:20:55 CET 2010


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.

/* Steinar */
-- 
Homepage: http://www.sesse.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getmodulehandle-base-address.diff
Type: text/x-diff
Size: 301 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100304/984e3ec3/attachment.diff>


More information about the MPlayer-dev-eng mailing list