Environment passing

Chris Morgan cmorgan at alum.wpi.edu
Mon Oct 7 22:50:32 CDT 2002

I've been looking into exactly what is broken with environment passing in 
CreateProcess() and the functions it uses.  What appears to be breaking 
things at this point is just what Eric mentioned, that we mess with the PATH 
environment variable inside of fork_and_exec() and then we call out to 
execve() with this modified environment.  It appears that we really do need 
to mess with the PATH environment variable to ensure that execve() finds 
things in the correct unix path locations.  I was thinking that before we 
execve() that we could copy the current PATH into a variable called __PATH.  
We would then restore PATH in PROCESS_InitWine() from this __PATH.  Any 
thoughts or other ideas on how to solve the environment passing problem, 
maybe passing the data via wineserver?


> > From: "Eric POUECH" <Eric.Pouech at wanadoo.fr>
> > Date: 2002/09/24 Tue PM 04:48:24 EDT
> > To: <cmorgan at alum.wpi.edu>,  <wine-devel at winehq.com>
> > Subject: Re: another MZ_Exec() problem...
> >
> > > Inside of MZ_Exec() I call out to CreateProcessA() if the executable is
> > > PE.  I've set the lpEnvironment parameter of CreateProcessA() to null
> > > to have it inherit the environment of the caller but this isn't working
> > > correctly.  The path and other environment variables aren't being
> > > inherited.  Ideas on how to either get CreateProcessA() to inherit
> > > properly or where I can find the environment settings?  I noticed the
> > > env_ptr in the parmeter block but I'm unsure if this is what I'm
> > > looking for or where to find more information about it.
> >
> > moreover, explicit env heritage (ie passed in CreateProcess) is currently
> > bugged A+

More information about the wine-devel mailing list