Alfred Agrell (@Alcaro) commented about dlls/kernel32/process.c:
- RtlInitUnicodeString(&uguid, wguid);
- if (!set_ntstatus(RtlGUIDFromString(&uguid, &vendor)))
return 0;
- nsize = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0);
- if (!(wname = HeapAlloc(GetProcessHeap(), 0, nsize * sizeof(wname))))
- {
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return 0;
- }
- MultiByteToWideChar(CP_ACP, 0, name, -1, wname, nsize);
- RtlInitUnicodeString(&uname, wname);
This could be slightly simplified by calling GetFirmwareEnvironmentVariableExW here instead of NtQuerySystemEnvironmentValueEx.