mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-15 01:57:58 +08:00
win: Use RegOpenKeyExW() instead of RegOpenKeyEx()
Similar to crrev.com/c/3516536, this CL fixes the Windows build when the UNICODE preprocessor macro is not defined where code passes Unicode string literals with L"..." to non-Unicode APIs like RegOpenKeyEx(). This fixes the build by explicitly using RegOpenKeyExW() instead. Change-Id: I14a827357b9cbd42452e0e5eb13a3430569559a5 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3516538 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
ab43d794a6
commit
9476a76dc0
@ -158,7 +158,7 @@ void SystemSnapshotWin::Initialize(ProcessReaderWin* process_reader) {
|
|||||||
bool version_data_found = false;
|
bool version_data_found = false;
|
||||||
int os_version_build = 0;
|
int os_version_build = 0;
|
||||||
HKEY key;
|
HKEY key;
|
||||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
|
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
|
||||||
0,
|
0,
|
||||||
KEY_QUERY_VALUE,
|
KEY_QUERY_VALUE,
|
||||||
@ -282,7 +282,7 @@ std::string SystemSnapshotWin::CPUVendor() const {
|
|||||||
#elif defined(ARCH_CPU_ARM64)
|
#elif defined(ARCH_CPU_ARM64)
|
||||||
HKEY key;
|
HKEY key;
|
||||||
|
|
||||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
|
L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
|
||||||
0,
|
0,
|
||||||
KEY_QUERY_VALUE,
|
KEY_QUERY_VALUE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user