GetDOSEnvironment

3.0

  LPSTR GetDOSEnvironment(void)    

The GetDOSEnvironment function returns a far pointer to the environment string of the current (running) task.

Parameters

This function has no parameters.

Return Value

The return value is a far pointer to the current environment string.

Comments

Unlike an application, a dynamic-link library (DLL) does not have a copy of the environment string. As a result, the library must call this function to retrieve the environment string.

Example

The following example uses the GetDOSEnvironment function to return a pointer to the environment, and then lists the environment settings:

LPSTR lpszEnv;

lpszEnv = GetDOSEnvironment();
while (*lpszEnv != '\0') {
    .
    . /* process the environment string */
    .

    /* Move to the next environment string */

    lpszEnv += lstrlen(lpszEnv) + 1;
}