Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function returns the results of an overlapped operation on the specified socket.

Syntax

BOOL WSPGetOverlappedResult(
  SOCKET 
s,
  LPWSAOVERLAPPED 
lpOverlapped,
  LPDWORD 
lpcbTransfer,
  BOOL 
fWait,
  LPDWORD 
lpdwFlags,
  LPINT 
lpErrno 
);

Parameters

s

[in] Identifies the socket. This is the same socket that was specified when the overlapped operation was started by a call to WSPRecv, WSPRecvFrom, WSPSend, WSPSendTo, or WSPIoctl.

lpOverlapped

[in] Points to a WSAOVERLAPPEDstructure that was specified when the overlapped operation was started.

lpcbTransfer

[out] Points to a 32-bit variable that receives the number of bytes that were actually transferred by a send or receive operation, or by WSPIoctl.

fWait

[in] Specifies whether the function should wait for the pending overlapped operation to complete. If TRUE, the function does not return until the operation has been completed. If FALSE and the operation is still pending, the function returns FALSE and lpErrnois WSA_IO_INCOMPLETE. The fWaitparameter may be set to TRUE only if the overlapped operation selected event-based completion notification.

lpdwFlags

[out] Points to a 32-bit variable that will receive one or more flags that supplement the completion status. If the overlapped operation was initiated through WSPRecvor WSPRecvFrom, this parameter will contain the results value for lpFlagsparameter.

lpErrno

[out] Pointer to the error code.

Return Value

This function always returns SOCKET_ERROR and sets lpErrnoto WSASYSCALLFAILURE on Windows Embedded CE.

Remarks

The results reported by this function are those of the specified socket's last overlapped operation to which the specified WSAOVERLAPPEDstructure was provided, and for which the operation's results were pending. A pending operation is indicated when the function that started the operation returns SOCKET_ERROR, and the lpErrnois WSA_IO_PENDING. When an I/O operation is pending, the function that started the operation resets the hEventmember of the WSAOVERLAPPEDstructure to the nonsignaled state. Then, when the pending operation has been completed, the system sets the event object to the signaled state.

If the fWaitparameter is TRUE, this function determines whether the pending operation has been completed by blocking and waiting for the event object to be in the signaled state. A client may set the fWaitparameter to TRUE only if it selected event-based completion notification when the I/O operation was requested. If another form of notification was selected, the usage of the hEventmember of the WSAOVERLAPPEDstructure is different, and setting fWaitto TRUE causes unpredictable results.

Requirements

Header ws2spi.h
Library Ws2.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also