Platform SDK: DLLs, Processes, and Threads

GetEnvironmentStrings

The GetEnvironmentStrings function retrieves the environment block for the current process.

LPVOID GetEnvironmentStrings(VOID);

Parameters

This function has no parameters.

Return Values

The return value is a pointer to an environment block for the current process.

Remarks

The GetEnvironmentStrings function returns a pointer to the environment block of the calling process. This should be treated as a read-only block; do not modify it directly. Instead, use the GetEnvironmentVariable and SetEnvironmentVariable functions to retrieve or change the environment variables within this block. When the block is no longer needed, it should be freed by calling FreeEnvironmentStrings.

A process can use this function's return value to specify the environment address used by the CreateProcess function.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

Processes and Threads Overview, Process and Thread Functions, CreateProcess, GetEnvironmentVariable, SetEnvironmentVariable, FreeEnvironmentStrings