mirror of
https://github.com/glest/glest-source.git
synced 2025-08-15 21:04:00 +02:00
added error message string
This commit is contained in:
@@ -491,9 +491,12 @@ int getLastSocketError() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char * getLastSocketErrorText(int *errNumber) {
|
const char * getLastSocketErrorText(int *errNumber) {
|
||||||
//int errId = (errNumber != NULL ? *errNumber : getLastSocketError());
|
int errId = (errNumber != NULL ? *errNumber : getLastSocketError());
|
||||||
//return WSAGetLastErrorMessage("",errId);
|
char* str = malloc(256);
|
||||||
return "?";
|
str[0] = '\0';
|
||||||
|
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errNumber,
|
||||||
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), str, 256, NULL);
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user