-
Notifications
You must be signed in to change notification settings - Fork 31
/
SET.c
35 lines (26 loc) · 764 Bytes
/
SET.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "VSTriage.h"
PWSTR SET_Output(void)
{
PWSTR buf;
size_t stBufSize;
HRESULT hResult;
PWSTR pwszFullEnvOrg;
PWSTR pwszFullEnv;
wprintf(L"Listing Environment\r\n");
pwszFullEnvOrg = GetEnvironmentStringsW();
pwszFullEnv = pwszFullEnvOrg;
stBufSize = SIZE_16MB;
buf = LocalAlloc(LPTR, stBufSize);
CRASHIFNULLALLOC(buf);
AddCheckHeader(buf, stBufSize, L"Environment Variables", TRUE);
while (*pwszFullEnv)
{
hResult = StringCchCatW(buf, stBufSize / sizeof(WCHAR), pwszFullEnv);
CHECKSTRINGHR(hResult);
hResult = StringCchCatW(buf, stBufSize / sizeof(WCHAR), L"\r\n");
CHECKSTRINGHR(hResult);
pwszFullEnv += wcslen(pwszFullEnv) + 1; // include NULL
}
ShrinkWcharBuffer(&buf);
return buf;
}