pEnv (PSZ) - input

      Address of the ASCIIZ environment strings passed to the program.

      These strings represent environment variables and their current values. An environment string has the following form:

      variable=value
      
      
      The last ASCIIZ environment string must be followed by an additional byte of zeros.

      A value of 0 for the address of pEnv results in the new process' inheriting the environment of its parent process.

      When the new process is given control, it receives:

      • A pointer to its environment segment
      • The fully qualified file specification of the executable file
      • A copy of the argument strings.
      A coded example of this follows:
      eo:   ASCIIZ string 1  ; environment string 1
            ASCIIZ string 2  ; environment string 2
      .
      .
      .
            ASCIIZ string n  ; environment string n
            Byte of 0
      .
      .
      .
      po:   ASCIIZ           ; string of file name
                             ; of program to run.
      .
      .
      .
      ao:   ASCIIZ           ; argument string 1
                             ; (name of program being started
                             ; for the case of CMD.EXE)
            ASCIIZ           ; argument string 2
                             ; (program parameters following
                             ; program name for the case of
                             ; CMD.EXE)
            Byte of 0
      
      
      The beginning of the environment segment is "eo", and "ao" is the offset of the first argument string in that segment. The offset to the command line, "ao", is passed to the program on the stack at SS:[ESP+16].

      The environment strings typically have the form: parameter = value

      A value of zero for pEnv causes the newly created process to inherit the parent's environment unchanged.


    [Back] [Next]