[MPlayer-dev-eng] Re: [PATCH] [RFC] fix GetModuleHandle(0)

Alan Nisota alannisota at gmail.com
Sun Mar 18 22:23:12 CET 2007


Martin Simmons wrote:
>>>>>> On Sun, 18 Mar 2007 12:20:44 -0700, Alan Nisota said:
>> I am trying to fix GetModuleHanldeA(0) to return the base address of the 
>> calling DLL (in general this should be the base address of the filter 
>> we've loaded.  What I really want is the address returned by 
>> LoadLibraryExA, but I'm not sure how I can get at it from this context. 
> 
> That doesn't sound right to me -- it should return the handle of the main
> executable.
I read MSDN and wasn't sure exactly what 'a handle to the file used to 
create the calling process' meant.  I guess I guessed wrong.

>> applied).  It is obviously wrong, but is a band-aid until I can figure 
>> out the right way to fix this.
> 
> The right way probably depends on what CoreAVC does with the value.
Maybe not much, since feeding it 0x1000000 (which is the address where 
CoreAVC is loaded) works. Perhaps I could create a dummy stub to return 
in this case.  I don't know what is supposed to be in memory at the 
beginning of the file handle though.  Do you know if this is supposed to 
be mapped to a structure?




More information about the MPlayer-dev-eng mailing list