WSARecvFrom stub

Peter Hunnisett hunnise at yahoo.com
Tue Jul 10 10:27:53 CDT 2001


Hi,
  this implements a stub for WSARecvFrom.

Ciao,
Peter
hunnise at yahoo.com
-------------- next part --------------
--- ChangeLog	2001/07/06 20:06:34	1.1
+++ ChangeLog	2001/07/10 03:26:55
@@ -1,3 +1,7 @@
+	* dlls/winsock/ws2_32.spec, dlls/winsock/socket.c, include/winsock2.h
+	Peter Hunnisett <hunnise at yahoo.com>
+	Add WSARecvFrom stub and header stuff.
+
 ----------------------------------------------------------------
 2001-06-29  Alexandre Julliard  <julliard at winehq.com>
 
--- dlls/winsock/ws2_32.spec	2001/07/07 03:40:31	1.1
+++ dlls/winsock/ws2_32.spec	2001/07/07 03:54:03
@@ -81,7 +81,7 @@
 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
--- include/winsock2.h	2001/07/08 03:28:10	1.1
+++ include/winsock2.h	2001/07/08 03:38:45
@@ -12,6 +12,8 @@
 /* proper 4-byte packing */
 #include "pshpack4.h"
 
+#define WSAAPI WINAPI
+
 #define WS_SO_GROUP_ID       0x2001
 #define WS_SO_GROUP_PRIORITY 0x2002
 #define WS_SO_MAX_MSG_SIZE   0x2003
@@ -220,6 +222,14 @@
                          LPWSAPROTOCOL_INFOA lpProtocolInfo,
                          GROUP g, DWORD dwFlags);
 extern INT WINAPI ioctlsocket(SOCKET s, LONG cmd, ULONG *argp);
+INT WSAAPI WSASend( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent,
+                    DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped, 
+                    LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );
+INT WSAAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd,
+                        LPDWORD lpFlags, struct sockaddr* lpFrom, LPINT lpFromlen, 
+                        LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );
+
+
 
 #include "poppack.h"
 
--- dlls/winsock/socket.c	2001/07/07 03:40:31	1.1
+++ dlls/winsock/socket.c	2001/07/08 03:39:09
@@ -1866,7 +1866,7 @@
 /***********************************************************************
  *		WSASend			(WSOCK32.72)
  */
-INT WINAPI WSASend( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
+INT WSAAPI WSASend( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
                     LPDWORD lpNumberOfBytesSent, DWORD dwFlags,
                     LPWSAOVERLAPPED lpOverlapped,
                     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine )
@@ -3168,4 +3168,32 @@
 		WARN("Unknown h_errno %d!\n", loc_errno);
 		return WSAEOPNOTSUPP;
     }
+}
+
+
+/***********************************************************************
+ *              WSARecvFrom             (WSOCK32.69)
+ */
+INT WSAAPI 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;
 }


More information about the wine-patches mailing list