1
0
Fork 0
spectre/source/Platform/Win32/Win32Internal.cpp
2016-01-10 09:26:43 +01:00

20 lines
380 B
C++

#include <string.h>
#include "Win32Internal.h"
const char* Win32GetMessage(DWORD messageId) {
static char buf[1024] = { '\0' };
DWORD rc = FormatMessage(
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, messageId,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf, 1024, NULL);
if (!rc) {
strcpy_s(buf, "Unkown error!\n");
}
return buf;
}