I\'m porting some sockets code from Linux to Windows.
In Linux, I could use strerror() to convert an errno code into a human-readable string.
strerror()
MS
As the documentation for WSAGetLastError says you can use FormatMessage to obtain a text version of the error message.
You need to set FORMAT_MESSAGE_FROM_SYSTEM in the dwFlags parameter and pass the error code as the dwMessage parameter.
FORMAT_MESSAGE_FROM_SYSTEM
dwFlags
dwMessage