Commit d1bc46ff authored by Max Kellermann's avatar Max Kellermann

util/Error: add SetLastError() overload with "DWORD code" parameter

parent 32e5848f
......@@ -133,11 +133,16 @@ Error::FormatErrno(const char *fmt, ...)
#ifdef WIN32
void
Error::SetLastError(const char *prefix)
Error::SetLastError(DWORD _code, const char *prefix)
{
DWORD _code = GetLastError();
const char *msg = g_win32_error_message(_code);
Format(win32_domain, int(_code), "%s: %s", prefix, msg);
}
void
Error::SetLastError(const char *prefix)
{
SetLastError(GetLastError(), prefix);
}
#endif
......@@ -166,6 +166,7 @@ public:
void FormatErrno(int e, const char *prefix, ...);
#ifdef WIN32
void SetLastError(DWORD _code, const char *prefix);
void SetLastError(const char *prefix);
#endif
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment