[MSWSOCK] Revert r74753 and r74755 as it showed regressions

svn path=/trunk/; revision=74756
This commit is contained in:
Peter Hater 2017-06-03 00:30:20 +00:00
parent a59bc8597f
commit 21b16a63ed
3 changed files with 425 additions and 489 deletions

View file

@ -16,7 +16,6 @@ add_library(mswsock SHARED
${CMAKE_CURRENT_BINARY_DIR}/mswsock.def)
set_module_type(mswsock win32dll UNICODE)
target_link_libraries(mswsock wine)
add_importlibs(mswsock ws2_32 advapi32 dnsapi msvcrt kernel32 ntdll)
add_pch(mswsock precomp.h SOURCE)
add_cd_file(TARGET mswsock DESTINATION reactos/system32 FOR all)

View file

@ -12,9 +12,6 @@
#include <winsock2.h>
#include <mswsock.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(mswsock);
LPFN_TRANSMITFILE pfnTransmitFile = NULL;
LPFN_GETACCEPTEXSOCKADDRS pfnGetAcceptExSockaddrs = NULL;
LPFN_ACCEPTEX pfnAcceptEx = NULL;
@ -31,37 +28,29 @@ TransmitFile(SOCKET Socket,
LPTRANSMIT_FILE_BUFFERS TransmitBuffers,
DWORD Flags)
{
GUID TransmitFileGUID = WSAID_TRANSMITFILE;
GUID TransmitFileGUID = WSAID_TRANSMITFILE;
DWORD cbBytesReturned;
BOOL Ret;
TRACE("TransmitFile %p %p %ld %ld %p %p %lx\n", Socket, File, NumberOfBytesToWrite, NumberOfBytesPerSend, Overlapped, TransmitBuffers, Flags);
if (!pfnTransmitFile && WSAIoctl(Socket,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&TransmitFileGUID,
sizeof(TransmitFileGUID),
&pfnTransmitFile,
sizeof(pfnTransmitFile),
&cbBytesReturned,
NULL,
NULL) == SOCKET_ERROR)
if (WSAIoctl(Socket,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&TransmitFileGUID,
sizeof(TransmitFileGUID),
&pfnTransmitFile,
sizeof(pfnTransmitFile),
&cbBytesReturned,
NULL,
NULL) == SOCKET_ERROR)
{
ERR("TransmitFile WSAIoctl %lx\n", WSAGetLastError());
return FALSE;
}
Ret = pfnTransmitFile(Socket,
File,
NumberOfBytesToWrite,
NumberOfBytesPerSend,
Overlapped,
TransmitBuffers,
Flags);
if (!Ret)
{
ERR("TransmitFile %lx\n", WSAGetLastError());
}
return Ret;
return pfnTransmitFile(Socket,
File,
NumberOfBytesToWrite,
NumberOfBytesPerSend,
Overlapped,
TransmitBuffers,
Flags);
}
/*
@ -81,51 +70,42 @@ AcceptEx(SOCKET ListenSocket,
GUID AcceptExGUID = WSAID_ACCEPTEX;
GUID GetAcceptExSockaddrsGUID = WSAID_GETACCEPTEXSOCKADDRS;
DWORD cbBytesReturned;
BOOL Ret;
TRACE("AcceptEx %p %p %p %ld %ld %ld %p %p\n", ListenSocket, AcceptSocket, OutputBuffer, ReceiveDataLength, LocalAddressLength, RemoteAddressLength, BytesReceived, Overlapped);
if (!pfnAcceptEx && WSAIoctl(ListenSocket,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&AcceptExGUID,
sizeof(AcceptExGUID),
&pfnAcceptEx,
sizeof(pfnAcceptEx),
&cbBytesReturned,
NULL,
NULL) == SOCKET_ERROR)
if (WSAIoctl(ListenSocket,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&AcceptExGUID,
sizeof(AcceptExGUID),
&pfnAcceptEx,
sizeof(pfnAcceptEx),
&cbBytesReturned,
NULL,
NULL) == SOCKET_ERROR)
{
ERR("AcceptEx WSAIoctl %lx\n", WSAGetLastError());
return FALSE;
}
if (!pfnGetAcceptExSockaddrs && WSAIoctl(ListenSocket,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&GetAcceptExSockaddrsGUID,
sizeof(GetAcceptExSockaddrsGUID),
&pfnGetAcceptExSockaddrs,
sizeof(pfnGetAcceptExSockaddrs),
&cbBytesReturned,
NULL,
NULL) == SOCKET_ERROR)
if (WSAIoctl(ListenSocket,
SIO_GET_EXTENSION_FUNCTION_POINTER,
&GetAcceptExSockaddrsGUID,
sizeof(GetAcceptExSockaddrsGUID),
&pfnGetAcceptExSockaddrs,
sizeof(pfnGetAcceptExSockaddrs),
&cbBytesReturned,
NULL,
NULL) == SOCKET_ERROR)
{
ERR("GetAcceptExSockaddrs WSAIoctl %lx\n", WSAGetLastError());
pfnAcceptEx = NULL;
return FALSE;
}
Ret = pfnAcceptEx(ListenSocket,
AcceptSocket,
OutputBuffer,
ReceiveDataLength,
LocalAddressLength,
RemoteAddressLength,
BytesReceived,
Overlapped);
if (!Ret)
{
ERR("AcceptEx %lx\n", WSAGetLastError());
}
return Ret;
return pfnAcceptEx(ListenSocket,
AcceptSocket,
OutputBuffer,
ReceiveDataLength,
LocalAddressLength,
RemoteAddressLength,
BytesReceived,
Overlapped);
}
@ -143,19 +123,16 @@ GetAcceptExSockaddrs(PVOID OutputBuffer,
LPSOCKADDR* RemoteSockaddr,
LPINT RemoteSockaddrLength)
{
TRACE("AcceptEx %p %ld %ld %ld %p %p %p %p\n", OutputBuffer, ReceiveDataLength, LocalAddressLength, RemoteAddressLength, LocalSockaddr, LocalSockaddrLength, RemoteSockaddr, RemoteSockaddrLength);
if (!pfnGetAcceptExSockaddrs)
if (pfnGetAcceptExSockaddrs)
{
ERR("GetAcceptExSockaddrs is NULL\n");
return;
pfnGetAcceptExSockaddrs(OutputBuffer,
ReceiveDataLength,
LocalAddressLength,
RemoteAddressLength,
LocalSockaddr,
LocalSockaddrLength,
RemoteSockaddr,
RemoteSockaddrLength);
}
pfnGetAcceptExSockaddrs(OutputBuffer,
ReceiveDataLength,
LocalAddressLength,
RemoteAddressLength,
LocalSockaddr,
LocalSockaddrLength,
RemoteSockaddr,
RemoteSockaddrLength);
}
/* EOF */

File diff suppressed because it is too large Load diff