SetEnvironmentVariable

E724278

SetEnvironmentVariable is a Windows API function that allows programs to create, modify, or delete environment variables for the current process or user session.

All labels observed (3)

How this entity was disambiguated

Statements (47)

Predicate Object
instanceOf Windows API function
affectsScope current process
belongsToLibrary Kernel32.dll
linked to: Kernel32
callingConvention stdcall
canCreate environment variable
canDelete environment variable
canModify environment variable
createsOrUpdatesVariableWhen lpValue is non-NULL
definedIn WinBase.h
Windows API
linked to: Win32 API
deletesVariableWhen lpValue is NULL
documentationSite Microsoft Learn
doesNotPropagateTo already-running processes
errorInfoRetrievedWith GetLastError
exportedBy Kernel32.dll
linked to: Kernel32
failsWhen lpName contains '=' character
lpName is NULL
lpName is empty string
hasAnsiVariant SetEnvironmentVariableA
hasParameter LPCSTR lpName
LPCSTR lpValue
LPCWSTR lpName
LPCWSTR lpValue
hasReturnType BOOL
hasUnicodeVariant SetEnvironmentVariableW
header WinBase.h
Windows.h
linked to: Windows SDK
introducedFor manipulating environment variables
isUsedFor configuring child processes
setting application-specific environment variables
temporarily overriding system environment variables
library Kernel32.lib
linked to: Kernel32
minimumSupportedClient Windows 2000 Professional
linked to: Windows 2000
minimumSupportedServer Windows 2000 Server
linked to: Windows 2000
modifies process environment block
namespace global C API
platform Win32
linked to: Win32 API

Win64
relatedFunction FreeEnvironmentStrings
GetEnvironmentStrings
GetEnvironmentVariable
returnsNonzeroOn success
returnsZeroOn failure
runsOn Microsoft Windows
linked to: Windows
supportsCharacterEncoding ANSI
Unicode
threadSafety not guaranteed for concurrent modifications of same variable

How these facts were elicited

Referenced by (3)

Full triples — surface form annotated when it differs from this entity's canonical label.

Kernel32 exportsFunction SetEnvironmentVariable
SetEnvironmentVariable hasAnsiVariant SetEnvironmentVariableA
linked to: SetEnvironmentVariable
SetEnvironmentVariable hasUnicodeVariant SetEnvironmentVariableW
linked to: SetEnvironmentVariable