Author: cgutman
Date: Mon Jun 7 07:40:08 2010
New Revision: 47656
URL: http://svn.reactos.org/svn/reactos?rev=47656&view=rev
Log:
[MSAFD]
- Fix a bug in GetSocketStructure that resulted in us missing the last entry of the list
- Remove an "optimization" which was supposed to find an unused socket entry (which it almost never did) but now just corrupts the linked list by trashing our NextSocket pointer
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 7 07:40:08 2010
@@ -60,7 +60,7 @@
ULONG SizeOfEA;
PAFD_CREATE_PACKET AfdPacket;
HANDLE Sock;
- PSOCKET_INFORMATION Socket = NULL, PrevSocket = NULL;
+ PSOCKET_INFORMATION Socket = NULL;
PFILE_FULL_EA_INFORMATION EABuffer = NULL;
PHELPER_DATA HelperData;
PVOID HelperDLLContext;
@@ -259,17 +259,6 @@
/* Save Handle */
Socket->Handle = (SOCKET)Sock;
-
- /* XXX See if there's a structure we can reuse -- We need to do this
- * more properly. */
- PrevSocket = GetSocketStructure( (SOCKET)Sock );
-
- if( PrevSocket )
- {
- RtlCopyMemory( PrevSocket, Socket, sizeof(*Socket) );
- RtlFreeHeap( GlobalHeap, 0, Socket );
- Socket = PrevSocket;
- }
/* Save Group Info */
if (g != 0)
@@ -2325,15 +2314,8 @@
{
PSOCKET_INFORMATION CurrentSocket;
- if (!SocketListHead)
- return NULL;
-
- /* This is a special case */
- if (SocketListHead->Handle == Handle)
- return SocketListHead;
-
CurrentSocket = SocketListHead;
- while (CurrentSocket->NextSocket)
+ while (CurrentSocket)
{
if (CurrentSocket->Handle == Handle)
return CurrentSocket;