LPSTR GetDOSEnvironment(void) |
The GetDOSEnvironment function returns a far pointer to the environment string of the current (running) task.
This function has no parameters.
The return value is a far pointer to the current environment string.
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.
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;
}