Skip to content

Commit

Permalink
MSVC: does not compile with Unicode/Multi-Byte character set
Browse files Browse the repository at this point in the history
  • Loading branch information
olejniczak committed Aug 26, 2020
1 parent 1efdd14 commit 4f1a691
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3300,9 +3300,9 @@ class get_mod_info {
ret.base_address = mi.lpBaseOfDll;
ret.load_size = mi.SizeOfImage;

GetModuleFileNameEx(process, module, temp, sizeof(temp));
GetModuleFileNameExA(process, module, temp, sizeof(temp));
ret.image_name = temp;
GetModuleBaseName(process, module, temp, sizeof(temp));
GetModuleBaseNameA(process, module, temp, sizeof(temp));
ret.module_name = temp;
std::vector<char> img(ret.image_name.begin(), ret.image_name.end());
std::vector<char> mod(ret.module_name.begin(), ret.module_name.end());
Expand Down Expand Up @@ -3358,14 +3358,14 @@ template <> class TraceResolverImpl<system_tag::windows_tag> {

if (!SymFromAddr(process, (ULONG64)t.addr, &displacement, &sym.sym)) {
// TODO: error handling everywhere
LPTSTR lpMsgBuf;
char* lpMsgBuf;
DWORD dw = GetLastError();

FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&lpMsgBuf, 0, NULL);
(char*)&lpMsgBuf, 0, NULL);

printf(lpMsgBuf);

Expand Down

0 comments on commit 4f1a691

Please sign in to comment.