WSASetLastError (Windows CE 5.0)

Send Feedback

This function sets the error code that can be retrieved through the WSAGetLastError function.

voidWSASetLastError(intiError);

Parameters

  • iError
    [in] Integer that specifies the error code to be returned by a subsequent WSAGetLastError call.

Return Values

If no error occurs, no value is returned. If an error occurs, it returns SOCKET_ERROR, and a specific error code can be retrieved by calling the WSAGetLastError function.

Remarks

This 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 returned by calling the getsockopt (Windows Sockets) function with SO_ERROR.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Winsock2.h.
Link Library: Ws2.lib.

See Also

getsockopt (Windows Sockets) | WSAGetLastError | WSAStartup

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.