From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: dll initialization 6 Nov 1998 09:21:14 -0800 Message-ID: <9811061704.AA09254.cygnus.cygwin32.developers@modi.xraylith.wisc.edu> References: <01BE0956 DOT 952F6020 AT sos> To: Sergey Okhapkin Cc: "'cygwin32-developers AT cygnus DOT com'" Sergey Okhapkin writes: > Mumit Khan wrote: > > Cygwin.dll initialization should be performed in two steps: > > 1. Main initialization (not depend from user_data) performed by dll entry poi > nt. > 2. Initialization depend of user_data, performed by application's starup code > . I assume you already have a patch ;-) The original reason for this patch was to allow non-cygwin apps (such as Java runtime) load cygwin dlls via *LoadLibrary* (I doubt if non-cygwin apps can reliably link against libcygwin.a and load cygwin dll that way). Is there any way to know if the cygwin DLL was loaded, either by import library or via LoadLibrary, from a cygwin main app? At the very least, if we can tell if cygwin DLL was loaded via LoadLibrary from a non-cygwin app, then there's a trivial fix; if a cygwin app loads a cygwin DLL via LoadLibrary, then of course the user_data is already initialized and the dll_dllcrt0 test does do the right thing. Regards, Mumit