Windows: log more descriptive errors

This commit is contained in:
Megamouse 2023-03-04 11:05:32 +01:00
parent 8409979dc5
commit 92ae57c9ee
8 changed files with 28 additions and 10 deletions

View file

@ -10,8 +10,15 @@ namespace fmt
static std::string format(const CharT(&)[N], const Args&...);
#ifdef _WIN32
struct win_error
{
unsigned long error{};
void* module_handle{};
};
// Get a string for a windows error (DWORD). Optionally a module HANDLE can be passed.
std::string win_error_to_string(unsigned long error, void* module_handle = nullptr);
std::string win_error_to_string(const win_error& error);
#endif
}