Author: arty
Date: Fri Feb 6 19:20:25 2009
New Revision: 39447
URL:
http://svn.reactos.org/svn/reactos?rev=39447&view=rev
Log:
Calling listen more than once is expected to be benign.
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] Fri Feb 6 19:20:25 2009
@@ -101,6 +101,7 @@
RtlZeroMemory(Socket, sizeof(*Socket));
Socket->RefCount = 2;
Socket->Handle = -1;
+ Socket->SharedData.Listening = FALSE;
Socket->SharedData.State = SocketOpen;
Socket->SharedData.AddressFamily = AddressFamily;
Socket->SharedData.SocketType = SocketType;
@@ -615,6 +616,12 @@
HANDLE SockEvent;
NTSTATUS Status;
+ /* Get the Socket Structure associate to this Socket*/
+ Socket = GetSocketStructure(Handle);
+
+ if (Socket->SharedData.Listening)
+ return 0;
+
Status = NtCreateEvent(&SockEvent,
GENERIC_READ | GENERIC_WRITE,
NULL,
@@ -623,9 +630,6 @@
if( !NT_SUCCESS(Status) )
return -1;
-
- /* Get the Socket Structure associate to this Socket*/
- Socket = GetSocketStructure(Handle);
/* Set Up Listen Structure */
ListenData.UseSAN = FALSE;