windows_programming_notes.nbk: Home | Index | Next Page: GetEnvironmentVariable | Previous Page: GetDlgItemText


 GetEnvironmentStrings

Retrieves the environment variables for the current process.

Synax

    LPTCH WINAPI GetEnvironmentStrings(void);

Parameters

This function has no parameters.

Return Value

If the function succeeds, the return value is a pointer to the environment block of the current process.

If the function fails, the return value is NULL.

Remarks

The GetEnvironmentStrings function returns a pointer to a block of memory that contains the environment variables of the calling process. Each environment block contains the environment variables in the following format:

Treat this memory as read-only; do not modify it directly. To add or change an environment variable, use the GetEnvironmentVariable and SetEnvironmentVariable functions.

When the block returned by GetEnvironmentStrings is no longer needed, it should be freed by calling the FreeEnvironmentStrings function.

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: GetEnvironmentVariable | Previous Page: GetDlgItemText


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time