Skip to content

Commit c4a0512

Browse files
committed
[MSWSOCK]
- Don't release the critical section because we don't own it - Don't close the socket that we just created - Fix a typo in SockSetInformation that broke it completely svn path=/branches/aicom-network-branch/; revision=48508
1 parent ec32867 commit c4a0512

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

dll/win32/mswsock/msafd/accept.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,6 @@ WSPAccept(SOCKET Handle,
825825
Socket->SharedData.SizeOfLocalAddress);
826826
AcceptedSocket->SharedData.SizeOfLocalAddress = Socket->SharedData.SizeOfLocalAddress;
827827

828-
/* We can release the accepted socket's lock now */
829-
LeaveCriticalSection(&AcceptedSocket->Lock);
830-
831828
/* Send IOCTL to Accept */
832829
AcceptData.UseSAN = SockSanEnabled;
833830
Status = NtDeviceIoControlFile(Socket->WshContext.Handle,
@@ -894,8 +891,8 @@ WSPAccept(SOCKET Handle,
894891
&ErrorCode);
895892

896893
/* Dereference the socket and clear its pointer for error code logic */
897-
SockDereferenceSocket(Socket);
898894
LeaveCriticalSection(&Socket->Lock);
895+
SockDereferenceSocket(Socket);
899896
Socket = NULL;
900897

901898
error:
@@ -919,7 +916,7 @@ WSPAccept(SOCKET Handle,
919916
if (AcceptedSocket)
920917
{
921918
/* Check if the accepted socket also has a handle */
922-
if (ErrorCode == NO_ERROR)
919+
if (ErrorCode != NO_ERROR)
923920
{
924921
/* Close the socket */
925922
SockCloseSocket(AcceptedSocket);

dll/win32/mswsock/msafd/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ SockSetInformation(IN PSOCKET_INFORMATION Socket,
142142
NULL,
143143
NULL,
144144
&IoStatusBlock,
145-
IOCTL_AFD_GET_INFO,
145+
IOCTL_AFD_SET_INFO,
146146
&AfdInfo,
147147
sizeof(AfdInfo),
148148
NULL,

0 commit comments

Comments
 (0)