diff --git a/src/ConsoleHelper.cpp b/src/ConsoleHelper.cpp index a6ba727..550856e 100644 --- a/src/ConsoleHelper.cpp +++ b/src/ConsoleHelper.cpp @@ -163,9 +163,10 @@ namespace YYCC::ConsoleHelper { bool EnableColorfulConsole() { #if YYCC_OS == YYCC_OS_WINDOWS - if (!RawEnableColorfulConsole(stdout)) return false; - if (!RawEnableColorfulConsole(stderr)) return false; - return true; + bool ret = true; + ret &= RawEnableColorfulConsole(stdout); + ret &= RawEnableColorfulConsole(stderr); + return ret; #else diff --git a/src/ExceptionHelper.cpp b/src/ExceptionHelper.cpp index 51deb72..a565c07 100644 --- a/src/ExceptionHelper.cpp +++ b/src/ExceptionHelper.cpp @@ -223,7 +223,7 @@ namespace YYCC::ExceptionHelper { std::string module_name_raw; DWORD64 module_base; if (module_base = SymGetModuleBase64(process, frame.AddrPC.Offset)) { - if (WinFctHelper::GetModuleName((HINSTANCE)module_base, module_name_raw)) { + if (WinFctHelper::GetModuleFileName((HINSTANCE)module_base, module_name_raw)) { module_name = module_name_raw.c_str(); } } diff --git a/src/WinFctHelper.cpp b/src/WinFctHelper.cpp index cc7e9eb..834fa8d 100644 --- a/src/WinFctHelper.cpp +++ b/src/WinFctHelper.cpp @@ -43,7 +43,7 @@ namespace YYCC::WinFctHelper { return YYCC::EncodingHelper::WcharToUTF8(wpath.c_str(), ret); } - bool GetModuleName(HINSTANCE hModule, std::string& ret) { + bool GetModuleFileName(HINSTANCE hModule, std::string& ret) { // create wchar buffer for receiving the temp path. std::wstring wpath(MAX_PATH + 1u, L'\0'); DWORD copied_size; diff --git a/src/WinFctHelper.hpp b/src/WinFctHelper.hpp index 05263ec..ad6652f 100644 --- a/src/WinFctHelper.hpp +++ b/src/WinFctHelper.hpp @@ -48,7 +48,7 @@ namespace YYCC::WinFctHelper { * The variable receiving UTF8 encoded file name of given module. * @return True if success, otherwise false. */ - bool GetModuleName(HINSTANCE hModule, std::string& ret); + bool GetModuleFileName(HINSTANCE hModule, std::string& ret); } #endif diff --git a/src/WinImportSuffix.hpp b/src/WinImportSuffix.hpp index af2c6d2..5c36920 100644 --- a/src/WinImportSuffix.hpp +++ b/src/WinImportSuffix.hpp @@ -15,5 +15,6 @@ #undef GetClassName #undef LoadImage #undef GetTempPath +#undef GetModuleFileName #endif \ No newline at end of file