65 PVOID HelperDLLContext;
73 TRACE(
"Creating Socket, getting TDI Name - AddressFamily (%d) SocketType (%d) Protocol (%d).\n",
129 TRACE(
"Unknown Protocol (%d). We will try SOCK_STREAM.\n",
Protocol);
149 TRACE(
"Unknown SocketType (%d). We will try IPPROTO_TCP.\n",
SocketType);
169 ERR(
"SockGetTdiName: Status %x\n",
Status);
223 TRACE(
"Connectionless socket\n");
363 ERR(
"Failed to open socket. Status 0x%08x\n",
Status);
416 TRACE(
"Success %x\n", Sock);
527 lpProtocolInfo->dwServiceFlags3 =
HandleToUlong(hDuplicatedSharedData);
528 lpProtocolInfo->dwServiceFlags4 =
HandleToUlong(hDuplicatedHandle);
608 ERR(
"MSAFD: Unhandled NTSTATUS value: 0x%x\n",
Status);
632 LONG LingerWait = -1;
652 ERR(
"NtCreateEvent failed: 0x%08x\n",
Status);
666 if (lpErrno) *lpErrno =
Status;
667 ERR(
"WSHNotify failed. Error 0x%#x\n",
Status);
676 WARN(
"Socket is closing.\n");
695 ULONG SendsInProgress;
720 if (!SendsInProgress)
734 WARN(
"Would block!\n");
749 LingerWait -= SleepWait;
771 sizeof(DisconnectInfo),
801 while (CurrentSocket->NextSocket)
803 if (CurrentSocket->NextSocket == Socket)
805 CurrentSocket->
NextSocket = CurrentSocket->NextSocket->NextSocket;
809 CurrentSocket = CurrentSocket->NextSocket;
847 const struct sockaddr *SocketAddress,
848 int SocketAddressLength,
870 if (!SocketAddress || SocketAddressLength < Socket->SharedData->SizeOfLocalAddress)
911 SocketAddressLength -
sizeof(SocketAddress->
sa_family));
971 if (lpErrno) *lpErrno =
Status;
1054 if (lpErrno) *lpErrno =
Status;
1076 ULONG PollBufferSize;
1089 if (readfds !=
NULL)
1091 for (
i = 0;
i < readfds->fd_count;
i++)
1093 FD_SET(readfds->fd_array[
i], &selectfds);
1096 if (writefds !=
NULL)
1098 for (
i = 0;
i < writefds->fd_count;
i++)
1100 FD_SET(writefds->fd_array[
i], &selectfds);
1103 if (exceptfds !=
NULL)
1105 for (
i = 0;
i < exceptfds->fd_count;
i++)
1107 FD_SET(exceptfds->fd_array[
i], &selectfds);
1113 if ( HandleCount == 0 )
1115 WARN(
"No handles! Returning SOCKET_ERROR\n", HandleCount);
1120 PollBufferSize =
sizeof(*PollInfo) + ((HandleCount - 1) *
sizeof(
AFD_HANDLE));
1122 TRACE(
"HandleCount: %u BufferSize: %u\n", HandleCount, PollBufferSize);
1128 Timeout.u.HighPart = 0x7FFFFFFF;
1129 TRACE(
"Infinite timeout\n");
1144 TRACE(
"Timeout: Orig %d.%06d kernel %d\n",
1160 ERR(
"NtCreateEvent failed, 0x%08x\n",
Status);
1187 if (readfds !=
NULL) {
1188 for (
i = 0;
i < readfds->fd_count;
i++)
1190 for (
j = 0;
j < HandleCount;
j++)
1195 if (
j >= HandleCount)
1197 ERR(
"Error while counting readfds %ld > %ld\n",
j, HandleCount);
1206 ERR(
"Invalid socket handle provided in readfds %d\n", readfds->fd_array[
i]);
1221 if (writefds !=
NULL)
1223 for (
i = 0;
i < writefds->fd_count;
i++)
1225 for (
j = 0;
j < HandleCount;
j++)
1230 if (
j >= HandleCount)
1232 ERR(
"Error while counting writefds %ld > %ld\n",
j, HandleCount);
1241 ERR(
"Invalid socket handle provided in writefds %d\n", writefds->fd_array[
i]);
1253 if (exceptfds !=
NULL)
1255 for (
i = 0;
i < exceptfds->fd_count;
i++)
1257 for (
j = 0;
j < HandleCount;
j++)
1262 if (
j > HandleCount)
1264 ERR(
"Error while counting exceptfds %ld > %ld\n",
j, HandleCount);
1273 TRACE(
"Invalid socket handle provided in exceptfds %d\n", exceptfds->fd_array[
i]);
1323 for (
i = 0;
i < HandleCount;
i++)
1327 for(
x = 1;
x;
x<<=1)
1332 TRACE(
"Invalid socket handle found %d\n",
Handle);
1345 TRACE(
"Event %x on handle %x\n",
1356 TRACE(
"Event %x on handle %x\n",
1363 TRACE(
"Event %x on handle %x\n",
1370 TRACE(
"Event %x on handle %x\n",
1379 TRACE(
"Event %x on handle %x\n",
1404 TRACE(
"*lpErrno = %x\n", *lpErrno);
1407 HandleCount = (readfds ? readfds->fd_count : 0) +
1408 (writefds && writefds != readfds ? writefds->fd_count : 0) +
1409 (exceptfds && exceptfds != readfds && exceptfds != writefds ? exceptfds->fd_count : 0);
1411 TRACE(
"%d events\n", HandleCount);
1419 SYSTEMTIME st1970 = { 1970, 1, 0, 1, 0, 0, 0, 0 };
1428 return (
DWORD)((
Time.ll - u1970.ll) / 10000000ULL);
1452 ULONG PendingDataLength = 0;
1453 PVOID CalleeDataBuffer;
1454 WSABUF CallerData, CalleeID, CallerID, CalleeData;
1460 UCHAR ReceiveBuffer[0x1A];
1475 if ((SocketAddress && !SocketAddressLength) ||
1476 (SocketAddressLength && !SocketAddress) ||
1477 (SocketAddressLength && *SocketAddressLength <
sizeof(
SOCKADDR)))
1529 0xA +
sizeof(*ListenReceiveData));
1544 if (lpfnCondition !=
NULL)
1560 sizeof(PendingAcceptData),
1562 sizeof(PendingAcceptData));
1580 if (PendingDataLength)
1600 sizeof(PendingAcceptData),
1641 CallerID.
len =
sizeof(*RemoteAddress);
1644 CallerData.
buf = PendingData;
1645 CallerData.
len = PendingDataLength;
1652 if (!CalleeDataBuffer) {
1655 CalleeData.
buf = CalleeDataBuffer;
1656 CalleeData.
len = 4096;
1666 CallBack = (lpfnCondition)(&CallerID,
1675 if (((CallBack ==
CF_ACCEPT) && GroupID) != 0)
1779 if (!AcceptSocketInfo)
1796 if( SocketAddressLength )
1797 *SocketAddressLength =
sizeof(*RemoteAddress);
1817 if (lpErrno) *lpErrno =
Status;
1831 const struct sockaddr * SocketAddress,
1832 int SocketAddressLength,
1844 ULONG ConnectDataLength;
1845 ULONG InConnectDataLength;
1846 INT BindAddressLength;
1849 int SocketDataLength;
1883 &BindAddressLength);
1890 if (lpCallerData !=
NULL)
1892 ConnectDataLength = lpCallerData->
len;
1947 if (lpCalleeData !=
NULL)
1949 InConnectDataLength = lpCalleeData->
len;
1956 &InConnectDataLength,
1957 sizeof(InConnectDataLength),
1973 ConnectInfo->
Root = 0;
1980 ERR(
"Async Connect UNIMPLEMENTED!\n");
2010 if (lpCalleeData !=
NULL)
2053 if (lpErrno) *lpErrno = Errno;
2067 if (lpErrno) *lpErrno = Errno;
2134 sizeof(DisconnectInfo),
2162 ULONG TdiAddressSize;
2177 if (!
Name || !NameLength)
2197 if ( TdiAddress ==
NULL )
2204 SocketAddress = &TdiAddress->
Address;
2236 TRACE(
"NameLength %d Address: %x Port %x\n",
2264 ULONG TdiAddressSize;
2284 if (!
Name || !NameLength)
2303 if ( SocketAddress ==
NULL )
2340 TRACE(
"NameLength %d Address: %x Port %x\n",
2421 NeedsCompletion =
FALSE;
2429 cbRet =
sizeof(
ULONG);
2433 if (cbOutBuffer <
sizeof(
ULONG))
2438 NeedsCompletion =
FALSE;
2442 cbRet =
sizeof(
ULONG);
2449 cbRet =
sizeof(
BOOL);
2453 if (cbOutBuffer <
sizeof(
BOOL))
2469 cbRet =
sizeof(
BOOL);
2474 if (cbOutBuffer == 0)
2476 cbRet =
sizeof(
PVOID);
2481 if (cbInBuffer <
sizeof(
GUID) ||
2482 cbOutBuffer <
sizeof(
PVOID))
2490 GUID ConnectExGUID = WSAID_CONNECTEX;
2491 GUID DisconnectExGUID = WSAID_DISCONNECTEX;
2497 cbRet =
sizeof(
PVOID);
2501 else if (
IsEqualGUID(&ConnectExGUID, lpvInBuffer))
2504 cbRet =
sizeof(
PVOID);
2508 else if (
IsEqualGUID(&DisconnectExGUID, lpvInBuffer))
2511 cbRet =
sizeof(
PVOID);
2515 else if (
IsEqualGUID(&GetAcceptExSockaddrsGUID, lpvInBuffer))
2518 cbRet =
sizeof(
PVOID);
2524 ERR(
"SIO_GET_EXTENSION_FUNCTION_POINTER UNIMPLEMENTED\n");
2529 ERR(
"Querying unknown extension function: %x\n", ((
GUID*)lpvInBuffer)->Data1);
2542 if (cbOutBuffer <
sizeof(
INT))
2576 lpCompletionRoutine,
2587 if (lpCompletionRoutine !=
NULL)
2601 if (lpcbBytesReturned)
2602 *lpcbBytesReturned = cbRet;
2632 if (!OptionLength || !OptionValue)
2750 DbgPrint(
"MSAFD: Get unknown optname %x\n", OptionName);
2778 (
LPINT)OptionLength);
2779 if (lpErrno) *lpErrno = Errno;
2816 if (optlen <
sizeof(
BOOL))
2825 if (optlen <
sizeof(
BOOL))
2834 if (optlen <
sizeof(
BOOL))
2843 if (optlen <
sizeof(
BOOL))
2852 if (optlen <
sizeof(
BOOL))
2861 if (optlen <
sizeof(
struct linger))
2872 if (optlen <
sizeof(
ULONG))
2896 if (optlen <
sizeof(
ULONG))
2903 if (*(
PULONG)optval > 0x2000)
2904 *(
PULONG)optval = 0x2000;
2924 if (optlen <
sizeof(
INT))
2936 if (optlen <
sizeof(
DWORD))
2948 if (optlen <
sizeof(
DWORD))
2966 ERR(
"MSAFD: Set unknown optname %x\n", optname);
2980 if (lpErrno) *lpErrno = Errno;
3007 if (((
LOBYTE(wVersionRequested) == 2) && (
HIBYTE(wVersionRequested) < 2)) ||
3008 (
LOBYTE(wVersionRequested) < 2))
3010 ERR(
"WSPStartup NOT SUPPORTED for version 0x%X\n", wVersionRequested);
3023 lpProcTable->lpWSPBind =
WSPBind;
3036 lpProcTable->lpWSPIoctl =
WSPIoctl;
3039 lpProcTable->lpWSPRecv =
WSPRecv;
3043 lpProcTable->lpWSPSend =
WSPSend;
3050 lpWSPData->wVersion =
MAKEWORD(2, 2);
3051 lpWSPData->wHighVersion =
MAKEWORD(2, 2);
3074 if (!lpsaAddress || !lpszAddressString || !lpdwAddressStringLength)
3080 switch (lpsaAddress->sa_family)
3090 (
unsigned int)(
ntohl(((
SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 24 & 0xff),
3091 (
unsigned int)(
ntohl(((
SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 16 & 0xff),
3092 (
unsigned int)(
ntohl(((
SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 8 & 0xff),
3093 (
unsigned int)(
ntohl(((
SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) & 0xff),
3109 if (*lpdwAddressStringLength <
size)
3111 *lpdwAddressStringLength =
size;
3116 *lpdwAddressStringLength =
size;
3132 LONG inetaddr = 0, ip_part;
3136 if (!lpAddressLength || !lpAddress || !AddressString)
3145 if (lpProtocolInfo !=
NULL)
3147 sockaddr->sin_family = lpProtocolInfo->iAddressFamily;
3166 bp = &AddressString;
3169 while (*bp < &AddressString[
wcslen(AddressString)])
3171 ip_part =
wcstol(*bp, bp, 10);
3173 if (ip_part < 0 || ip_part > 255)
3178 inetaddr = (inetaddr << 8) + ip_part;
3180 if ((*bp)[0] == 0 || (*bp)[0] ==
L':')
3183 if ((*bp)[0] !=
L'.')
3202 if ((*bp)[0] ==
L':')
3207 if ((*bp)[0] <
L'0' || (*bp)[0] >
L'9')
3222 *lpAddressLength =
sizeof(*sockaddr);
3225 sockaddr->sin_addr.s_addr = inetaddr;
3230 if (lpErrno && !*lpErrno)
3250 TRACE(
"Leaving.\n");
3271 ULONG AfdInformationClass,
3300 if (Overlapped ==
NULL)
3313 TRACE(
"Opened without flag WSA_FLAG_OVERLAPPED. Do nothing.\n");
3322 Event = Overlapped->hEvent;
3331 ERR(
"Not enough memory for APC Context\n");
3370 TRACE(
"Leaving (Pending)\n");
3382 if (LargeInteger !=
NULL)
3386 if (Boolean !=
NULL)
3398 ULONG AfdInformationClass,
3431 if (LargeInteger !=
NULL)
3435 if (Boolean !=
NULL)
3441 if (Overlapped ==
NULL)
3454 TRACE(
"Opened without flag WSA_FLAG_OVERLAPPED. Do nothing.\n");
3463 Event = Overlapped->hEvent;
3472 ERR(
"Not enough memory for APC Context\n");
3511 TRACE(
"Leaving (Pending)\n");
3527 while (CurrentSocket)
3532 return CurrentSocket;
3577 sizeof(ContextData),
3596 DWORD AsyncThreadId;
3617 ERR(
"Failed to create completion port: 0x%08x\n",
Status);
3624 ObjectHandleFlagInformation,
3626 sizeof(HandleFlags));
3668 (
PVOID*)&AsyncCompletionRoutine,
3675 (*AsyncCompletionRoutine)(AsyncContext, &IOSB);
3732 sizeof(CompletionInfo),
3740 ObjectHandleFlagInformation,
3742 sizeof(HandleFlags));
3773 for (
x = 1;
x;
x<<=1)
3882 ULONG lNetworkEvents;
3907 if (lNetworkEvents &
FD_OOB)
3928 if (lNetworkEvents &
FD_QOS)
3981 FreeContext =
FALSE;
4002 if (!(Socket->SharedData->AsyncDisabledEvents &
Event))
4008 Socket->SharedData->AsyncDisabledEvents &=
~Event;
4011 if ((Socket->SharedData->AsyncEvents & (~Socket->SharedData->AsyncDisabledEvents)) == 0 )
4018 if (!AsyncData)
return;
4024 Socket->SharedData->SequenceNumber++;
4052 TRACE(
"Loading MSAFD.DLL \n");
4067 TRACE(
"MSAFD.DLL has been loaded\n");
4085 TRACE(
"DllMain of msafd.dll (leaving)\n");
#define InterlockedIncrement
#define InterlockedDecrement
#define UlongToHandle(ul)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
BOOL WINAPI DllMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
#define DLL_THREAD_DETACH
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define INVALID_HANDLE_VALUE
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define DLL_THREAD_ATTACH
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
INT WSPAPI WSPAddressToString(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, OUT LPINT lpErrno)
int WSPAPI WSPListen(SOCKET Handle, int Backlog, LPINT lpErrno)
INT WSPAPI WSPSetSockOpt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen, OUT LPINT lpErrno)
VOID SockAsyncSelectCompletionRoutine(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
INT WSPAPI WSPCleanup(OUT LPINT lpErrno)
int GetSocketInformation(PSOCKET_INFORMATION Socket, ULONG AfdInformationClass, PBOOLEAN Boolean OPTIONAL, PULONG Ulong OPTIONAL, PLARGE_INTEGER LargeInteger OPTIONAL, LPWSAOVERLAPPED Overlapped OPTIONAL, LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL)
int WSPAPI WSPConnect(SOCKET Handle, const struct sockaddr *SocketAddress, int SocketAddressLength, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, LPINT lpErrno)
INT WSPAPI WSPGetSockOpt(IN SOCKET Handle, IN INT Level, IN INT OptionName, OUT CHAR FAR *OptionValue, IN OUT LPINT OptionLength, OUT LPINT lpErrno)
HANDLE SockAsyncCompletionPort
INT WSPAPI WSPBind(SOCKET Handle, const struct sockaddr *SocketAddress, int SocketAddressLength, LPINT lpErrno)
BOOLEAN SockCreateOrReferenceAsyncThread(VOID)
VOID SockProcessAsyncSelect(PSOCKET_INFORMATION Socket, PASYNC_DATA AsyncData)
LIST_ENTRY SockHelpersListHead
HANDLE SockAsyncHelperAfdHandle
DWORD GetCurrentTimeInSeconds(VOID)
PSOCKET_INFORMATION GetSocketStructure(SOCKET Handle)
INT WSPAPI WSPGetPeerName(IN SOCKET s, OUT LPSOCKADDR Name, IN OUT LPINT NameLength, OUT LPINT lpErrno)
int WSPAPI WSPSelect(IN int nfds, IN OUT fd_set *readfds OPTIONAL, IN OUT fd_set *writefds OPTIONAL, IN OUT fd_set *exceptfds OPTIONAL, IN const struct timeval *timeout OPTIONAL, OUT LPINT lpErrno)
int CreateContext(PSOCKET_INFORMATION Socket)
VOID SockProcessQueuedAsyncSelect(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
int SetSocketInformation(PSOCKET_INFORMATION Socket, ULONG AfdInformationClass, PBOOLEAN Boolean OPTIONAL, PULONG Ulong OPTIONAL, PLARGE_INTEGER LargeInteger OPTIONAL, LPWSAOVERLAPPED Overlapped OPTIONAL, LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine OPTIONAL)
INT WSPAPI WSPDuplicateSocket(IN SOCKET Handle, IN DWORD dwProcessId, OUT LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPINT lpErrno)
ULONG NTAPI SockAsyncThread(PVOID ThreadParam)
int WSPAPI WSPShutdown(SOCKET Handle, int HowTo, LPINT lpErrno)
INT WSPAPI WSPStringToAddress(IN LPWSTR AddressString, IN INT AddressFamily, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength, OUT LPINT lpErrno)
_Must_inspect_result_ int WSPAPI WSPStartup(_In_ WORD wVersionRequested, _In_ LPWSPDATA lpWSPData, _In_ LPWSAPROTOCOL_INFOW lpProtocolInfo, _In_ WSPUPCALLTABLE UpcallTable, _Out_ LPWSPPROC_TABLE lpProcTable)
INT WSPAPI WSPIoctl(IN SOCKET Handle, IN DWORD dwIoControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
ULONG SockAsyncThreadRefCount
INT WSPAPI WSPCloseSocket(IN SOCKET Handle, OUT LPINT lpErrno)
INT TranslateNtStatusError(NTSTATUS Status)
_Must_inspect_result_ SOCKET WSPAPI WSPAccept(_In_ SOCKET Handle, _Out_writes_bytes_to_opt_(*addrlen, *addrlen) struct sockaddr FAR *SocketAddress, _Inout_opt_ LPINT SocketAddressLength, _In_opt_ LPCONDITIONPROC lpfnCondition, _In_opt_ DWORD_PTR dwCallbackData, _Out_ LPINT lpErrno)
SOCKET WSPAPI WSPSocket(int AddressFamily, int SocketType, int Protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags, LPINT lpErrno)
VOID NTAPI AfdInfoAPC(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved)
INT WSPAPI WSPGetSockName(IN SOCKET Handle, OUT LPSOCKADDR Name, IN OUT LPINT NameLength, OUT LPINT lpErrno)
BOOLEAN SockAsyncSelectCalled
VOID SockReenableAsyncSelectEvent(IN PSOCKET_INFORMATION Socket, IN ULONG Event)
BOOLEAN SockGetAsyncSelectHelperAfdHandle(VOID)
PSOCKET_INFORMATION SocketListHead
CRITICAL_SECTION SocketListLock
LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest
INT WSPAPI WSPEnumNetworkEvents(IN SOCKET Handle, IN WSAEVENT hEventObject, OUT LPWSANETWORKEVENTS lpNetworkEvents, OUT LPINT lpErrno)
int WSPAPI WSPEventSelect(IN SOCKET Handle, IN WSAEVENT hEventObject, IN long lNetworkEvents, OUT LPINT lpErrno)
INT WSPAPI WSPCancelBlockingCall(OUT LPINT lpErrno)
BOOL WSPAPI WSPConnectEx(IN SOCKET s, IN const struct sockaddr *name, IN int namelen, IN PVOID lpSendBuffer, IN DWORD dwSendDataLength, OUT LPDWORD lpdwBytesSent, IN OUT LPOVERLAPPED lpOverlapped)
BOOL WSPAPI WSPAcceptEx(IN SOCKET sListenSocket, IN SOCKET sAcceptSocket, OUT PVOID lpOutputBuffer, IN DWORD dwReceiveDataLength, IN DWORD dwLocalAddressLength, IN DWORD dwRemoteAddressLength, OUT LPDWORD lpdwBytesReceived, IN OUT LPOVERLAPPED lpOverlapped)
VOID WSPAPI WSPGetAcceptExSockaddrs(IN PVOID lpOutputBuffer, IN DWORD dwReceiveDataLength, IN DWORD dwLocalAddressLength, IN DWORD dwRemoteAddressLength, OUT struct sockaddr **LocalSockaddr, OUT LPINT LocalSockaddrLength, OUT struct sockaddr **RemoteSockaddr, OUT LPINT RemoteSockaddrLength)
BOOL WSPAPI WSPDisconnectEx(IN SOCKET hSocket, IN LPOVERLAPPED lpOverlapped, IN DWORD dwFlags, IN DWORD reserved)
SOCKET WSPAPI WSPJoinLeaf(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, IN LPQOS lpGQOS, IN DWORD dwFlags, OUT LPINT lpErrno)
BOOL WSPAPI WSPGetQOSByName(IN SOCKET s, IN OUT LPWSABUF lpQOSName, OUT LPQOS lpQOS, OUT LPINT lpErrno)
enum _SOCKET_STATE SOCKET_STATE
FORCEINLINE DWORD MsafdReturnWithErrno(NTSTATUS Status, LPINT Errno, DWORD Received, LPDWORD ReturnedBytes)
struct _AFDAPCCONTEXT * PAFDAPCCONTEXT
VOID(* PASYNC_COMPLETION_ROUTINE)(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
#define SO_SYNCHRONOUS_NONALERT
struct _IO_STATUS_BLOCK * PIO_STATUS_BLOCK
#define InitializeListHead(ListHead)
@ FileCompletionInformation
struct _FILE_FULL_EA_INFORMATION FILE_FULL_EA_INFORMATION
GLint GLint GLint GLint GLint x
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
int SockGetTdiName(PINT AddressFamily, PINT SocketType, PINT Protocol, GROUP Group, DWORD Flags, PUNICODE_STRING TransportName, PVOID *HelperDllContext, PHELPER_DATA *HelperDllData, PDWORD Events)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG)
NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT, INT)
#define PROCESS_DUP_HANDLE
NTSTATUS NTAPI NtSetIoCompletion(IN HANDLE IoCompletionPortHandle, IN PVOID CompletionKey, IN PVOID CompletionContext, IN NTSTATUS CompletionStatus, IN ULONG CompletionInformation)
NTSTATUS NTAPI NtRemoveIoCompletion(IN HANDLE IoCompletionHandle, OUT PVOID *KeyContext, OUT PVOID *ApcContext, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER Timeout OPTIONAL)
NTSTATUS NTAPI NtCreateIoCompletion(OUT PHANDLE IoCompletionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG NumberOfConcurrentThreads)
BOOL WINAPI PostQueuedCompletionStatus(IN HANDLE CompletionHandle, IN DWORD dwNumberOfBytesTransferred, IN ULONG_PTR dwCompletionKey, IN LPOVERLAPPED lpOverlapped)
_In_ BOOL _In_ HANDLE hProcess
#define IO_COMPLETION_ALL_ACCESS
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
static PLARGE_INTEGER Time
#define WSAID_GETACCEPTEXSOCKADDRS
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
IN PCO_ADDRESS_FAMILY AddressFamily
_In_opt_ HANDLE _In_opt_ PIO_APC_ROUTINE _In_opt_ PVOID ApcContext
#define _Must_inspect_result_
#define _Out_writes_bytes_to_opt_(s, c)