8#define NO_BLOCKING_HOOK 0
9#define MAYBE_BLOCKING_HOOK 1
10#define ALWAYS_BLOCKING_HOOK 2
16#define MAX_TDI_ADDRESS_LENGTH 32
18#define WSA_FLAG_MULTIPOINT_ALL (WSA_FLAG_MULTIPOINT_C_ROOT |\
19 WSA_FLAG_MULTIPOINT_C_LEAF |\
20 WSA_FLAG_MULTIPOINT_D_ROOT |\
21 WSA_FLAG_MULTIPOINT_D_LEAF)
270 IN INT SocketAddressLength);
297 IN INT SockaddrLength);
430#define MSAFD_IS_DGRAM_SOCK(s) \
431 (s->SharedData.ServiceFlags1 & XP1_CONNECTIONLESS)
506 PVOID *HelperDllContext,
#define InterlockedDecrement
_Inout_ PVCB _In_ BOOLEAN Force
_In_ const GUID _In_ ULONG ExtraDataSize
enum _SOCKET_STATE SOCKET_STATE
static PVOID Mapping[EMS_PHYSICAL_PAGES]
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
GLuint GLuint GLsizei GLenum type
GLenum const GLvoid * addr
static OUT PIO_STATUS_BLOCK IoStatusBlock
INT WSPAPI WSPAddressToString(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, OUT LPINT lpErrno)
VOID WSPAPI SockProcessAsyncSelect(PSOCKET_INFORMATION Socket, PASYNC_DATA AsyncData)
DWORD SockReceiveBufferWindow
INT WSPAPI WSPSetSockOpt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen, OUT LPINT lpErrno)
VOID WSPAPI SockReleaseRwLockExclusive(IN PSOCK_RW_LOCK Lock)
HINSTANCE SockModuleHandle
LPWSPUPCALLTABLE SockUpcallTable
VOID WSPAPI SockAsyncSelectCompletion(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
INT WSPAPI WSPCancelBlockingCall(OUT LPINT lpErrno)
VOID WSPAPI SockSanInitialize(VOID)
VOID WSPAPI SockAcquireRwLockExclusive(IN PSOCK_RW_LOCK Lock)
INT WSPAPI WSPShutdown(IN SOCKET s, IN INT how, OUT LPINT lpErrno)
INT WSPAPI WSPSendDisconnect(IN SOCKET s, IN LPWSABUF lpOutboundDisconnectData, OUT LPINT lpErrno)
INT WSPAPI WSPCleanup(OUT LPINT lpErrno)
INT WSPAPI SockBuildSockaddr(OUT PSOCKADDR Sockaddr, OUT PINT SockaddrLength, IN PTRANSPORT_ADDRESS TdiAddress)
VOID WSPAPI SockIoCompletion(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, DWORD Reserved)
struct _SOCK_SHARED_INFO * PSOCK_SHARED_INFO
INT WSPAPI WSPEnumNetworkEvents(IN SOCKET s, IN WSAEVENT hEventObject, OUT LPWSANETWORKEVENTS lpNetworkEvents, OUT LPINT lpErrno)
struct _SOCKET_INFORMATION * PSOCKET_INFORMATION
INT WSPAPI SockAsyncThread(PVOID ThreadParam)
struct _WINSOCK_TEB_DATA * PWINSOCK_TEB_DATA
struct _WINSOCK_TEB_DATA WINSOCK_TEB_DATA
struct _SOCK_ICF_DATA * PSOCK_ICF_DATA
INT WSPAPI WSPSendTo(IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN CONST SOCKADDR *lpTo, IN INT iTolen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
VOID WSPAPI NewIcfConnection(IN PSOCK_ICF_DATA IcfData)
VOID WSPAPI CloseIcfConnection(IN PSOCK_ICF_DATA IcfData)
struct _ASYNC_DATA ASYNC_DATA
PWAH_HANDLE_TABLE SockContextTable
PVOID WSPAPI SockInitializeHeap(IN HANDLE Heap, IN ULONG Flags, IN ULONG Size)
INT WSPAPI WSPCloseSocket(IN SOCKET s, OUT LPINT lpErrno)
INT WSPAPI SockEventSelectHelper(IN PSOCKET_INFORMATION Socket, IN WSAEVENT EventObject, IN LONG Events)
VOID WSPAPI SockReleaseRwLockShared(IN PSOCK_RW_LOCK Lock)
INT WSPAPI SockGetTdiName(PINT AddressFamily, PINT SocketType, PINT Protocol, LPGUID ProviderId, GROUP Group, DWORD Flags, PUNICODE_STRING TransportName, PVOID *HelperDllContext, PHELPER_DATA *HelperDllData, PDWORD Events)
HANDLE SockSanCleanUpCompleteEvent
INT WSPAPI WSPRecvFrom(IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, OUT LPSOCKADDR lpFrom, IN OUT LPINT lpFromlen, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
SOCKET WSPAPI WSPSocket(IN INT af, IN INT type, IN INT protocol, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, IN GROUP g, IN DWORD dwFlags, OUT LPINT lpErrno)
struct _SOCKET_INFORMATION SOCKET_INFORMATION
VOID WSPAPI SockCancelIo(IN SOCKET Handle)
enum _SOCKET_STATE SOCKET_STATE
CRITICAL_SECTION MSWSOCK_SocketLock
INT WSPAPI SockEnterApiSlow(OUT PWINSOCK_TEB_DATA *ThreadData)
INT WSPAPI WSPGetPeerName(IN SOCKET s, OUT LPSOCKADDR name, IN OUT LPINT namelen, OUT LPINT lpErrno)
VOID WSPAPI SockProcessQueuedAsyncSelect(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
LONG SockProcessPendingAPCCount
BOOL WSPAPI MSWSOCK_Initialize(VOID)
BOOLEAN WSPAPI SockCheckAndInitAsyncSelectHelper(VOID)
BOOLEAN WSPAPI SockCheckAndReferenceAsyncThread(VOID)
SOCK_RW_LOCK SocketGlobalLock
INT WSPAPI WSPRecv(IN SOCKET s, IN OUT LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesRecvd, IN OUT LPDWORD lpFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
BOOL SockProcessTerminating
PVOID(NTAPI * PRTL_HEAP_ALLOCATE)(IN HANDLE Heap, IN ULONG Flags, IN ULONG Size)
BOOL WSPAPI MSAFD_SockThreadInitialize(VOID)
PRTL_HEAP_ALLOCATE SockAllocateHeapRoutine
INT WSPAPI WSPAsyncSelect(IN SOCKET s, IN HWND hWnd, IN UINT wMsg, IN LONG lEvent, OUT LPINT lpErrno)
struct _SOCK_RW_LOCK * PSOCK_RW_LOCK
INT WSPAPI WSPGetSockOpt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT LPINT optlen, OUT LPINT lpErrno)
VOID WSPAPI SockHandleAsyncIndication(IN PASYNC_COMPLETION_ROUTINE Callback, IN PVOID Context, IN PIO_STATUS_BLOCK IoStatusBlock)
INT WSPAPI SockLoadTransportMapping(PWSTR TransportName, PWINSOCK_MAPPING *Mapping)
INT WSPAPI SockSetHandleContext(IN PSOCKET_INFORMATION Socket)
BOOLEAN WSPAPI SockIsSocketConnected(IN PSOCKET_INFORMATION Socket)
struct _ASYNC_DATA * PASYNC_DATA
INT(WINAPI * PICF_CONNECT)(PVOID IcfData)
NTSTATUS WSPAPI SockInitializeRwLockAndSpinCount(IN PSOCK_RW_LOCK Lock, IN ULONG SpinCount)
INT WSPAPI WSPGetSockName(IN SOCKET s, OUT LPSOCKADDR name, IN OUT LPINT namelen, OUT LPINT lpErrno)
ULONG SockBufferKeyTableSize
enum _SOCKET_STATE * PSOCKET_STATE
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)
INT WSPAPI WSPIoctl(IN SOCKET s, 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)
INT WSPAPI NtStatusToSocketError(IN NTSTATUS Status)
VOID WSPAPI SockAcquireRwLockShared(IN PSOCK_RW_LOCK Lock)
HANDLE SockAsyncQueuePort
NTSTATUS WSPAPI SockDeleteRwLock(IN PSOCK_RW_LOCK Lock)
DWORD SockSendBufferWindow
INT WSPAPI WSPDuplicateSocket(IN SOCKET s, IN DWORD dwProcessId, OUT LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPINT lpErrno)
LIST_ENTRY SockHelperDllListHead
INT WSPAPI SockLoadHelperDll(PWSTR TransportName, PWINSOCK_MAPPING Mapping, PHELPER_DATA *HelperDllData)
INT WSPAPI SockIsAddressConsistentWithConstrainedGroup(IN PSOCKET_INFORMATION Socket, IN GROUP Group, IN PSOCKADDR SocketAddress, IN INT SocketAddressLength)
struct _HELPER_DATA * PHELPER_DATA
INT WSPAPI WSPListen(IN SOCKET s, IN INT backlog, OUT LPINT lpErrno)
INT WSPAPI WSPSend(IN SOCKET s, IN LPWSABUF lpBuffers, IN DWORD dwBufferCount, OUT LPDWORD lpNumberOfBytesSent, IN DWORD dwFlags, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno)
INT WSPAPI SockReenableAsyncSelectEvent(IN PSOCKET_INFORMATION Socket, IN ULONG Event)
INT WSPAPI SockLoadTransportList(PWSTR *TransportList)
INT WSPAPI SockGetTdiHandles(IN PSOCKET_INFORMATION Socket)
INT WSPAPI WSPStringToAddress(IN LPWSTR AddressString, IN INT AddressFamily, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength, OUT LPINT lpErrno)
BOOL WSPAPI WSPGetOverlappedResult(IN SOCKET s, IN LPWSAOVERLAPPED lpOverlapped, OUT LPDWORD lpcbTransfer, IN BOOL fWait, OUT LPDWORD lpdwFlags, OUT LPINT lpErrno)
FORCEINLINE VOID WSPAPI SockDereferenceHelperDll(IN PHELPER_DATA Helper)
INT WSPAPI SockSetInformation(IN PSOCKET_INFORMATION Socket, IN ULONG AfdInformationClass, IN PBOOLEAN Boolean OPTIONAL, IN PULONG Ulong OPTIONAL, IN PLARGE_INTEGER LargeInteger OPTIONAL)
VOID(WSPAPI * PASYNC_COMPLETION_ROUTINE)(PVOID Context, PIO_STATUS_BLOCK IoStatusBlock)
INT WSPAPI SockAsyncSelectHelper(IN PSOCKET_INFORMATION Socket, IN HWND hWnd, IN UINT wMsg, IN LONG Events)
SOCKET WSPAPI WSPAccept(IN SOCKET s, OUT LPSOCKADDR addr, IN OUT LPINT addrlen, IN LPCONDITIONPROC lpfnCondition, IN DWORD dwCallbackData, OUT LPINT lpErrno)
struct _SOCKET_CONTEXT SOCKET_CONTEXT
INT WSPAPI SockCreateAsyncQueuePort(VOID)
INT WSPAPI SockCloseSocket(IN PSOCKET_INFORMATION Socket)
VOID WSPAPI SockFreeHelperDll(IN PHELPER_DATA Helper)
INT WSPAPI WSPBind(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, OUT LPINT lpErrno)
BOOL WSPAPI SockWaitForSingleObject(IN HANDLE Handle, IN SOCKET SocketHandle, IN DWORD BlockingFlags, IN DWORD TimeoutFlags)
PSOCKET_INFORMATION WSPAPI SockFindAndReferenceSocket(IN SOCKET Handle, IN BOOLEAN Import)
INT WSPAPI SockSocket(INT AddressFamily, INT SocketType, INT Protocol, LPGUID ProviderId, GROUP g, DWORD dwFlags, DWORD ProviderFlags, DWORD ServiceFlags, DWORD CatalogEntryId, PSOCKET_INFORMATION *NewSocket)
BOOL WSPAPI WSPGetQOSByName(IN SOCKET s, IN OUT LPWSABUF lpQOSName, OUT LPQOS lpQOS, OUT LPINT lpErrno)
HINSTANCE NlsMsgSourcemModuleHandle
INT WSPAPI WSPConnect(IN SOCKET s, IN CONST SOCKADDR *name, IN INT namelen, IN LPWSABUF lpCallerData, OUT LPWSABUF lpCalleeData, IN LPQOS lpSQOS, IN LPQOS lpGQOS, OUT LPINT lpErrno)
INT WSPAPI SockGetInformation(IN PSOCKET_INFORMATION Socket, IN ULONG AfdInformationClass, IN PVOID ExtraData OPTIONAL, IN ULONG ExtraDataSize, IN OUT PBOOLEAN Boolean OPTIONAL, IN OUT PULONG Ulong OPTIONAL, IN OUT PLARGE_INTEGER LargeInteger OPTIONAL)
struct _SOCK_ICF_DATA SOCK_ICF_DATA
FORCEINLINE INT WSPAPI SockEnterApiFast(OUT PWINSOCK_TEB_DATA *ThreadData)
struct _SOCK_RW_LOCK SOCK_RW_LOCK
INT WSPAPI SockGetConnectData(IN PSOCKET_INFORMATION Socket, IN ULONG Ioctl, IN PVOID Buffer, IN ULONG BufferLength, OUT PULONG BufferReturned)
INT WSPAPI WSPEventSelect(IN SOCKET s, IN WSAEVENT hEventObject, IN LONG lNetworkEvents, OUT LPINT lpErrno)
struct _SOCK_SHARED_INFO SOCK_SHARED_INFO
VOID WSPAPI SockSanGetTcpipCatalogId(VOID)
struct _SOCKET_CONTEXT * PSOCKET_CONTEXT
VOID WSPAPI SockDereferenceSocket(IN PSOCKET_INFORMATION Socket)
BOOL WSPAPI SockIsTripleInMapping(IN PWINSOCK_MAPPING Mapping, IN INT AddressFamily, OUT PBOOLEAN AfMatch, IN INT SocketType, OUT PBOOLEAN SockMatch, IN INT Protocol, OUT PBOOLEAN ProtoMatch)
WSAPROTOCOL_INFOW SockTcpProviderInfo
BOOLEAN SockAsyncSelectCalled
INT WSPAPI WSPRecvDisconnect(IN SOCKET s, OUT LPWSABUF lpInboundDisconnectData, OUT LPINT lpErrno)
INT WSPAPI WSPSelect(IN INT nfds, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST LPTIMEVAL timeout, OUT LPINT lpErrno)
LONG SockAsyncThreadReferenceCount
struct _HELPER_DATA HELPER_DATA
CRITICAL_SECTION g_RnrLock
INT WSPAPI SockBuildTdiAddress(OUT PTRANSPORT_ADDRESS TdiAddress, IN PSOCKADDR Sockaddr, IN INT SockaddrLength)
VOID WSPAPI InitializeIcfConnection(IN PSOCK_ICF_DATA IcfData)
INT WSPAPI SockNotifyHelperDll(IN PSOCKET_INFORMATION Socket, IN DWORD Event)
INT WSPAPI SockUpdateWindowSizes(IN PSOCKET_INFORMATION Socket, IN BOOLEAN Force)
_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
PULONG MinorVersion OPTIONAL
AFD_POLL_INFO AsyncSelectInfo
struct _SOCKET_INFORMATION * ParentSocket
IO_STATUS_BLOCK IoStatusBlock
BOOLEAN UseDelayedAcceptance
PWSH_GET_SOCKADDR_TYPE WSHGetSockaddrType
PWSH_JOIN_LEAF WSHJoinLeaf
PWSH_GET_SOCKET_INFORMATION WSHGetSocketInformation
PWSH_STRING_TO_ADDRESS WSHStringToAddress
PWSH_ADDRESS_TO_STRING WSHAddressToString
PWSH_OPEN_SOCKET WSHOpenSocket
PWSH_SET_SOCKET_INFORMATION WSHSetSocketInformation
PWSH_GET_BROADCAST_SOCKADDR WSHGetBroadcastSockaddr
PWSH_OPEN_SOCKET2 WSHOpenSocket2
PWSH_GET_WILDCARD_SOCKADDR WSHGetWildcardSockaddr
SOCK_SHARED_INFO SharedData
PVOID IcfOpenDynamicFwPort
volatile LONG ReaderCount
RTL_CRITICAL_SECTION Lock
PAFD_ACCEPT_DATA AcceptData
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_Reserved_ PVOID Reserved
_In_ DWORD dwIoControlCode
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
int(CALLBACK * LPCONDITIONPROC)(IN LPWSABUF lpCallerId, IN LPWSABUF lpCallerData, IN OUT LPQOS lpSQOS, IN OUT LPQOS lpGQOS, IN LPWSABUF lpCalleeId, IN LPWSABUF lpCalleeData, OUT GROUP FAR *g, IN DWORD_PTR dwCallbackData)
INT(WINAPI * PWSH_GET_BROADCAST_SOCKADDR)(PVOID, PSOCKADDR, PINT)
INT(WINAPI * PWSH_GET_WILDCARD_SOCKADDR)(PVOID, PSOCKADDR, PINT)
INT(WINAPI * PWSH_SET_SOCKET_INFORMATION)(PVOID, SOCKET, HANDLE, HANDLE, INT, INT, PCHAR, INT)
INT(WINAPI * PWSH_GET_SOCKADDR_TYPE)(PSOCKADDR, DWORD, PSOCKADDR_INFO)
INT(WINAPI * PWSH_OPEN_SOCKET2)(PINT, PINT, PINT, GROUP, DWORD, PUNICODE_STRING, PVOID *, PDWORD)
INT(WINAPI * PWSH_NOTIFY)(PVOID, SOCKET, HANDLE, HANDLE, DWORD)
INT(WINAPI * PWSH_JOIN_LEAF)(PVOID, SOCKET, HANDLE, HANDLE, PVOID, SOCKET, PSOCKADDR, DWORD, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD)
INT(WINAPI * PWSH_STRING_TO_ADDRESS)(LPWSTR, DWORD, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPDWORD)
INT(WINAPI * PWSH_OPEN_SOCKET)(PINT, PINT, PINT, PUNICODE_STRING, PVOID, PDWORD)
INT(WINAPI * PWSH_IOCTL)(PVOID, SOCKET, HANDLE, HANDLE, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE, LPBOOL)
INT(WINAPI * PWSH_ADDRESS_TO_STRING)(LPSOCKADDR, INT, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD)
INT(WINAPI * PWSH_GET_SOCKET_INFORMATION)(PVOID, SOCKET, HANDLE, HANDLE, INT, INT, PCHAR, LPINT)
_Must_inspect_result_ _In_ ULONG Flags