Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 24 of file recv.c.
{ PWSSOCKET Socket; INT Status; INT ErrorCode; LPWSATHREADID ThreadId; WSABUF Buffers; DWORD BytesReceived; DPRINT("recv: %lx, %lx, %lx, %p\n", s, flags, len, buf); /* Check for WSAStartup */ if ((ErrorCode = WsQuickPrologTid(&ThreadId)) == ERROR_SUCCESS) { /* Get the Socket Context */ if ((Socket = WsSockGetSocket(s))) { /* Setup the buffers */ Buffers.buf = buf; Buffers.len = len; /* Make the call */ Status = Socket->Provider->Service.lpWSPRecv(s, &Buffers, 1, &BytesReceived, (LPDWORD)&flags, NULL, NULL, ThreadId, &ErrorCode); /* Deference the Socket Context */ WsSockDereference(Socket); /* Return Provider Value */ if (Status == ERROR_SUCCESS) { /* Handle OOB */ if (!(flags & MSG_PARTIAL)) return BytesReceived; ErrorCode = WSAEMSGSIZE; } /* If everything seemed fine, then the WSP call failed itself */ if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE; } else { /* No Socket Context Found */ ErrorCode = WSAENOTSOCK; } } /* Return with an Error */ SetLastError(ErrorCode); return SOCKET_ERROR; }