win: Use RegQueryValueExW() instead of RegQueryValueEx()

crrev.com/c/3434090 introduced a change that breaks the Windows build
when the `UNICODE` preprocessor macro is not defined, as it passed
a `wchar_t*` to `RegQueryValueEx()`.

This fixes the build by explicitly using `RegQueryValueExW()` instead.

Change-Id: Ic438bd982fdeffba05b4224051242b45e797ebd8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3516536
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Ben Hamilton 2022-03-10 13:27:13 -07:00 committed by Crashpad LUCI CQ
parent 785cb10e80
commit ab43d794a6

View File

@ -76,12 +76,12 @@ bool ReadRegistryDWORD(HKEY key, const wchar_t* name, int* out_value) {
DWORD type;
DWORD local_value;
DWORD size = sizeof(local_value);
if (RegQueryValueEx(key,
name,
nullptr,
&type,
reinterpret_cast<BYTE*>(&local_value),
&size) == ERROR_SUCCESS &&
if (RegQueryValueExW(key,
name,
nullptr,
&type,
reinterpret_cast<BYTE*>(&local_value),
&size) == ERROR_SUCCESS &&
type == REG_DWORD) {
*out_value = static_cast<int>(local_value);
return true;