Fix WiiSockMan::DecodeError
This commit is contained in:
parent
6658d21215
commit
f33fae574f
|
@ -24,13 +24,14 @@
|
||||||
char* WiiSockMan::DecodeError(s32 ErrorCode)
|
char* WiiSockMan::DecodeError(s32 ErrorCode)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
// NOT THREAD SAFE
|
||||||
static char Message[1024];
|
static char Message[1024];
|
||||||
// If this program was multi-threaded, we'd want to use FORMAT_MESSAGE_ALLOCATE_BUFFER
|
|
||||||
// instead of a static buffer here.
|
FormatMessageA(
|
||||||
// (And of course, free the buffer when we were done with it)
|
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK,
|
||||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
|
nullptr, ErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), Message,
|
||||||
FORMAT_MESSAGE_MAX_WIDTH_MASK, nullptr, ErrorCode,
|
sizeof(Message), nullptr);
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)Message, 1024, nullptr);
|
|
||||||
return Message;
|
return Message;
|
||||||
#else
|
#else
|
||||||
return strerror(ErrorCode);
|
return strerror(ErrorCode);
|
||||||
|
|
Loading…
Reference in New Issue