This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: problem with fork/exec in Cygwin DLL called from non-Cygwin EXE
- To: cygwin-developers at sourceware dot cygnus dot com
- Subject: Re: problem with fork/exec in Cygwin DLL called from non-Cygwin EXE
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Thu, 2 Mar 2000 13:00:43 -0500
- References: <779F20BCCE5AD31186A50008C75D99791716F2@SILLDN_MAIL1>
- Reply-To: cygwin-developers at sourceware dot cygnus dot com
On Thu, Mar 02, 2000 at 05:45:49PM -0000, Fifer, Eric wrote:
> libref = LoadLibraryExA("lib.dll", NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
> symref = GetProcAddress(libref, "func1");
> func = (void *) symref;
> func();
>
> exit(0);
> }
>
>Any thoughts on what is happening here?
>
>I'm using the Feb-28 snapshot.
Since fork/exec are not aware of LoadLibrary calls, I am surprised that you
would see any success anywhere. dlopen() may work better.
What is happening is that you're doing a fork and the fork code is duplicating
everything it knows about in the paren't address space. It doesn't know about
your use of LoadLibrary so it doesn't duplicate it. Then, the code tries to
jump into func() which doesn't exist.
cgf