mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Log error message in cases where only GetLastError
is logged
This commit is contained in:
parent
bc7c347ad4
commit
b7a0f1248a
|
@ -4119,7 +4119,9 @@ void secure_random_fill(void *bytes, unsigned length)
|
||||||
#if defined(CONF_FAMILY_WINDOWS)
|
#if defined(CONF_FAMILY_WINDOWS)
|
||||||
if(!CryptGenRandom(secure_random_data.provider, length, (unsigned char *)bytes))
|
if(!CryptGenRandom(secure_random_data.provider, length, (unsigned char *)bytes))
|
||||||
{
|
{
|
||||||
dbg_msg("secure", "CryptGenRandom failed, last_error=%ld", GetLastError());
|
const DWORD LastError = GetLastError();
|
||||||
|
const std::string ErrorMsg = windows_format_system_message(LastError);
|
||||||
|
dbg_msg("secure", "CryptGenRandom failed: %ld %s", LastError, ErrorMsg.c_str());
|
||||||
dbg_break();
|
dbg_break();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -4323,7 +4325,9 @@ void init_exception_handler()
|
||||||
exception_handling_module = LoadLibraryA(module_name);
|
exception_handling_module = LoadLibraryA(module_name);
|
||||||
if(exception_handling_module == nullptr)
|
if(exception_handling_module == nullptr)
|
||||||
{
|
{
|
||||||
dbg_msg("exception_handling", "failed to load exception handling library '%s' (error %ld)", module_name, GetLastError());
|
const DWORD LastError = GetLastError();
|
||||||
|
const std::string ErrorMsg = windows_format_system_message(LastError);
|
||||||
|
dbg_msg("exception_handling", "failed to load exception handling library '%s' (error %ld %s)", module_name, LastError, ErrorMsg.c_str());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#error exception handling not implemented
|
#error exception handling not implemented
|
||||||
|
@ -4348,7 +4352,11 @@ void set_exception_handler_log_file(const char *log_file_path)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
if(exception_log_file_path_func == nullptr)
|
if(exception_log_file_path_func == nullptr)
|
||||||
dbg_msg("exception_handling", "could not find function '%s' in exception handling library (error %ld)", function_name, GetLastError());
|
{
|
||||||
|
const DWORD LastError = GetLastError();
|
||||||
|
const std::string ErrorMsg = windows_format_system_message(LastError);
|
||||||
|
dbg_msg("exception_handling", "could not find function '%s' in exception handling library (error %ld %s)", function_name, LastError, ErrorMsg.c_str());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
exception_log_file_path_func(wBuffer);
|
exception_log_file_path_func(wBuffer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue