[<<]Message[>>]    [<<]Author[>>]    [<<]Subject        [<<]Thread    

Number : 3836 Date : 2003-02-24 Author : CBFalconer Subject : Re: Errorlevel is not the same as an exit code. Size(KB) : 1
Kan Yabumoto wrote: > ... snip ... > > To my mind, that is the only reason why there is no > documented Win32 API that performs such a function, > > SetParentEnvironmentVariable(). > > If you can help me in the search of such thing > (if it exists at all), I will be more than happy to > pursue this matter much further (and possibly add > a function in XXCOPY to set and manipulate some > environment variable --- but, I remain skeptical > that the technique is sufficiently clean for > incorporation in XXCOPY). It is more fundamental than that. DOS can do it, with a hack (there is a pointer to the parent PSP in the PSP, and each PSP contains a pointer to its environment). But DOS is a single thread system - everything runs to completion. Even here there are many problems, partly because the size of the parents PSP is fixed in stone. The environment is a shell thing, not a system thing, and spare space is truncated whenever anything is launched. In a multi-processing environment, daddy launches proc based on environment; then daddy launches proc2 based on environment. If proc can mess with environment, there is no way you can set up the conditions to launch proc2. Unless you are Microsoft and can afford to ignore race conditions. Think of how a parent process executes: IF (env-condition) then BEGIN execute(prog1); execute(prog2); END ELSE IF (other-env-condition) THEN execute(prog3); ELSE execute(prog4); when prog1 can change env-conditions willy-nilly. That is why the environment is passed by value. -- Chuck F (cbfalconer@y...) (cbfalconer@w...) Available for consulting/temporary embedded and systems. USE worldnet address!
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.