Alexandre Julliard (@julliard) commented about programs/where/main.c:
if (colon)
{
*colon = 0;
search_paths = pattern;
pattern = colon + 1;
}
else
{
DWORD len = GetEnvironmentVariableW(L"PATH", NULL, 0);
search_paths = malloc(len * sizeof(WCHAR));
if (!search_paths)
{
ERR("Out of memory\n");
return 1;
}
GetEnvironmentVariableW(L"PATH", search_paths, len);
You want wgetenv().