JCL Help:CreateEnvironmentBlock

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Prepares a new environment block for CreateProcAsUserEx


Pascal

 function CreateEnvironmentBlock(const Options: TEnvironmentOptions; const AdditionalVars: TStrings): PChar;


Parameters

Parameters Description
const Options: TEnvironmentOptions Determines whether the global and / or user related environment variables will be included in the result.
const AdditionalVars: TStrings This list contains additional strings for the new environment block. The entries in this list must be name / value pairs (e.g. 'name=value'). You may pass a nil value in this parameter, which makes the function behave exactly as CreateProcAsUser.


Return Value

As the result, you will receive a PChar containing a list of environment variables. This PChar can directly be used with functions like CreateProcAsUserEx.


Description

CreateEnvironmentBlock prepares a process environment block. It is used by CreateProcAsUserEx, which launches a new process with a new environment block. By setting the appropriate options, you can determine whether the function will include the current environment block within the new environment block. Also, you can add a customized set of environment variables by supplying the AdditionalVars parameter.


See Also

CreateProcAsUserEx CreateProcAsUser TEnvironmentOptions


About

Unit

JclSysInfo


Donator

Peter Friese


Notes

The caller is responsible to release the returned PChar when it is no longer needed.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page