RTLD_DEFAULT & RTLD_NEXT

Corinna Vinschen vinschen@redhat.com
Tue Sep 14 08:30:00 GMT 2004


Hi Sam,

thanks for the patch.  There are still a couple of problems, which
I solved manually for now.

On Sep  7 16:52, Sam Steingold wrote:
> the (C) assignment is in the mail.
> 
> 2004-08-31  Sam Steingold  <sds@gnu.org>
> 
> 	* dlfcn.cc (dlsym): Handle RTLD_DEFAULT using EnumProcessModules().
> 	* include/dlfcn.h (RTLD_DEFAULT): Define to NULL.

The autoload.cc change is missing in the ChangeLog.

Compiling dlfcn.cc failed(!) because the compiler couln't find a definition
for EnumProcessModules.  Including psapi.h was missing, apparently.

Then you're a bit thrifty with spaces...

> +      if (!EnumProcessModules(cur_proc,NULL,0,&needed))
         if (!EnumProcessModules (cur_proc, NULL, 0, &needed))

> +      modules = (HMODULE*)alloca(needed);
         modules = (HMODULE *) alloca (needed);

> +      for (i=0; i < needed/sizeof(HMODULE); i++)
         for (i = 0; i < needed / sizeof (HMODULE); i++)
etc.

>  LoadDLLfunc (DuplicateToken, 12, advapi32)
>  LoadDLLfuncEx (DuplicateTokenEx, 24, advapi32, 1)
> +LoadDLLfuncEx (EnumProcessModules, 16, psapi, 1)

The definition of EnumProcessModules should go where the definitions
of psapi modules are.  As mentioned in my previous posting, the autoload
list is sorted by libraries.


Otherwise the patch looks ok.  Applied with the above changes.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-patches mailing list