Added implementation for WSARecvEx function. This is a Microsoft
specific extension to the winsock API.
diff --git a/if1632/winsock.spec b/if1632/winsock.spec
index 46f89f6..6e75464 100644
--- a/if1632/winsock.spec
+++ b/if1632/winsock.spec
@@ -59,5 +59,6 @@
115 pascal WSAStartup(word ptr) WSAStartup16
116 pascal WSACleanup() WSACleanup
151 pascal16 __WSAFDIsSet(word ptr) __WSAFDIsSet16
+1107 pascal16 WSARecvEx(word ptr word ptr) WSARecvEx16
1999 pascal DllEntryPoint(long word word word long word) WINSOCK_LibMain
diff --git a/include/winsock.h b/include/winsock.h
index 74c4bb1..93445cb 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -257,6 +257,10 @@
#endif
#define MSG_MAXIOVLEN 16
+#ifndef MSG_PARTIAL
+#define MSG_PARTIAL 0x8000 /* partial send or recv (WSARecvEx) */
+#endif
+
/*
* Define constant based on rfc883, used by gethostbyxxxx() calls.
*/
@@ -433,6 +437,8 @@
INT16 WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent);
INT WINAPI WSAAsyncSelect(SOCKET s, HWND hWnd, UINT uMsg, LONG lEvent);
+INT16 WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags);
+INT WINAPI WSARecvEx(SOCKET s, char *buf, INT len, INT *flags);
/*
* Address families
diff --git a/misc/winsock.c b/misc/winsock.c
index b234906..23cd918 100644
--- a/misc/winsock.c
+++ b/misc/winsock.c
@@ -2185,6 +2185,34 @@
return (INT16)WSAAsyncSelect( s, hWnd, wMsg, lEvent );
}
+/***********************************************************************
+ * WSARecvEx() (WSOCK32.1107)
+ *
+ * WSARecvEx is a Microsoft specific extension to winsock that is identical to recv
+ * except that has an in/out argument call flags that has the value MSG_PARTIAL ored
+ * into the flags parameter when a partial packet is read. This only applies to
+ * sockets using the datagram protocol. This method does not seem to be implemented
+ * correctly by microsoft as the winsock implementation does not set the MSG_PARTIAL
+ * flag when a fragmented packet arrives.
+ */
+INT WINAPI WSARecvEx(SOCKET s, char *buf, INT len, INT *flags) {
+ FIXME("(WSARecvEx) partial packet return value not set \n");
+
+ return WINSOCK_recv(s, buf, len, *flags);
+}
+
+
+/***********************************************************************
+ * WSARecvEx16() (WINSOCK.1107)
+ *
+ * See description for WSARecvEx()
+ */
+INT16 WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags) {
+ FIXME("(WSARecvEx16) partial packet return value not set \n");
+
+ return WINSOCK_recv16(s, buf, len, *flags);
+}
+
/***********************************************************************
* __WSAFDIsSet() (WINSOCK.151)
diff --git a/relay32/wsock32.spec b/relay32/wsock32.spec
index f533bde..2cc435b 100644
--- a/relay32/wsock32.spec
+++ b/relay32/wsock32.spec
@@ -61,7 +61,7 @@
#1104 stub rresvport
#1105 stub sethostname
#1106 stub dn_expand
-1107 stub WSARecvEx
+1107 stdcall WSARecvEx(long ptr long ptr) WSARecvEx
1108 stdcall s_perror(str) WS_s_perror
1109 stub GetAddressByNameA
1110 stub GetAddressByNameW