From: gvaughan@oranda.demon.co.uk (Gary V. Vaughan)
Subject: Re: another patch for dlopen [was Re: dlopen bug!]
12 Nov 1998 03:37:32 -0800
Message-ID: <36498EFD.A1ACC0BE.cygnus.gnu-win32@oranda.demon.co.uk>
References: <36481BE9.35E38846@uz.kuleuven.ac.be>
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------47931452E055C0A31AA59D4F"
To: Geoffrey Noer <noer@cygnus.com>,
        Jorrit Tyberghein <Jorrit.Tyberghein@uz.kuleuven.ac.be>,
        gnu-win32@cygnus.com

This is a multi-part message in MIME format.
--------------47931452E055C0A31AA59D4F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

"Gary V. Vaughan" wrote:
> 
> A fix is attached.  This is in addition to the previous patch (and
> the patch from Christian Jullien).
> 
> I forgot to post a ChangeLog entry yesterday, so I have included both
> here, and another for Christian's dlsym patch which is attached too.


Oops!  It seems I posted Christian's patch directly, which isn't quite
right... the real one is attached below.

Cheers,
	Gary.
--------------47931452E055C0A31AA59D4F
Content-Type: text/plain; charset=us-ascii;
 name="dlsym-cj-19981110"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dlsym-cj-19981110"

--- dlfcn.cc.orig	Tue Nov 10 11:58:45 1998
+++ dlfcn.cc	Wed Nov 11 13:15:54 1998
@@ -139,7 +153,12 @@ dlopen (const char *name, int)
 void *
 dlsym (void *handle, const char *name)
 {
-  void *ret = (void *) GetProcAddress (handle, name);
+  void * ret = 0;
+
+  if( handle )
+        ret = (void *) GetProcAddress (handle, name);
+  else  ret = (void *) GetProcAddress (GetModuleHandle(0), name);
+
   if (!ret)
     set_dl_error ("dlsym");
   debug_printf ("ret %p", ret);

--------------47931452E055C0A31AA59D4F--

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
