From 1bcebd98fee4e97be94be19ade983c142d3f2892 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 14 Apr 2018 20:40:00 +0200 Subject: [PATCH 21/23] Use wide-character Win32 API functions to handle `wchar_t *` Signed-off-by: Johannes Schindelin --- deps/v8/src/base/debug/stack_trace_win.cc | 2 +- deps/v8/src/base/platform/platform-win32.cc | 8 ++++---- deps/v8/src/diagnostics/unwinding-info-win64.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deps/v8/src/base/debug/stack_trace_win.cc b/deps/v8/src/base/debug/stack_trace_win.cc index f981bec6..16655d51 100644 --- a/deps/v8/src/base/debug/stack_trace_win.cc +++ b/deps/v8/src/base/debug/stack_trace_win.cc @@ -81,7 +81,7 @@ bool InitializeSymbols() { } wchar_t exe_path[MAX_PATH]; - GetModuleFileName(nullptr, exe_path, MAX_PATH); + GetModuleFileNameW(nullptr, exe_path, MAX_PATH); std::wstring exe_path_wstring(exe_path); // To get the path without the filename, we just need to remove the final // slash and everything after it. diff --git a/deps/v8/src/base/platform/platform-win32.cc b/deps/v8/src/base/platform/platform-win32.cc index 152fbbf3..2b7dea59 100644 --- a/deps/v8/src/base/platform/platform-win32.cc +++ b/deps/v8/src/base/platform/platform-win32.cc @@ -760,13 +760,13 @@ void OS::EnsureWin32MemoryAPILoaded() { static bool loaded = false; if (!loaded) { VirtualAlloc2 = (VirtualAlloc2_t)GetProcAddress( - GetModuleHandle(L"kernelbase.dll"), "VirtualAlloc2"); + GetModuleHandleW(L"kernelbase.dll"), "VirtualAlloc2"); MapViewOfFile3 = (MapViewOfFile3_t)GetProcAddress( - GetModuleHandle(L"kernelbase.dll"), "MapViewOfFile3"); + GetModuleHandleW(L"kernelbase.dll"), "MapViewOfFile3"); UnmapViewOfFile2 = (UnmapViewOfFile2_t)GetProcAddress( - GetModuleHandle(L"kernelbase.dll"), "UnmapViewOfFile2"); + GetModuleHandleW(L"kernelbase.dll"), "UnmapViewOfFile2"); loaded = true; } @@ -1043,7 +1043,7 @@ bool OS::DiscardSystemPages(void* address, size_t size) { reinterpret_cast(-1)) discard_virtual_memory = reinterpret_cast(GetProcAddress( - GetModuleHandle(L"Kernel32.dll"), "DiscardVirtualMemory")); + GetModuleHandleW(L"Kernel32.dll"), "DiscardVirtualMemory")); // Use DiscardVirtualMemory when available because it releases faster than // MEM_RESET. DiscardVirtualMemoryFunction discard_function = discard_virtual_memory.load(); diff --git a/deps/v8/src/diagnostics/unwinding-info-win64.cc b/deps/v8/src/diagnostics/unwinding-info-win64.cc index a71b8661..5c8c6010 100644 --- a/deps/v8/src/diagnostics/unwinding-info-win64.cc +++ b/deps/v8/src/diagnostics/unwinding-info-win64.cc @@ -471,7 +471,7 @@ static decltype( void LoadNtdllUnwindingFunctionsOnce() { // Load functions from the ntdll.dll module. HMODULE ntdll_module = - LoadLibraryEx(L"ntdll.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); + LoadLibraryExW(L"ntdll.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); DCHECK_NOT_NULL(ntdll_module); // This fails on Windows 7. -- 2.17.0.windows.1