37#define MAKE_WSK_VERSION(Mj, Mn) ((USHORT)((Mj) << 8) | (USHORT)((Mn) & 0xff))
38#define WSK_MAJOR_VERSION(V) ((UCHAR)((V) >> 8))
39#define WSK_MINOR_VERSION(V) ((UCHAR)(V))
40#define WSK_FLAG_AT_DISPATCH_LEVEL 0x00000008
41#define WSK_FLAG_RELEASE_ASAP 0x00000002
42#define WSK_FLAG_ENTIRE_MESSAGE 0x00000004
43#define WSK_FLAG_ABORTIVE 0x00000001
44#define WSK_FLAG_BASIC_SOCKET 0x00000000
45#define WSK_FLAG_LISTEN_SOCKET 0x00000001
46#define WSK_FLAG_CONNECTION_SOCKET 0x00000002
47#define WSK_FLAG_DATAGRAM_SOCKET 0x00000004
48#define WSK_TRANSPORT_LIST_QUERY 2
49#define WSK_TRANSPORT_LIST_CHANGE 3
51#define WSK_RELEASE_SD 5
52#define WSK_TDI_DEVICENAME_MAPPING 6
53#define WSK_SET_STATIC_EVENT_CALLBACKS 7
54#define WSK_TDI_BEHAVIOR 8
55#define WSK_TDI_BEHAVIOR_BYPASS_TDI 0x00000001
56#define SO_WSK_SECURITY (WSK_SO_BASE+1)
57#define SO_WSK_EVENT_CALLBACK (WSK_SO_BASE+2)
58#define WSK_EVENT_RECEIVE_FROM 0x00000100
59#define WSK_EVENT_ACCEPT 0x00000200
60#define WSK_EVENT_SEND_BACKLOG 0x00000010
61#define WSK_EVENT_RECEIVE 0x00000040
62#define WSK_EVENT_DISCONNECT 0x00000080
63#define WSK_EVENT_DISABLE 0x80000000
64#define SIO_WSK_SET_REMOTE_ADDRESS _WSAIOW(IOC_WSK,0x1)
65#define SIO_WSK_REGISTER_EXTENSION _WSAIORW(IOC_WSK,0x2)
66#define SIO_WSK_QUERY_IDEAL_SEND_BACKLOG _WSAIOR(IOC_WSK,0x3)
67#define SIO_WSK_QUERY_RECEIVE_BACKLOG _WSAIOR(IOC_WSK,0x4)
68#define SIO_WSK_QUERY_INSPECT_ID _WSAIOR(IOC_WSK,0x5)
69#define SIO_WSK_SET_SENDTO_ADDRESS _WSAIOW(IOC_WSK,0x6)
70#define WSK_FLAG_NODELAY 0x00000002
71#define WSK_FLAG_WAITALL 0x00000002
72#define WSK_FLAG_DRAIN 0x00000004
74#define WSK_INFINITE_WAIT 0xffffffff
168(
WSKAPI * PFN_WSK_ACCEPT_EVENT)(
180(
WSKAPI * PFN_WSK_SOCKET_CONNECT)(
211(
WSKAPI * PFN_WSK_CLOSE_SOCKET)(
269#if (NTDDI_VERSION >= NTDDI_WIN8)
406#if (NTDDI_VERSION >= NTDDI_WIN7)
411(
WSKAPI * PFN_WSK_GET_ADDRESS_INFO)(
439(
WSKAPI * PFN_WSK_FREE_ADDRESS_INFO)(
505#if (NTDDI_VERSION >= NTDDI_WIN8)
544#if (NTDDI_VERSION >= NTDDI_WIN7)
static WCHAR ServiceName[]
#define __drv_freesMem(kind)
#define __drv_allocatesMem(kind)
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE EventType
#define _Outptr_result_maybenull_
#define _Out_writes_bytes_opt_(s)
#define _Must_inspect_result_
#define _In_reads_bytes_opt_(s)
struct _WSK_BUF_LIST * Next
PFN_WSK_DISCONNECT_EVENT WskDisconnectEvent
PFN_WSK_SEND_BACKLOG_EVENT WskSendBacklogEvent
PFN_WSK_RECEIVE_EVENT WskReceiveEvent
PFN_WSK_RECEIVE_FROM_EVENT WskReceiveFromEvent
PFN_WSK_CLIENT_EVENT WskClientEvent
PFN_WSK_INSPECT_EVENT WskInspectEvent
PFN_WSK_ACCEPT_EVENT WskAcceptEvent
PFN_WSK_ABORT_EVENT WskAbortEvent
const WSK_CLIENT_DISPATCH * Dispatch
_Field_size_bytes_(ControlInfoLength) PCMSGHDR ControlInfo
struct _WSK_DATAGRAM_INDICATION * Next
struct _WSK_DATA_INDICATION * Next
const VOID * ClientDispatch
const VOID * ProviderDispatch
PFN_WSK_CLOSE_SOCKET WskCloseSocket
PFN_WSK_CONTROL_SOCKET WskControlSocket
PFN_WSK_DISCONNECT WskDisconnect
PFN_WSK_GET_LOCAL_ADDRESS WskGetLocalAddress
WSK_PROVIDER_BASIC_DISPATCH
PFN_WSK_CONNECT WskConnect
PFN_WSK_RELEASE_DATA_INDICATION_LIST WskRelease
PFN_WSK_GET_REMOTE_ADDRESS WskGetRemoteAddress
PFN_WSK_RECEIVE WskReceive
PFN_WSK_RELEASE_DATAGRAM_INDICATION_LIST WskRelease
PFN_WSK_SEND_TO WskSendTo
PFN_WSK_SEND_MESSAGES WskSendMessages
PFN_WSK_RECEIVE_FROM WskReceiveFrom
PFN_WSK_GET_LOCAL_ADDRESS WskGetLocalAddress
WSK_PROVIDER_BASIC_DISPATCH
PFN_WSK_GET_ADDRESS_INFO WskGetAddressInfo
PFN_WSK_FREE_ADDRESS_INFO WskFreeAddressInfo
PFN_WSK_GET_NAME_INFO WskGetNameInfo
PFN_WSK_CONTROL_CLIENT WskControlClient
PFN_WSK_SOCKET_CONNECT WskSocketConnect
PFN_WSK_GET_LOCAL_ADDRESS WskGetLocalAddress
WSK_PROVIDER_BASIC_DISPATCH
PFN_WSK_INSPECT_COMPLETE WskInspectComplete
const WSK_PROVIDER_DISPATCH * Dispatch
KSPIN_LOCK ReservedRegistrationLock
PVOID ReservedRegistrationContext
ULONGLONG ReservedRegistrationState
_Field_size_(ElementCount) const WSK_TDI_MAP *Map
ADDRESS_FAMILY AddressFamily
ADDRESS_FAMILY AddressFamily
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFQUEUE _In_ _Strict_type_match_ WDF_REQUEST_TYPE RequestType
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
struct _WSK_TRANSPORT * PWSK_TRANSPORT
struct _WSK_BUF_LIST WSK_BUF_LIST
NTSTATUS(WSKAPI * PFN_WSK_CLIENT_EVENT)(_In_opt_ PVOID ClientContext, _In_ ULONG EventType, _In_reads_bytes_opt_(InformationLength) PVOID Information, _In_ SIZE_T InformationLength)
NTSTATUS(WSKAPI * PFN_WSK_SEND_MESSAGES)(_In_ PWSK_SOCKET Socket, _In_ PWSK_BUF_LIST BufferList, _Reserved_ ULONG Flags, _In_opt_ PSOCKADDR RemoteAddress, _In_ ULONG ControlInfoLength, _In_reads_bytes_opt_(ControlInfoLength) PCMSGHDR ControlInfo, _Inout_ PIRP Irp)
struct _WSK_DATA_INDICATION WSK_DATA_INDICATION
NTSTATUS(WSKAPI * PFN_WSK_INSPECT_COMPLETE)(_In_ PWSK_SOCKET ListenSocket, _In_ PWSK_INSPECT_ID InspectID, _In_ WSK_INSPECT_ACTION Action, _Inout_ PIRP Irp)
struct _WSK_DATAGRAM_INDICATION * PWSK_DATAGRAM_INDICATION
NTSTATUS(WSKAPI * PFN_WSK_BIND)(_In_ PWSK_SOCKET Socket, _In_ PSOCKADDR LocalAddress, _Reserved_ ULONG Flags, _Inout_ PIRP Irp)
NTSTATUS(WSKAPI * PFN_WSK_DISCONNECT_EVENT)(_In_opt_ PVOID SocketContext, _In_ ULONG Flags)
NTSTATUS(WSKAPI * PFN_WSK_GET_NAME_INFO)(_In_ PWSK_CLIENT Client, _In_ PSOCKADDR SockAddr, _In_ ULONG SockAddrLength, _Out_opt_ PUNICODE_STRING NodeName, _Out_opt_ PUNICODE_STRING ServiceName, _In_ ULONG Flags, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp)
struct _WSK_CLIENT_CONNECTION_DISPATCH * PWSK_CLIENT_CONNECTION_DISPATCH
NTSTATUS(WSKAPI * PFN_WSK_GET_LOCAL_ADDRESS)(_In_ PWSK_SOCKET Socket, _Out_ PSOCKADDR LocalAddress, _Inout_ PIRP Irp)
struct _WSK_PROVIDER_BASIC_DISPATCH WSK_PROVIDER_BASIC_DISPATCH
struct _WSK_PROVIDER_DATAGRAM_DISPATCH * PWSK_PROVIDER_DATAGRAM_DISPATCH
NTSTATUS(WSKAPI * PFN_WSK_SEND)(_In_ PWSK_SOCKET Socket, _In_ PWSK_BUF Buffer, _In_ ULONG Flags, _Inout_ PIRP Irp)
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _In_opt_ PWSK_SOCKET _Outptr_result_maybenull_ PVOID * AcceptSocketContext
struct _WSK_EXTENSION_CONTROL_OUT * PWSK_EXTENSION_CONTROL_OUT
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR LocalAddress
struct _WSK_PROVIDER_CHARACTERISTICS WSK_PROVIDER_CHARACTERISTICS
struct _WSK_CLIENT_LISTEN_DISPATCH WSK_CLIENT_LISTEN_DISPATCH
struct _WSK_INSPECT_ID WSK_INSPECT_ID
struct _WSK_CLIENT_NPI * PWSK_CLIENT_NPI
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD OwningThread
struct _WSK_CLIENT_DATAGRAM_DISPATCH WSK_CLIENT_DATAGRAM_DISPATCH
NTSTATUS(WSKAPI * PFN_WSK_CONTROL_SOCKET)(_In_ PWSK_SOCKET Socket, _In_ WSK_CONTROL_SOCKET_TYPE RequestType, _In_ ULONG ControlCode, _In_ ULONG Level, _In_ SIZE_T InputSize, _In_reads_bytes_opt_(InputSize) PVOID InputBuffer, _In_ SIZE_T OutputSize, _Out_writes_bytes_opt_(OutputSize) PVOID OutputBuffer, _Out_opt_ SIZE_T *OutputSizeReturned, _Inout_opt_ PIRP Irp)
struct _WSK_TRANSPORT WSK_TRANSPORT
NTSTATUS(WSKAPI * PFN_WSK_ABORT_EVENT)(_In_opt_ PVOID SocketContext, _In_ PWSK_INSPECT_ID InspectID)
_Must_inspect_result_ NTSTATUS(WSKAPI * PFN_WSK_RECEIVE_EVENT)(_In_opt_ PVOID SocketContext, _In_ ULONG Flags, _In_opt_ PWSK_DATA_INDICATION DataIndication, _In_ SIZE_T BytesIndicated, _Inout_ SIZE_T *BytesAccepted)
struct _WSK_CLIENT_NPI WSK_CLIENT_NPI
struct _WSK_CLIENT_DISPATCH WSK_CLIENT_DISPATCH
CONST NPIID NPI_WSK_INTERFACE_ID
_In_ USHORT _In_ ULONG Protocol
struct _WSK_EXTENSION_CONTROL_IN * PWSK_EXTENSION_CONTROL_IN
struct _WSK_PROVIDER_DATAGRAM_DISPATCH WSK_PROVIDER_DATAGRAM_DISPATCH
NTSTATUS(WSKAPI * PFN_WSK_CONTROL_CLIENT)(_In_ PWSK_CLIENT Client, _In_ ULONG ControlCode, _In_ SIZE_T InputSize, _In_reads_bytes_opt_(InputSize) PVOID InputBuffer, _In_ SIZE_T OutputSize, _Out_writes_bytes_opt_(OutputSize) PVOID OutputBuffer, _Out_opt_ SIZE_T *OutputSizeReturned, _Inout_opt_ PIRP Irp)
NTSTATUS(WSKAPI * PFN_WSK_SEND_TO)(_In_ PWSK_SOCKET Socket, _In_ PWSK_BUF Buffer, _Reserved_ ULONG Flags, _In_opt_ PSOCKADDR RemoteAddress, _In_ ULONG ControlInfoLength, _In_reads_bytes_opt_(ControlInfoLength) PCMSGHDR ControlInfo, _Inout_ PIRP Irp)
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR _Inout_ PIRP Irp
struct _WSK_CLIENT_CONNECTION_DISPATCH WSK_CLIENT_CONNECTION_DISPATCH
struct _WSK_DATA_INDICATION * PWSK_DATA_INDICATION
NTSTATUS(WSKAPI * PFN_WSK_GET_REMOTE_ADDRESS)(_In_ PWSK_SOCKET Socket, _Out_ PSOCKADDR RemoteAddress, _Inout_ PIRP Irp)
struct _WSK_PROVIDER_LISTEN_DISPATCH WSK_PROVIDER_LISTEN_DISPATCH
struct _WSK_PROVIDER_CONNECTION_DISPATCH * PWSK_PROVIDER_CONNECTION_DISPATCH
struct _WSK_PROVIDER_LISTEN_DISPATCH * PWSK_PROVIDER_LISTEN_DISPATCH
_In_ ADDRESS_FAMILY AddressFamily
enum WSK_CONTROL_SOCKET_TYPE * PWSK_CONTROL_SOCKET_TYPE
NTSTATUS(WSKAPI * PFN_WSK_DISCONNECT)(_In_ PWSK_SOCKET Socket, _In_opt_ PWSK_BUF Buffer, _In_ ULONG Flags, _Inout_ PIRP Irp)
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
_In_ PADDRINFOEXW AddrInfo
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH * Dispatch
struct _WSK_SOCKET * PWSK_SOCKET
struct _WSK_EXTENSION_CONTROL_OUT WSK_EXTENSION_CONTROL_OUT
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID SocketContext
struct _WSK_INSPECT_ID * PWSK_INSPECT_ID
NTSTATUS(WSKAPI * PFN_WSK_RELEASE_DATA_INDICATION_LIST)(_In_ PWSK_SOCKET Socket, _In_ PWSK_DATA_INDICATION DataIndication)
struct _WSK_TDI_MAP * PWSK_TDI_MAP
NTSTATUS(WSKAPI * PFN_WSK_SEND_BACKLOG_EVENT)(_In_opt_ PVOID SocketContext, _In_ SIZE_T IdealBacklogSize)
struct _WSK_PROVIDER_NPI * PWSK_PROVIDER_NPI
struct _WSK_PROVIDER_DISPATCH * PWSK_PROVIDER_DISPATCH
struct _WSK_REGISTRATION * PWSK_REGISTRATION
struct _WSK_CLIENT_DISPATCH * PWSK_CLIENT_DISPATCH
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _In_opt_ PWSK_SOCKET AcceptSocket
NTSTATUS(WSKAPI * PFN_WSK_RELEASE_DATAGRAM_INDICATION_LIST)(_In_ PWSK_SOCKET Socket, _In_ PWSK_DATAGRAM_INDICATION DatagramIndication)
NTSTATUS(WSKAPI * PFN_WSK_CONNECT)(_In_ PWSK_SOCKET Socket, _In_ PSOCKADDR RemoteAddress, _Reserved_ ULONG Flags, _Inout_ PIRP Irp)
struct _WSK_EVENT_CALLBACK_CONTROL WSK_EVENT_CALLBACK_CONTROL
struct _WSK_TDI_MAP WSK_TDI_MAP
VOID WSKAPI WskReleaseProviderNPI(_In_ PWSK_REGISTRATION WskRegistration)
NTSTATUS(WSKAPI * PFN_WSK_RECEIVE_FROM)(_In_ PWSK_SOCKET Socket, _In_ PWSK_BUF Buffer, _Reserved_ ULONG Flags, _Out_opt_ PSOCKADDR RemoteAddress, _Inout_ PULONG ControlLength, _Out_writes_bytes_opt_(*ControlLength) PCMSGHDR ControlInfo, _Out_opt_ PULONG ControlFlags, _Inout_ PIRP Irp)
struct _WSK_PROVIDER_NPI WSK_PROVIDER_NPI
NTSTATUS(WSKAPI * PFN_WSK_RECEIVE)(_In_ PWSK_SOCKET Socket, _In_ PWSK_BUF Buffer, _In_ ULONG Flags, _Inout_ PIRP Irp)
struct _WSK_CLIENT_DATAGRAM_DISPATCH * PWSK_CLIENT_DATAGRAM_DISPATCH
_Must_inspect_result_ NTSTATUS WSKAPI WskQueryProviderCharacteristics(_In_ PWSK_REGISTRATION WskRegistration, _Out_ PWSK_PROVIDER_CHARACTERISTICS WskProviderCharacteristics)
struct _WSK_TDI_MAP_INFO WSK_TDI_MAP_INFO
_Must_inspect_result_ _At_(AcceptSocket, __drv_aliasesMem) NTSTATUS(WSKAPI *PFN_WSK_ACCEPT_EVENT)(_In_opt_ PVOID SocketContext
struct _WSK_PROVIDER_DISPATCH WSK_PROVIDER_DISPATCH
struct _WSK_EVENT_CALLBACK_CONTROL * PWSK_EVENT_CALLBACK_CONTROL
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR RemoteAddress
VOID WSKAPI WskDeregister(_In_ PWSK_REGISTRATION WskRegistration)
_Must_inspect_result_ NTSTATUS(WSKAPI * PFN_WSK_RECEIVE_FROM_EVENT)(_In_opt_ PVOID SocketContext, _In_ ULONG Flags, _In_opt_ PWSK_DATAGRAM_INDICATION DataIndication)
struct _WSK_SOCKET WSK_SOCKET
struct _WSK_CLIENT_LISTEN_DISPATCH * PWSK_CLIENT_LISTEN_DISPATCH
struct _WSK_BUF_LIST * PWSK_BUF_LIST
struct _WSK_TDI_MAP_INFO * PWSK_TDI_MAP_INFO
struct _WSK_EXTENSION_CONTROL_IN WSK_EXTENSION_CONTROL_IN
struct _WSK_BUF * PWSK_BUF
struct _WSK_PROVIDER_CONNECTION_DISPATCH WSK_PROVIDER_CONNECTION_DISPATCH
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _In_opt_ PWSK_SOCKET _Outptr_result_maybenull_ PVOID _Outptr_result_maybenull_ const WSK_CLIENT_CONNECTION_DISPATCH ** AcceptSocketDispatch
_Must_inspect_result_ NTSTATUS WSKAPI WskRegister(_In_ PWSK_CLIENT_NPI WskClientNpi, _Out_ PWSK_REGISTRATION WskRegistration)
struct _WSK_DATAGRAM_INDICATION WSK_DATAGRAM_INDICATION
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ NTSTATUS WSKAPI WskCaptureProviderNPI(_In_ PWSK_REGISTRATION WskRegistration, _In_ ULONG WaitTimeout, _Out_ PWSK_PROVIDER_NPI WskProviderNpi)
struct _WSK_PROVIDER_BASIC_DISPATCH * PWSK_PROVIDER_BASIC_DISPATCH
_Must_inspect_result_ WSK_INSPECT_ACTION(WSKAPI * PFN_WSK_INSPECT_EVENT)(_In_opt_ PVOID SocketContext, _In_ PSOCKADDR LocalAddress, _In_ PSOCKADDR RemoteAddress, _In_opt_ PWSK_INSPECT_ID InspectID)
struct _WSK_REGISTRATION WSK_REGISTRATION
struct _WSK_PROVIDER_CHARACTERISTICS * PWSK_PROVIDER_CHARACTERISTICS
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS OwningProcess
_Must_inspect_result_ _In_ ULONG Flags
enum WSK_INSPECT_ACTION * PWSK_INSPECT_ACTION