Alfred Agrell (@Alcaro) commented about dlls/kernel32/process.c:
RtlInitUnicodeString(&uname, wname);
- if (!set_ntstatus(NtQuerySystemEnvironmentValueEx(&uname, &vendor, buffer,
&ret_size, attributes)))
- status = NtQuerySystemEnvironmentValueEx(&uname, &vendor, buffer,
&ret_size, attributes);
- if (status)
- {
if(status == STATUS_VARIABLE_NOT_FOUND)
what. set_ntstatus already maps those two correctly.
And if it didn't, the correct solution would be to teach it, not skip it.