Compare commits

...

21 Commits

Author SHA1 Message Date
Cameron Gutman
6ba6c473f5 [RTL]
- Fix RtlIpv4StringToAddressW definition

svn path=/branches/aicom-network-branch/; revision=53058
2011-08-04 04:15:17 +00:00
Cameron Gutman
e3e917fbeb [MSWSOCK]
- Fix a BOOL vs BOOLEAN issue

svn path=/branches/aicom-network-branch/; revision=50596
2011-02-02 14:53:02 +00:00
Cameron Gutman
0ee5ec5113 [MSWSOCK]
- AFD_EVENT_CLOSE also triggers on FD_CLOSE
- Fix a deadlock after calling WSPEnumNetworkEvents
- Fix a deadlock when calling WSPSend on an unbound socket
- Leave the critical section while waiting
- Firefox (and many other applications) work now

svn path=/branches/aicom-network-branch/; revision=48526
2010-08-12 22:39:24 +00:00
Cameron Gutman
7640fe7dfb [MSWSOCK]
- Fix IsSockaddrEqualToZero
- Comment out the broken async connect code (as it is in our current msafd)
- Fix a deadlock bug and socket descriptor leak when disconnecting a datagram socket
- Fix bug in the SO_BROADCAST check

svn path=/branches/aicom-network-branch/; revision=48524
2010-08-12 21:26:28 +00:00
Cameron Gutman
c2fc6d47e8 [MSWSOCK]
- Add another parameter check inside the FIONBIO code
- Implement FIONREAD
- Pass any unhandled I/O control codes to our helper DLL
- This commit should be backported to msafd

svn path=/branches/aicom-network-branch/; revision=48521
2010-08-12 04:42:54 +00:00
Cameron Gutman
ffedb05b4e [MSWSOCK]
- Check for STATUS_SUCCESS explicitly instead of using the NT_SUCCESS macro because somebody at MS thought it was a great idea to make STATUS_TIMEOUT a success status thus causing endless hours of bug hunting for the poor developers that make this same mistake
- STATUS_TIMEOUT isn't an error status so checking for it with NT_ERROR won't work either instead just add a special case in the if for STATUS_TIMEOUT

svn path=/branches/aicom-network-branch/; revision=48520
2010-08-12 04:22:52 +00:00
Cameron Gutman
48d08ea8f6 [MSWSOCK]
- Implement FIONBIO and fix the error case to not cause a deadlock later

svn path=/branches/aicom-network-branch/; revision=48519
2010-08-12 03:51:12 +00:00
Cameron Gutman
641cb7e490 [MSWSOCK]
- Fix another typo that broke async select (we passed the thread context to the completion function instead of the completion context)

svn path=/branches/aicom-network-branch/; revision=48516
2010-08-10 22:23:51 +00:00
Cameron Gutman
66224e0954 [MSWSOCK]
- Pass the correct NumberOfConcurrentThreads parameter to NtCreateIoCompletion

svn path=/branches/aicom-network-branch/; revision=48515
2010-08-10 21:42:12 +00:00
Cameron Gutman
f8c89e873b [MSWSOCK]
- Fix completion port initialization

svn path=/branches/aicom-network-branch/; revision=48512
2010-08-10 15:59:33 +00:00
Cameron Gutman
c4a05125ed [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
2010-08-10 08:52:48 +00:00
Cameron Gutman
ec32867760 [MSWSOCK]
- Leave the socket's critical section before clearing it's pointer
- Fixes the deadlock that occurs after successfully calling accept

svn path=/branches/aicom-network-branch/; revision=48506
2010-08-10 06:46:00 +00:00
Cameron Gutman
048e0fc5f8 [MSWSOCK]
- Fix two more nasty typos that broke WSPListen

svn path=/branches/aicom-network-branch/; revision=48505
2010-08-10 06:14:13 +00:00
Cameron Gutman
f6d117d290 [MSWSOCK]
- Fix a fatal typo
- Add events that were missing which broke WSPSelect on connect and accept

svn path=/branches/aicom-network-branch/; revision=48504
2010-08-10 06:02:29 +00:00
Cameron Gutman
6b8a762c68 [MSWSOCK]
- Implement WSPSetSockOpt (copied and modified from WSPGetSockOpt)
- DHCP works now

svn path=/branches/aicom-network-branch/; revision=48496
2010-08-09 20:47:14 +00:00
Cameron Gutman
9c5e94efdd [MSWSOCK]
- Fix a crash in WSPSelect

svn path=/branches/aicom-network-branch/; revision=48490
2010-08-09 15:37:12 +00:00
Cameron Gutman
5a0b35cd79 [MSWSOCK]
- Add a hack to set the connectionless flag for datagram and raw sockets (the previous msafd has the same hack)
- The DHCP service can send and receive packets now

svn path=/branches/aicom-network-branch/; revision=48489
2010-08-08 16:36:48 +00:00
Cameron Gutman
c7202504aa [WINSOCK]
- Fix branch build

svn path=/branches/aicom-network-branch/; revision=48047
2010-07-14 19:49:37 +00:00
Cameron Gutman
3c77fc7e9f [MSWSOCK]
- Print a warning if functions are missing from hnetcfg.dll
- Fix yet another typo

svn path=/branches/aicom-network-branch/; revision=48022
2010-07-12 23:38:13 +00:00
Cameron Gutman
ba63a6d99b [MSWSOCK]
- Fix a typo in a DLL name

svn path=/branches/aicom-network-branch/; revision=48021
2010-07-12 23:16:50 +00:00
Cameron Gutman
1aa6c8abec [WINSOCK]
- Fix a nasty typo in SockEnterApiFast

svn path=/branches/aicom-network-branch/; revision=48011
2010-07-12 18:56:44 +00:00
13 changed files with 282 additions and 74 deletions

View File

@@ -82,8 +82,7 @@ SockCoreAccept(IN PSOCKET_INFORMATION Socket,
HelperContextSize);
if (!HelperContext)
{
/* Unlock the socket and fail */
LeaveCriticalSection(&Socket->Lock);
/* Fail */
return WSAENOBUFS;
}
}
@@ -99,9 +98,6 @@ SockCoreAccept(IN PSOCKET_INFORMATION Socket,
&HelperContextSize);
}
/* We're done with the old socket, so we can release the lock */
LeaveCriticalSection(&Socket->Lock);
/* Get the TDI Handles for the new socket */
ErrorCode = SockGetTdiHandles(AcceptedSocket);
@@ -311,6 +307,7 @@ WSPAccept(SOCKET Handle,
NULL,
&Timeout,
lpErrno);
if (ReturnValue == SOCKET_ERROR)
{
/* Fail */
@@ -412,10 +409,13 @@ WSPAccept(SOCKET Handle,
if (Status == STATUS_PENDING)
{
/* Wait for completion */
LeaveCriticalSection(&Socket->Lock);
SockWaitForSingleObject(ThreadData->EventHandle,
Handle,
NO_BLOCKING_HOOK,
NO_TIMEOUT);
EnterCriticalSection(&Socket->Lock);
/* Get new status */
Status = IoStatusBlock.Status;
}
@@ -462,10 +462,13 @@ WSPAccept(SOCKET Handle,
if (Status == STATUS_PENDING)
{
/* Wait for completion */
LeaveCriticalSection(&Socket->Lock);
SockWaitForSingleObject(ThreadData->EventHandle,
Handle,
NO_BLOCKING_HOOK,
NO_TIMEOUT);
EnterCriticalSection(&Socket->Lock);
/* Get new status */
Status = IoStatusBlock.Status;
}
@@ -825,9 +828,6 @@ WSPAccept(SOCKET Handle,
Socket->SharedData.SizeOfLocalAddress);
AcceptedSocket->SharedData.SizeOfLocalAddress = Socket->SharedData.SizeOfLocalAddress;
/* We can release the accepted socket's lock now */
LeaveCriticalSection(&AcceptedSocket->Lock);
/* Send IOCTL to Accept */
AcceptData.UseSAN = SockSanEnabled;
Status = NtDeviceIoControlFile(Socket->WshContext.Handle,
@@ -894,6 +894,7 @@ WSPAccept(SOCKET Handle,
&ErrorCode);
/* Dereference the socket and clear its pointer for error code logic */
LeaveCriticalSection(&Socket->Lock);
SockDereferenceSocket(Socket);
Socket = NULL;
@@ -918,7 +919,7 @@ error:
if (AcceptedSocket)
{
/* Check if the accepted socket also has a handle */
if (ErrorCode == NO_ERROR)
if (ErrorCode != NO_ERROR)
{
/* Close the socket */
SockCloseSocket(AcceptedSocket);

View File

@@ -26,7 +26,7 @@ SockCreateAsyncQueuePort(VOID)
Status = NtCreateIoCompletion(&SockAsyncQueuePort,
IO_COMPLETION_ALL_ACCESS,
NULL,
-1);
0);
/* Protect Handle */
HandleFlags.ProtectFromClose = TRUE;
@@ -163,14 +163,14 @@ SockAsyncThread(PVOID Context)
&IoStatusBlock,
&Timeout);
/* Check for success */
if (NT_SUCCESS(Status))
if (Status == STATUS_SUCCESS)
{
/* Check if this isn't the termination command */
if (AsyncCompletionRoutine != (PVOID)-1)
{
/* Call the routine */
SockHandleAsyncIndication(AsyncCompletionRoutine,
Context,
AsyncContext,
&IoStatusBlock);
}
else
@@ -180,7 +180,7 @@ SockAsyncThread(PVOID Context)
InterlockedDecrement(&SockAsyncThreadReferenceCount);
}
}
else if ((SockAsyncThreadReferenceCount > 1) && (NT_ERROR(Status)))
else if ((SockAsyncThreadReferenceCount > 1) && (NT_ERROR(Status) || Status == STATUS_TIMEOUT))
{
/* It Failed, sleep for a second */
Sleep(1000);

View File

@@ -22,7 +22,7 @@ IsSockaddrEqualToZero(IN const struct sockaddr* SocketAddress,
for (i = 0; i < SocketAddressLength; i++)
{
/* Make sure it's 0 */
if (*(PULONG)SocketAddress + i)return FALSE;
if (*(PULONG)(SocketAddress + i)) return FALSE;
}
/* All zeroes, succees! */
@@ -171,6 +171,7 @@ SockDoConnectReal(IN PSOCKET_INFORMATION Socket,
/* Set the SAN State */
ConnectInfo->UseSAN = SockSanEnabled;
#if 0
/* Check if this is a non-blocking streaming socket */
if ((Socket->SharedData.NonBlocking) && !(MSAFD_IS_DGRAM_SOCK(Socket)))
{
@@ -185,6 +186,7 @@ SockDoConnectReal(IN PSOCKET_INFORMATION Socket,
Status = 0;
}
else
#endif
{
/* Start the connect loop */
do
@@ -386,8 +388,11 @@ SockDoConnect(SOCKET Handle,
(MSAFD_IS_DGRAM_SOCK(Socket)) &&
(IsSockaddrEqualToZero(SocketAddress, SocketAddressLength)))
{
/* Disconnect the socket and return */
return UnconnectDatagramSocket(Socket);
/* Disconnect the socket */
ErrorCode = UnconnectDatagramSocket(Socket);
/* Cleanup and return */
goto error;
}
/* Make sure the Address Family is valid */
@@ -412,6 +417,7 @@ SockDoConnect(SOCKET Handle,
{
/* Fail: SO_BROADCAST must be set first in WinSock 2.0+ */
ErrorCode = WSAEACCES;
goto error;
}
}

View File

@@ -72,6 +72,7 @@ SockEventSelectHelper(IN PSOCKET_INFORMATION Socket,
/* Send close event. Note, this includes both aborts and disconnects */
if (Events & FD_CLOSE) PollInfo.Events |= AFD_EVENT_DISCONNECT |
AFD_EVENT_CLOSE |
AFD_EVENT_ABORT;
/* Send PnP events related to live network hardware changes */
@@ -99,10 +100,12 @@ SockEventSelectHelper(IN PSOCKET_INFORMATION Socket,
if (Status == STATUS_PENDING)
{
/* Wait for completion */
LeaveCriticalSection(&Socket->Lock);
SockWaitForSingleObject(ThreadData->EventHandle,
Socket->Handle,
NO_BLOCKING_HOOK,
NO_TIMEOUT);
EnterCriticalSection(&Socket->Lock);
/* Get new status */
Status = IoStatusBlock.Status;
@@ -273,10 +276,12 @@ WSPEnumNetworkEvents(IN SOCKET Handle,
if (Status == STATUS_PENDING)
{
/* Wait for completion */
LeaveCriticalSection(&Socket->Lock);
SockWaitForSingleObject(ThreadData->EventHandle,
Socket->Handle,
NO_BLOCKING_HOOK,
NO_TIMEOUT);
EnterCriticalSection(&Socket->Lock);
/* Get new status */
Status = IoStatusBlock.Status;
@@ -411,7 +416,11 @@ WSPEnumNetworkEvents(IN SOCKET Handle,
error:
/* Dereference the socket, if we have one here */
if (Socket) SockDereferenceSocket(Socket);
if (Socket)
{
LeaveCriticalSection(&Socket->Lock);
SockDereferenceSocket(Socket);
}
/* Check for error */
if (ErrorCode != NO_ERROR)

View File

@@ -47,7 +47,7 @@ WSPListen(SOCKET Handle,
EnterCriticalSection(&Socket->Lock);
/* If the socket is connection-less, fail */
if (MSAFD_IS_DGRAM_SOCK(Socket));
if (MSAFD_IS_DGRAM_SOCK(Socket))
{
/* Fail */
ErrorCode = WSAEOPNOTSUPP;
@@ -61,9 +61,9 @@ WSPListen(SOCKET Handle,
ErrorCode = NO_ERROR;
goto error;
}
else if (Socket->SharedData.State != SocketConnected)
else if (Socket->SharedData.State != SocketBound)
{
/* If we're not connected, fail */
/* If we're not bound, fail */
ErrorCode = WSAEINVAL;
goto error;
}

View File

@@ -142,7 +142,7 @@ SockSetInformation(IN PSOCKET_INFORMATION Socket,
NULL,
NULL,
&IoStatusBlock,
IOCTL_AFD_GET_INFO,
IOCTL_AFD_SET_INFO,
&AfdInfo,
sizeof(AfdInfo),
NULL,

View File

@@ -13,7 +13,7 @@
(s->SharedData.AsyncEvents & e))
#define HANDLES_IN_SET(s) \
s == NULL ? 0 : (s->fd_count & 0xFFFF)
(((s) == NULL) ? 0 : ((s)->fd_count & 0xFFFF))
/* DATA **********************************************************************/
@@ -75,7 +75,7 @@ SockCheckAndInitAsyncSelectHelper(VOID)
}
/* Check if the port exists, and if not, create it */
if (SockAsyncQueuePort) SockCreateAsyncQueuePort();
if (!SockAsyncQueuePort) SockCreateAsyncQueuePort();
/*
* Now Set up the Completion Port Information
@@ -751,7 +751,9 @@ WSPSelect(INT nfds,
HandleArray->Handle = (SOCKET)readfds->fd_array[i];
HandleArray->Events = AFD_EVENT_RECEIVE |
AFD_EVENT_DISCONNECT |
AFD_EVENT_ABORT;
AFD_EVENT_CLOSE |
AFD_EVENT_ABORT |
AFD_EVENT_ACCEPT;
/* Move to the next one */
HandleArray++;
@@ -760,7 +762,7 @@ WSPSelect(INT nfds,
{
/* Fill out handle info */
HandleArray->Handle = (SOCKET)writefds->fd_array[i];
HandleArray->Events = AFD_EVENT_SEND;
HandleArray->Events = AFD_EVENT_SEND | AFD_EVENT_CONNECT;
/* Move to the next one */
HandleArray++;
@@ -776,7 +778,7 @@ WSPSelect(INT nfds,
}
/* Check if a timeout was given */
if (timeout)
if (!timeout)
{
/* Inifinte Timeout */
PollInfo->Timeout.u.LowPart = -1;

View File

@@ -377,6 +377,8 @@ WSPSendTo(SOCKET Handle,
/* Make sure it's still unbound */
if (Socket->SharedData.State == SocketOpen)
{
LeaveCriticalSection(&Socket->Lock);
/* Bind it */
ReturnValue = WSPBind(Handle,
Sockaddr,
@@ -387,10 +389,11 @@ WSPSendTo(SOCKET Handle,
{
/* It's bound now, fake success */
ReturnValue = NO_ERROR;
LeaveCriticalSection(&Socket->Lock);
}
/* Release the lock and free memory */
LeaveCriticalSection(&Socket->Lock);
/* Free memory */
RtlFreeHeap(SockPrivateHeap, 0, Sockaddr);
/* Check if we failed */

View File

@@ -694,6 +694,12 @@ WSPSocket(INT AddressFamily,
ProviderFlags = lpProtocolInfo->dwProviderFlags;
ProviderId = lpProtocolInfo->ProviderId;
/* HACK: We don't set this flag properly ATM */
if(SocketType == SOCK_DGRAM || SocketType == SOCK_RAW)
{
ServiceFlags |= XP1_CONNECTIONLESS;
}
/* Create the actual socket */
ErrorCode = SockSocket(AddressFamily,
SocketType,

View File

@@ -213,6 +213,8 @@ WSPIoctl(IN SOCKET Handle,
PSOCKET_INFORMATION Socket;
INT ErrorCode;
PWINSOCK_TEB_DATA ThreadData;
BOOLEAN Blocking;
BOOL NeedsCompletion;
/* Enter prolog */
ErrorCode = SockEnterApiFast(&ThreadData);
@@ -238,22 +240,63 @@ WSPIoctl(IN SOCKET Handle,
switch(dwIoControlCode) {
case FIONBIO:
/* Check if the Buffer is OK */
if(cbInBuffer < sizeof(ULONG))
if(cbInBuffer < sizeof(ULONG) || IS_INTRESOURCE(lpvInBuffer))
{
/* Fail */
ErrorCode = WSAEFAULT;
goto error;
}
return 0;
Blocking = (*(PULONG)lpvInBuffer) ? TRUE : FALSE;
Socket->SharedData.NonBlocking = Blocking;
ErrorCode = SockSetInformation(Socket,
AFD_INFO_BLOCKING_MODE,
&Blocking,
NULL,
NULL);
break;
case FIONREAD:
if(cbOutBuffer < sizeof(ULONG) || IS_INTRESOURCE(lpvOutBuffer))
{
*lpErrno = WSAEFAULT;
return SOCKET_ERROR;
}
ErrorCode = SockGetInformation(Socket,
AFD_INFO_RECEIVE_CONTENT_SIZE,
NULL,
0,
NULL,
(PULONG)lpvOutBuffer,
NULL);
if (ErrorCode == NO_ERROR) *lpcbBytesReturned = sizeof(ULONG);
break;
default:
/* Unsupported by us, give it to the helper */
ErrorCode = SockGetTdiHandles(Socket);
if (ErrorCode != NO_ERROR) goto error;
/* Unsupported for now */
*lpErrno = WSAEINVAL;
return SOCKET_ERROR;
/* Call the helper */
ErrorCode = Socket->HelperData->WSHIoctl(Socket->HelperContext,
Handle,
Socket->TdiAddressHandle,
Socket->TdiConnectionHandle,
dwIoControlCode,
lpvInBuffer,
cbInBuffer,
lpvOutBuffer,
cbOutBuffer,
lpcbBytesReturned,
lpOverlapped,
lpCompletionRoutine,
&NeedsCompletion);
break;
}
error:
@@ -563,17 +606,134 @@ WSPSetSockOpt(IN SOCKET Handle,
goto error;
}
/* FIXME: Write code */
/* Check the Level first */
switch (Level)
{
/* Handle SOL_SOCKET */
case SOL_SOCKET:
/* Now check the Option */
switch (OptionName)
{
case SO_RCVBUF:
/* Validate the size */
if (OptionLength < sizeof(INT))
{
/* Size is too small, fail */
ErrorCode = WSAEFAULT;
goto error;
}
/* Set the data */
Socket->SharedData.SizeOfRecvBuffer = *(PINT)OptionValue;
/* FIXME: Tell AFD */
break;
case SO_SNDBUF:
/* Validate the size */
if (OptionLength < sizeof(INT))
{
/* Size is too small, fail */
ErrorCode = WSAEFAULT;
goto error;
}
/* Set the data */
Socket->SharedData.SizeOfSendBuffer = *(PINT)OptionValue;
/* FIXME: Tell AFD */
break;
case SO_BROADCAST:
/* Validate the size */
if (OptionLength < sizeof(INT))
{
/* Size is too small, fail */
ErrorCode = WSAEFAULT;
goto error;
}
/* Set the data */
Socket->SharedData.Broadcast = *(PINT)OptionValue;
break;
case SO_DEBUG:
/* Validate the size */
if (OptionLength < sizeof(INT))
{
/* Size is too small, fail */
ErrorCode = WSAEFAULT;
goto error;
}
/* Set the data */
Socket->SharedData.Debug = *(PINT)OptionValue;
break;
case SO_CONDITIONAL_ACCEPT:
case SO_DONTLINGER:
case SO_DONTROUTE:
case SO_ERROR:
case SO_GROUP_PRIORITY:
case SO_KEEPALIVE:
case SO_LINGER:
case SO_OOBINLINE:
case SO_REUSEADDR:
/* Unsupported */
default:
/* Unsupported by us, give it to the helper */
ErrorCode = SockGetTdiHandles(Socket);
if (ErrorCode != NO_ERROR) goto error;
/* Call the helper */
ErrorCode = Socket->HelperData->WSHSetSocketInformation(Socket->HelperContext,
Handle,
Socket->TdiAddressHandle,
Socket->TdiConnectionHandle,
Level,
OptionName,
(PCHAR)OptionValue,
OptionLength);
if (ErrorCode != NO_ERROR) goto error;
break;
}
break;
default:
/* Unsupported by us, give it to the helper */
ErrorCode = SockGetTdiHandles(Socket);
if (ErrorCode != NO_ERROR) goto error;
/* Call the helper */
ErrorCode = Socket->HelperData->WSHSetSocketInformation(Socket->HelperContext,
Handle,
Socket->TdiAddressHandle,
Socket->TdiConnectionHandle,
Level,
OptionName,
(PCHAR)OptionValue,
OptionLength);
if (ErrorCode != NO_ERROR) goto error;
break;
}
error:
/* Check if this is the failure path */
if (ErrorCode != NO_ERROR)
{
/* Dereference and unlock the socket */
LeaveCriticalSection(&Socket->Lock);
SockDereferenceSocket(Socket);
/* Check if this is the failure path */
if (ErrorCode != NO_ERROR)
{
/* Return error */
*lpErrno = ErrorCode;
return SOCKET_ERROR;
@@ -581,9 +741,7 @@ error:
/* Update the socket's state in AFD */
ErrorCode = SockSetHandleContext(Socket);
if (ErrorCode != NO_ERROR) goto error;
/* Return success */
return NO_ERROR;
return ErrorCode;
}

View File

@@ -59,23 +59,43 @@ VOID
WSPAPI
NewIcfConnection(IN PSOCK_ICF_DATA IcfData)
{
BOOLEAN Failed = FALSE;
/* Load the ICF DLL */
IcfData->DllHandle = LoadLibraryW(L"hhnetcfg.dll");
IcfData->DllHandle = LoadLibraryW(L"hnetcfg.dll");
if (IcfData->DllHandle)
{
/* Get the entrypoints */
IcfData->IcfOpenDynamicFwPort = GetProcAddress(IcfData->DllHandle,
"IcfOpenDynamicFwPort");
if (!IcfData->IcfOpenDynamicFwPort)
{
DbgPrint("FIXME: Implement IcfOpenDynamicFwPort in hnetcfg.dll for MSWSOCK!\n");
Failed = TRUE;
}
IcfData->IcfConnect = (PICF_CONNECT)GetProcAddress(IcfData->DllHandle,
"IcfConnect");
if (!IcfData->IcfConnect)
{
DbgPrint("FIXME: Implement IcfConnect in hnetcfg.dll for MSWSOCK!\n");
Failed = TRUE;
}
IcfData->IcfDisconnect = GetProcAddress(IcfData->DllHandle,
"IcfDisconnect");
if (!IcfData->IcfDisconnect)
{
DbgPrint("FIXME: Implement IcfDisconnect in hnetcfg.dll for MSWSOCK!\n");
Failed = TRUE;
}
/* Now call IcfConnect */
if (!IcfData->IcfConnect(IcfData))
if (Failed || !IcfData->IcfConnect(IcfData))
{
/* We failed, release the library */
FreeLibrary(IcfData->DllHandle);
IcfData->DllHandle = NULL;
}
}
}
@@ -103,7 +123,7 @@ CloseIcfConnection(IN PSOCK_ICF_DATA IcfData)
if (IcfData->IcfHandle)
{
/* Call IcfDisconnect */
IcfData->IcfConnect(IcfData);
IcfData->IcfDisconnect(IcfData);
/* Release the library */
FreeLibrary(IcfData->DllHandle);

View File

@@ -169,12 +169,15 @@ typedef struct _WINSOCK_TEB_DATA
typedef INT
(WINAPI *PICF_CONNECT)(PVOID IcfData);
typedef INT
(WINAPI *PICF_DISCONNECT)(PVOID IcfData);
typedef struct _SOCK_ICF_DATA
{
HANDLE IcfHandle;
PVOID IcfOpenDynamicFwPort;
PICF_CONNECT IcfConnect;
PVOID IcfDisconnect;
PICF_DISCONNECT IcfDisconnect;
HINSTANCE DllHandle;
} SOCK_ICF_DATA, *PSOCK_ICF_DATA;
@@ -404,7 +407,7 @@ SockEnterApiFast(OUT PWINSOCK_TEB_DATA *ThreadData)
/* Make sure we aren't terminating and get our thread data */
if (!(SockProcessTerminating) &&
(SockWspStartupCount > 0) &&
((*ThreadData == NtCurrentTeb()->WinSockData)))
((*ThreadData = NtCurrentTeb()->WinSockData)))
{
/* Everything is good, return */
return NO_ERROR;

View File

@@ -105,7 +105,7 @@ NTSTATUS
NTAPI
RtlIpv4StringToAddressW(IN PCWSTR String,
IN BOOLEAN Strict,
OUT LPTSTR *Terminator,
OUT LPWSTR *Terminator,
OUT struct in_addr *Addr)
{
UNIMPLEMENTED;