Group: Process and Thread - Library: kernel32
Retrieves the value of the specified variable from the environment block of the calling process. The value is in the form of a null-terminated string of characters.
Reading and setting Environment variables
DWORD GetEnvironmentVariable(
LPCTSTR lpName, // environment variable name
LPTSTR lpBuffer, // buffer for variable value
DWORD nSize // size of buffer
); DECLARE INTEGER GetEnvironmentVariable IN kernel32;
STRING lpName,;
STRING @ lpBuffer,;
INTEGER nSize lpName [in] Pointer to a null-terminated string that specifies the environment variable.
lpBuffer [out] Pointer to a buffer to receive the value of the specified environment variable.
nSize [in] Specifies the size, in TCHARs, of the buffer pointed to by the lpBuffer parameter.
If the function succeeds, the return value is the number of TCHARs stored into the buffer pointed to by lpBuffer, not including the terminating null character.
Home