Author: phater
Date: Thu Jun 1 15:25:25 2017
New Revision: 74731
URL:
http://svn.reactos.org/svn/reactos?rev=74731&view=rev
Log:
[MSWSOCK] Unstub AcceptEx and GetAcceptExSockaddrs. Note that real implementation in msafd
is not available, so result will still be FALSE
Modified:
trunk/reactos/dll/win32/mswsock/extensions.c
trunk/reactos/dll/win32/mswsock/stubs.c
Modified: trunk/reactos/dll/win32/mswsock/extensions.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mswsock/extensio…
==============================================================================
--- trunk/reactos/dll/win32/mswsock/extensions.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mswsock/extensions.c [iso-8859-1] Thu Jun 1 15:25:25 2017
@@ -12,6 +12,9 @@
#include <winsock2.h>
#include <mswsock.h>
+LPFN_TRANSMITFILE pfnTransmitFile = NULL;
+LPFN_GETACCEPTEXSOCKADDRS pfnGetAcceptExSockaddrs = NULL;
+LPFN_ACCEPTEX pfnAcceptEx = NULL;
/*
* @implemented
*/
@@ -25,30 +28,111 @@
LPTRANSMIT_FILE_BUFFERS TransmitBuffers,
DWORD Flags)
{
- static GUID TransmitFileGUID = WSAID_TRANSMITFILE;
- LPFN_TRANSMITFILE pfnTransmitFile;
- DWORD cbBytesReturned;
+ GUID TransmitFileGUID = WSAID_TRANSMITFILE;
+ DWORD cbBytesReturned;
- if (WSAIoctl(Socket,
- SIO_GET_EXTENSION_FUNCTION_POINTER,
- &TransmitFileGUID,
- sizeof(TransmitFileGUID),
- &pfnTransmitFile,
- sizeof(pfnTransmitFile),
- &cbBytesReturned,
- NULL,
- NULL) == SOCKET_ERROR)
- {
- return FALSE;
- }
+ if (WSAIoctl(Socket,
+ SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &TransmitFileGUID,
+ sizeof(TransmitFileGUID),
+ &pfnTransmitFile,
+ sizeof(pfnTransmitFile),
+ &cbBytesReturned,
+ NULL,
+ NULL) == SOCKET_ERROR)
+ {
+ return FALSE;
+ }
- return pfnTransmitFile(Socket,
- File,
- NumberOfBytesToWrite,
- NumberOfBytesPerSend,
- Overlapped,
- TransmitBuffers,
- Flags);
+ return pfnTransmitFile(Socket,
+ File,
+ NumberOfBytesToWrite,
+ NumberOfBytesPerSend,
+ Overlapped,
+ TransmitBuffers,
+ Flags);
}
+/*
+* @implemented
+*/
+BOOL
+WINAPI
+AcceptEx(SOCKET ListenSocket,
+ SOCKET AcceptSocket,
+ PVOID OutputBuffer,
+ DWORD ReceiveDataLength,
+ DWORD LocalAddressLength,
+ DWORD RemoteAddressLength,
+ LPDWORD BytesReceived,
+ LPOVERLAPPED Overlapped)
+{
+ GUID AcceptExGUID = WSAID_ACCEPTEX;
+ GUID GetAcceptExSockaddrsGUID = WSAID_GETACCEPTEXSOCKADDRS;
+ DWORD cbBytesReturned;
+
+ if (WSAIoctl(ListenSocket,
+ SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &AcceptExGUID,
+ sizeof(AcceptExGUID),
+ &pfnAcceptEx,
+ sizeof(pfnAcceptEx),
+ &cbBytesReturned,
+ NULL,
+ NULL) == SOCKET_ERROR)
+ {
+ return FALSE;
+ }
+
+ if (WSAIoctl(ListenSocket,
+ SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &GetAcceptExSockaddrsGUID,
+ sizeof(GetAcceptExSockaddrsGUID),
+ &pfnGetAcceptExSockaddrs,
+ sizeof(pfnGetAcceptExSockaddrs),
+ &cbBytesReturned,
+ NULL,
+ NULL) == SOCKET_ERROR)
+ {
+ pfnAcceptEx = NULL;
+ return FALSE;
+ }
+
+ return pfnAcceptEx(ListenSocket,
+ AcceptSocket,
+ OutputBuffer,
+ ReceiveDataLength,
+ LocalAddressLength,
+ RemoteAddressLength,
+ BytesReceived,
+ Overlapped);
+}
+
+
+/*
+* @implemented
+*/
+VOID
+WINAPI
+GetAcceptExSockaddrs(PVOID OutputBuffer,
+ DWORD ReceiveDataLength,
+ DWORD LocalAddressLength,
+ DWORD RemoteAddressLength,
+ LPSOCKADDR* LocalSockaddr,
+ LPINT LocalSockaddrLength,
+ LPSOCKADDR* RemoteSockaddr,
+ LPINT RemoteSockaddrLength)
+{
+ if (pfnGetAcceptExSockaddrs)
+ {
+ pfnGetAcceptExSockaddrs(OutputBuffer,
+ ReceiveDataLength,
+ LocalAddressLength,
+ RemoteAddressLength,
+ LocalSockaddr,
+ LocalSockaddrLength,
+ RemoteSockaddr,
+ RemoteSockaddrLength);
+ }
+}
/* EOF */
Modified: trunk/reactos/dll/win32/mswsock/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mswsock/stubs.c?…
==============================================================================
--- trunk/reactos/dll/win32/mswsock/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mswsock/stubs.c [iso-8859-1] Thu Jun 1 15:25:25 2017
@@ -21,25 +21,6 @@
DWORD dwPriority;
} NS_ROUTINE, *PNS_ROUTINE, * FAR LPNS_ROUTINE;
-/*
- * @unimplemented
- */
-BOOL
-WINAPI
-AcceptEx(SOCKET ListenSocket,
- SOCKET AcceptSocket,
- PVOID OutputBuffer,
- DWORD ReceiveDataLength,
- DWORD LocalAddressLength,
- DWORD RemoteAddressLength,
- LPDWORD BytesReceived,
- LPOVERLAPPED Overlapped)
-{
- OutputDebugStringW(L"w32sock AcceptEx stub called\n");
-
- return FALSE;
-}
-
/*
* @unimplemented
@@ -68,24 +49,6 @@
OutputDebugStringW(L"w32sock EnumProtocolsW stub called\n");
return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-VOID
-WINAPI
-GetAcceptExSockaddrs(PVOID OutputBuffer,
- DWORD ReceiveDataLength,
- DWORD LocalAddressLength,
- DWORD RemoteAddressLength,
- LPSOCKADDR* LocalSockaddr,
- LPINT LocalSockaddrLength,
- LPSOCKADDR* RemoteSockaddr,
- LPINT RemoteSockaddrLength)
-{
- OutputDebugStringW(L"w32sock GetAcceptExSockaddrs stub called\n");
}