From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: dll initialization 4 Nov 1998 23:39:22 -0800 Message-ID: <9811050659.AA06482.cygnus.cygwin32.developers@modi.xraylith.wisc.edu> References: <01BE081F DOT 77F584E0 AT sos> To: Sergey Okhapkin Cc: "'cygwin32-developers AT cygnus DOT com'" Sergey Okhapkin writes: > Hi! > > Wed Oct 28 17:57:53 1998 Geoffrey Noer > > patch from Mumit Khan : > * dll_init.cc (exceptions.h): Include. > (dll_dllcrt0_1): New function to initialize Cygwin DLL guts > properly when a non-Cygwin app uses the Cygwin DLL. > (dll_dllcrt0): Call dll_dllcrt0_1 when user_data is NULL. > > Most X11 applications fails to run with this patch... If the application is > linked with cygwin-compiled dlls, DllMain function of these dlls is called > _before_ user_data is initialized by cygwin1.dll! This case the > initialization of cygwin1.dll performed twice with unpredictable results. I > had to remove this patch to run xterm, rxvt and Xemacs. Sergey, I'm confused as to the circumstances when this is happening. Are the applications non-cygwin? These changes only affect (in theory of course) user DLLs that are *not* cygwin DLLs, but something else (mingw crtdll/msvc or VC++ msvc). Cygwin user DLLs should be specifying __cygwin_entry_dll AT 12 as the entry point which will initialize user_data properly and call user _DllMain AT 12 if any. Could you tell me exactly how the X11 DLLs are being initialized so I can fix any problems that there might be? Regards, Mumit