FreeRDP/winpr/libwinpr/environment/test/TestEnvironmentGetEnvironmentStrings.c
2013-10-22 21:38:16 -04:00

29 lines
464 B
C

#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/tchar.h>
#include <winpr/environment.h>
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;
}