delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/27/19:02:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <372642B7.2E20428B@bgs.com>
Date: Tue, 27 Apr 1999 19:05:27 -0400
From: Eugene Kanter <eugene AT bgs DOT com>
X-Mailer: Mozilla 4.51 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: putenv does not put env into win32?
References: <19990427215855 DOT 20970 DOT rocketmail AT web120 DOT yahoomail DOT com>

Earnie Boyd wrote:
> 
> --- Eugene Kanter <eugene AT bgs DOT com> wrote:
> > Earnie Boyd wrote:
> > >
> > > --- Eugene Kanter <eugene AT bgs DOT com> wrote:
> > > > Any ideas of how to call Win32 versions of getenv/_putenv instead of
> > > > cygwin ones?
> > >
> > > Use the mingw32 package.  For more info read the docs and search the
> > archives.
> >
> > I can not use mingw32 package because the rest of the application (RPM)
> > requires cygwin. I just scanned archives and FAQ and have not noticed
> > any mentions of putenv limitations.
> >
> 
> Ok.  But I don't think you can do what you want to anyway.  The putenv function
> only modifies the environment of the current process not the parent.  Also,
> you're using LoadLibrary which in the documentation is said not to be used; but
> to use dlopen, etc. instead.  I'm not experienced enough at this to help beyond
> these pointers.

I did not find where it says to use dlopen. I replaced LoadLibrary with
dlopen and received the identical results. The advantage of using dlopen
over LoadLibrary is that I did not have to convert Unix path to Windows
path. I did not look at the actuall cygwin code (where?). I guess dlopen
calls LoadLibrary eventually. However I must call CoFreeLibrary() at the
end (OLE requires) so I guess I must use LoadLibrary.

Still in magic why mingw32 application allows me to change PATH so all
DLLs could be loaded and cygwin does not. You mentinoed that putenv
modifies only current process environment. Which process does the dll
loader belongs to?

I solved the problem eventually by doing chdir(). However what if more
then one directory is required to be added to the path??

Eugene.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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