Author: cgutman
Date: Mon Jun 20 17:35:02 2011
New Revision: 52389
URL:
http://svn.reactos.org/svn/reactos?rev=52389&view=rev
Log:
[MSAFD]
- Mark the accepted socket as connected
- Fixes graceful disconnect on accepted sockets
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Mon Jun 20 17:35:02 2011
@@ -1047,6 +1047,7 @@
ULONG CallBack;
WSAPROTOCOL_INFOW ProtocolInfo;
SOCKET AcceptSocket;
+ PSOCKET_INFORMATION AcceptSocketInfo;
UCHAR ReceiveBuffer[0x1A];
HANDLE SockEvent;
@@ -1362,6 +1363,17 @@
MsafdReturnWithErrno( Status, lpErrno, 0, NULL );
return INVALID_SOCKET;
}
+
+ AcceptSocketInfo = GetSocketStructure(AcceptSocket);
+ if (!AcceptSocketInfo)
+ {
+ NtClose(SockEvent);
+ WSPCloseSocket( AcceptSocket, lpErrno );
+ MsafdReturnWithErrno( STATUS_INVALID_CONNECTION, lpErrno, 0, NULL );
+ return INVALID_SOCKET;
+ }
+
+ AcceptSocketInfo->SharedData.State = SocketConnected;
/* Return Address in SOCKADDR FORMAT */
if( SocketAddress )