#include #include #include #include int TestEnvironmentGetEnvironmentStrings(int argc, char* argv[]) { TCHAR* p; int length; LPTCH lpszEnvironmentBlock; lpszEnvironmentBlock = GetEnvironmentStrings(); p = (TCHAR*) lpszEnvironmentBlock; while (p[0] && p[1]) { printf("%s\n", p); length = _tcslen(p); p += (length + 1); } FreeEnvironmentStrings(lpszEnvironmentBlock); return 0; }