mirror of
https://github.com/reactos/reactos.git
synced 2024-09-12 05:43:24 +00:00
[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 svn path=/trunk/; revision=47656
This commit is contained in:
parent
adc324f5c9
commit
b2c96e402d
|
@ -60,7 +60,7 @@ WSPSocket(int AddressFamily,
|
||||||
ULONG SizeOfEA;
|
ULONG SizeOfEA;
|
||||||
PAFD_CREATE_PACKET AfdPacket;
|
PAFD_CREATE_PACKET AfdPacket;
|
||||||
HANDLE Sock;
|
HANDLE Sock;
|
||||||
PSOCKET_INFORMATION Socket = NULL, PrevSocket = NULL;
|
PSOCKET_INFORMATION Socket = NULL;
|
||||||
PFILE_FULL_EA_INFORMATION EABuffer = NULL;
|
PFILE_FULL_EA_INFORMATION EABuffer = NULL;
|
||||||
PHELPER_DATA HelperData;
|
PHELPER_DATA HelperData;
|
||||||
PVOID HelperDLLContext;
|
PVOID HelperDLLContext;
|
||||||
|
@ -260,17 +260,6 @@ WSPSocket(int AddressFamily,
|
||||||
/* Save Handle */
|
/* Save Handle */
|
||||||
Socket->Handle = (SOCKET)Sock;
|
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 */
|
/* Save Group Info */
|
||||||
if (g != 0)
|
if (g != 0)
|
||||||
{
|
{
|
||||||
|
@ -2325,15 +2314,8 @@ GetSocketStructure(SOCKET Handle)
|
||||||
{
|
{
|
||||||
PSOCKET_INFORMATION CurrentSocket;
|
PSOCKET_INFORMATION CurrentSocket;
|
||||||
|
|
||||||
if (!SocketListHead)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* This is a special case */
|
|
||||||
if (SocketListHead->Handle == Handle)
|
|
||||||
return SocketListHead;
|
|
||||||
|
|
||||||
CurrentSocket = SocketListHead;
|
CurrentSocket = SocketListHead;
|
||||||
while (CurrentSocket->NextSocket)
|
while (CurrentSocket)
|
||||||
{
|
{
|
||||||
if (CurrentSocket->Handle == Handle)
|
if (CurrentSocket->Handle == Handle)
|
||||||
return CurrentSocket;
|
return CurrentSocket;
|
||||||
|
|
Loading…
Reference in a new issue