Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: Klemen Zagar Date: Wed, 21 Jun 2000 08:42:28 GMT Message-ID: <20000621.8422849@mis.configured.host> Subject: DLL initialization problem To: cygwin AT sourceware DOT cygnus DOT com X-Mailer: Mozilla/3.0 (compatible; StarOffice/5.1; Win32) X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id EAA31945 I am trying to build a DLL with cygwin gcc that would work with non-cygwin executables (e.g., those built with Inprise Delphi). I presume that I have to somehow initialize the cygwin DLL before using memory allocation and I/O functions from my DLL, but I do not know how to do that. Here's what I've tried so far: - With May 2000 version of cygwin1.dll, I've put a call to cygwin_crt0(main function = NULL) in the DLL's entry point. Everything blocked when the DLL was loaded. - With May 2000 version of cygwin1.dll, I've put a call to cygwin_attach_dll(handle, main = NULL) in DLL's entry point. Malloc crashed anyway as if I hadn't done that. - With June 2000 version of cygwin1.dll I've put a call to cygwin_dll_init() in DLL's entry point. Everything blocked when the DLL was loaded. Here is how the last DLL entry point looks like: __attribute__((stdcall)) int dll_entry(int handle, int reason, void *ptr) { if(reason == DLL_PROCESS_ATTACH) { cygwin_dll_init(); // ...doesn't return... } return 1; } So... what is the right way to initialize the cygwin DLL (before I try out all its functions) :-) Regards and thank you in advance, Klemen. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com