WSASetLastError Function
The WSASetLastError function sets the error code that can be retrieved through the WSAGetLastError function.
Syntax
void WSASetLastError(
__in int iError
);
Parameter
- iError [in]
Integer that specifies the error code to be returned by a subsequent WSAGetLastError call.
Rückgabewert
This function generates no return values.
Error code | Meaning |
---|---|
WSANOTINITIALISED | A successful WSAStartup call must occur before using this function. |
Hinweise
The WSASetLastError function allows an application to set the error code to be returned by a subsequent WSAGetLastError call for the current thread. Note that any subsequent Windows Sockets routine called by the application will override the error code as set by this routine.
The error code set by WSASetLastError is different from the error code reset by calling the function getsockopt with SO_ERROR.
The Windows Sockets error codes used by this function are listed under Windows Sockets Error Codes.
Anforderungen
Mindestens unterstützter Client |
Windows 2000 Professional |
Mindestens unterstützter Server |
Windows 2000 Server |
Header |
Winsock2.h |
Bibliothek |
Ws2_32.lib |
DLL |
Ws2_32.dll |