Alfred Agrell (@Alcaro) commented about dlls/kernel32/process.c:
- {
SetLastError(RtlNtStatusToDosError(ERROR_NOT_ENOUGH_MEMORY));
return 0;
- }
- MultiByteToWideChar(CP_ACP, 0, name, -1, wname, nsize);
- RtlInitUnicodeString(&uname, wname);
- if (!set_ntstatus(
NtQuerySystemEnvironmentValueEx(&uname, &vendor, buffer, &ret_size, attributes)))
- {
ret_size = 0;
- }
- RtlFreeUnicodeString(&uname);
RtlInitUnicodeString doesn't allocate, it just puts the pointer in the struct. Better just just drop that variable.