delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/06/23/06:47:02

From: michal AT dkslwz DOT cr DOT usgs DOT gov (Michal Kouril)
Subject: EXE(non-cygn)->DLL(cygn)->cygwinb19.dll
23 Jun 1998 06:47:02 -0700 :
Message-ID: <358FAF23.AB310B76.cygnus.cygwin32.developers@ais6dkslwr.cr.usgs.gov>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

Hey,

Problem:
I have application that calls my DLL compiled using gnu-win32.
My Dll tries to use functions from cygwinb19 but dll_crt0_1 function was
not called by exe (I can't recompile exe).
So I have to call dll_crt0_1 in my DLL. It does not work because
in the end of dll_crt0_1 is exit and it exists the whole cygwinb19.dll.

Solution:
I suggest to put the following condition in the end of dll_crt0_1.

dll_crt0_1 (per_process *uptr)
....
if (u->main)
   exit (u->main (argc, argv, *u->envptr));
}

Then in my dll it's possible to initialize cygwin dll like this.

  case DLL_PROCESS_ATTACH:
	cygwin_crt0(NULL);


bye,

michal

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019