#ifndef _NTRTL_H
//
// Environment
//
/**
* The RtlCreateEnvironment routine creates a new environment block, optionally cloning the current process environment.
*
* \param CloneCurrentEnvironment TRUE to clone the current environment; FALSE to create an empty one.
* \param Environment Receives the newly created environment block.
* \return NTSTATUS Successful or errant status.
* \remarks Creates/destroys a separately owned environment allocation. CreateEnvironment(FALSE) creates an empty block rather than copying the process environment. Ex flags and source encoding determine cloning behavior. Do not free a live process environment or borrow its pointer and treat it as a private allocation.
*/
NTSYSAPI
NTSTATUS
NTAPI
RtlCreateEnvironment(
_In_ BOOLEAN CloneCurrentEnvironment,
_Out_ PVOID *Environment
);
View code on GitHubNo description available.
If set, newly created environment are similar to caller's environment.
RtlCreateEnvironment allocate memory in caller's address space, and fills it with new environment block. Environment is pointer to this block.