delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/03/02/14:03:07

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Thu, 2 Mar 2000 13:00:43 -0500
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: problem with fork/exec in Cygwin DLL called from non-Cygwin EXE
Message-ID: <20000302130043.A20207@cygnus.com>
Reply-To: cygwin-developers AT sourceware DOT cygnus DOT com
References: <779F20BCCE5AD31186A50008C75D99791716F2 AT SILLDN_MAIL1>
Mime-Version: 1.0
User-Agent: Mutt/1.1.4i
In-Reply-To: <779F20BCCE5AD31186A50008C75D99791716F2@SILLDN_MAIL1>; from EFifer@sanwaint.com on Thu, Mar 02, 2000 at 05:45:49PM -0000

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

- Raw text -


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