This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

DLL initialization problem



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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]