From 7736876afd5472ee22fae25adce5d9b4c3f7fa39 Mon Sep 17 00:00:00 2001 From: Peter Hunnisett Date: Tue, 10 Jul 2001 19:09:59 +0000 Subject: [PATCH] Implemented a stub for WSARecvFrom. --- dlls/winsock/socket.c | 30 ++++++++++++++++++++++++++++++ dlls/winsock/ws2_32.spec | 2 +- include/winsock2.h | 18 +++++++++++------- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index 064a18b960d..2ba903308c6 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -3221,3 +3221,33 @@ UINT16 wsaHerrno(int loc_errno) return WSAEOPNOTSUPP; } } + + +/*********************************************************************** + * WSARecvFrom (WSOCK32.69) + */ +INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, + LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, struct sockaddr *lpFrom, + LPINT lpFromlen, LPWSAOVERLAPPED lpOverlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine ) +{ + DWORD dwCount; + INT rc; + + FIXME( "(%i,%p,%lu,%p,%p,%p,%p,%p,%p: stub\n", + s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, + lpFrom, lpFromlen, lpOverlapped, lpCompletionRoutine ); + + for( dwCount = 0, rc = 0; dwCount < dwBufferCount; dwCount++ ) + { + + if( ( rc = WSOCK32_recvfrom(s, lpBuffers[ dwCount ].buf, (INT)lpBuffers[ dwCount ].len, + (INT)*lpFlags, lpFrom, lpFromlen ) ) != 0 ) + { + break; + } + + } + + return rc; +} diff --git a/dlls/winsock/ws2_32.spec b/dlls/winsock/ws2_32.spec index 0e50aa8fd2d..832a19427cc 100644 --- a/dlls/winsock/ws2_32.spec +++ b/dlls/winsock/ws2_32.spec @@ -81,7 +81,7 @@ debug_channels (winsock) 66 stub WSAProviderConfigChange 67 stub WSARecv 68 stub WSARecvDisconnect -69 stub WSARecvFrom +69 stdcall WSARecvFrom(long ptr long ptr ptr ptr ptr ptr ptr ) WSARecvFrom 70 stub WSARemoveServiceClass 71 forward WSAResetEvent KERNEL32.ResetEvent 72 stdcall WSASend(long ptr long ptr long ptr ptr) WSASend diff --git a/include/winsock2.h b/include/winsock2.h index f8f1f50aea5..f4ee2bdb844 100644 --- a/include/winsock2.h +++ b/include/winsock2.h @@ -212,14 +212,18 @@ typedef void CALLBACK (*LPWSAOVERLAPPED_COMPLETION_ROUTINE) /* Function declarations */ -int WINAPI WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents); -int WINAPI WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents); +int WINAPI WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents); +int WINAPI WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents); WSAEVENT WINAPI WSACreateEvent(void); -BOOL WINAPI WSACloseEvent(WSAEVENT event); -SOCKET WINAPI WSASocketA(int af, int type, int protocol, - LPWSAPROTOCOL_INFOA lpProtocolInfo, - GROUP g, DWORD dwFlags); -extern INT WINAPI ioctlsocket(SOCKET s, LONG cmd, ULONG *argp); +BOOL WINAPI WSACloseEvent(WSAEVENT event); +INT WINAPI WSARecvFrom(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct sockaddr*,LPINT, + LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); +INT WINAPI WSASend(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED, + LPWSAOVERLAPPED_COMPLETION_ROUTINE); +SOCKET WINAPI WSASocketA(int af, int type, int protocol, + LPWSAPROTOCOL_INFOA lpProtocolInfo, + GROUP g, DWORD dwFlags); +INT WINAPI ioctlsocket(SOCKET s, LONG cmd, ULONG *argp); #include "poppack.h"