[MPlayer-dev-eng] [PATCH] fix for crt8 init dll
Gianluigi Tiesi
mplayer at netfarm.it
Tue Feb 2 22:35:02 CET 2010
On Tue, Feb 02, 2010 at 08:16:36PM +0100, Reimar D?ffinger wrote:
> On Tue, Feb 02, 2010 at 12:16:30AM +0100, Gianluigi Tiesi wrote:
> > msvcrt static linked dll and newer are making a check for "mixed crt" (posix)
> > executables, this implies a GetModuleHandle on the main exe
> > and a check for a section named .mixcrt
> >
> > The attached patch fixes it by providing a minimal struct
> > needed to the crt init function, and fakes the section
> > .mixcrt so the crt avoid using Encode/Decode Pointers
>
> Could you also explain why you want that? :-)
> Is there some broken codec that ends up using the static
> linked MSVCRT for half the encode/decode and our stubs
> for the other half or something like that (how would that
> happen?)?
the crt8 (and above) will execute that code if compiled statically
so every codec compiled with statically linked crt will crash,
using .mixcrt will avoid some encodepointer/decodepointer call
but it's not mandatory, a section and section count 1 (or even 0)
is enough
>
> > if(!name)
> > -#ifdef QTX
> > - result=1;
> > -#else
> > - result=0;
> > -#endif
> > + result=(HMODULE)&mp_exe.doshdr;
I think some code will asks for GetModuleHandle(NULL) != 0
the mp_exe struct should be ok
Regards
--
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
More information about the MPlayer-dev-eng
mailing list