Alfred Agrell (@Alcaro) commented about dlls/kernel32/process.c:
- return FALSE;
+}
+/***********************************************************************
GetFirmwareEnvironmentVariableExA (KERNEL32.@)
- */
+DWORD WINAPI GetFirmwareEnvironmentVariableExA(LPCSTR name, LPCSTR guid, PVOID buffer, DWORD size, PDWORD attributes) +{
- int nsize;
- GUID vendor = {0};
- LPWSTR wname;
- UNICODE_STRING uname;
- DWORD ret_size = size;
- if (!__wine_string_to_guid(guid, &vendor))
Probably better to convert this string to utf16, then call the W function. That'd not only remove that GUID conversion function (I'd rather not review that amount of math - I think even GCC will complain that, unclear precedence warnings on | and +), but also make future maintenance easier.
Yes, it'll copy and convert around things a little more. Who cares, this isn't performance sensitive.
If you want to remove the allocations, you can put one in NtCurrentTeb()->StaticUnicodeBuffer, A/W conversions is exactly what it's for. (Though there's only one, so you'll need pointer math or allocations for the other one.)