RtlSetEnvironmentVariable - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

NTSYSAPI
NTSTATUS
NTAPI
RtlSetEnvironmentVariable(
    _Inout_opt_ PVOID *Environment,
    _In_ PUNICODE_STRING Name,
    _In_opt_ PUNICODE_STRING Value
    );

#endif

View code on GitHub

*Environment

If Environment is NULL, current environment block is used.
If Environment point to NULL value, new environment block is allocated and variable is set in new block.
If you can set variable in not currently set env. block, set as Environment pointer to that block.

Documented by

See also