Home Units Hierarchy Routines All identifiers

Unit unaWSASockets

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

WSA sockets wrapper classes

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
packed record FLOWSPEC  
packed record QOS In Bytes
packed record TWSAProtocolChain  
packed record WSABUF  
packed record WSAPROTOCOL_INFO  

Functions and Procedures

function WSAIoctl(s: tSocket; dwIoControlCode: DWORD; lpvInBuffer: pointer; cbInBuffer: DWORD; lpvOutBuffer: pointer; cbOutBuffer: DWORD; lpcbBytesReturned: LPDWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;
function WSASocket(af, iType, protocol: int; lpProtocolInfo: LPWSAPROTOCOL_INFO; g: GROUP; dwFlags: DWORD): tSocket; stdcall;
function WSAConnect(s: tSocket; name: pSockAddr; namelen: int; lpCallerData, lpCalleeData: LPWSABUF; lpSQOS, lpGQOS: LPQOS): int; stdcall;
function WSARecv(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesRecvd: LPDWORD; lpFlags: LPDWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;
function WSASend(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesSent: LPDWORD; dwFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;
function WSASendTo(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesSent: LPDWORD; dwFlags: DWORD; lpTo: pSockAddr; iTolen: int; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;
function WSARecvFrom(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesRecvd: LPDWORD; lpFlags: LPDWORD; lpFrom: pSockAddr; lpFromlen: LPINT; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;
function WSAGetOverlappedResult(s: tSocket; lpOverlapped: LPWSAOVERLAPPED; lpcbTransfer: LPDWORD; fWait: BOOL; lpdwFlags: LPDWORD ): BOOL; stdcall;
function WSAEventSelect(s: tSocket; hEventObject: WSAEVENT; lNetworkEvents: long): int; stdcall;
function getWSAProcAddr(s: tSocket; const guid: tGuid): pointer;

Types

LPWSABUF = ˆWSABUF;
LPWSAPROTOCOL_INFO = ˆWSAPROTOCOL_INFO;
TServiceType = LongInt;
PQOS = ˆQOS;
LPQOS = PQOS;
GROUP = DWORD;
LPINT = ˆint;
WSAOVERLAPPED = TOverlapped;
LPWSAOVERLAPPED = POverlapped;
WSAEVENT = THANDLE;
LPWSAOVERLAPPED_COMPLETION_ROUTINE = procedure(const dwError, cbTransferred: DWORD; const lpOverlapped: LPWSAOVERLAPPED; const dwFlags: DWORD); stdcall;
proc_acceptEx = function(sListenSocket, sAcceptSocket: tSocket; lpOutputBuffer: pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; lpdwBytesReceived: LPDWORD; lpOverlapped: POVERLAPPED): BOOL; stdcall;
proc_getAcceptExSockaddrs = procedure(lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; out localSockaddr: pSockAddr; out localSockaddrLength: int; out remoteSockaddr: pSockAddr; out remoteSockaddrLength: int); stdcall;

Constants

FROM_PROTOCOL_INFO = -1;
IOC_PROTOCOL = $10000000;
IOC_UNIX = $00000000;
IOC_VENDOR = $18000000;
IOC_WS2 = $08000000;
MAX_PROTOCOL_CHAIN = 7;
MSG_INTERRUPT = $10;
MSG_MAXIOVLEN = $10;
SIO_ADDRESS_LIST_CHANGE = 23 OR IOC_WS2 OR IOC_VOID;
SIO_ADDRESS_LIST_QUERY = 22 OR IOC_WS2 OR IOC_OUT;
SIO_ADDRESS_LIST_SORT = 25 OR IOC_WS2 OR IOC_INOUT;
SIO_ASSOCIATE_HANDLE = 1 OR IOC_WS2 OR IOC_IN;
SIO_ENABLE_CIRCULAR_QUEUEING = 2 OR IOC_WS2 OR IOC_VOID;
SIO_FIND_ROUTE = 3 OR IOC_WS2 OR IOC_OUT;
SIO_FLUSH = 4 OR IOC_WS2 OR IOC_VOID;
SIO_GET_BROADCAST_ADDRESS = 5 OR IOC_WS2 OR IOC_OUT;
SIO_GET_EXTENSION_FUNCTION_POINTER = 6 OR IOC_WS2 OR IOC_INOUT;
SIO_GET_GROUP_QOS = 8 OR IOC_WS2 OR IOC_INOUT;
SIO_GET_QOS = 7 OR IOC_WS2 OR IOC_INOUT;
SIO_MULTICAST_SCOPE = 10 OR IOC_WS2 OR IOC_IN;
SIO_MULTIPOINT_LOOPBACK = 9 OR IOC_WS2 OR IOC_IN;
SIO_QUERY_TARGET_PNP_HANDLE = 24 OR IOC_WS2 OR IOC_OUT;
SIO_ROUTING_INTERFACE_CHANGE = 21 OR IOC_WS2 OR IOC_IN;
SIO_ROUTING_INTERFACE_QUERY = 20 OR IOC_WS2 OR IOC_INOUT;
SIO_SET_GROUP_QOS = 12 OR IOC_WS2 OR IOC_IN;
SIO_SET_QOS = 11 OR IOC_WS2 OR IOC_IN;
SIO_TRANSLATE_HANDLE = 13 OR IOC_WS2 OR IOC_INOUT;
WSAID_ACCEPTEX : tGuid = (D1:$B5367DF1; D2:$CBAC; D3:$11CF; D4:($95, $CA, $00, $80, $5F, $48, $A1, $92));
WSAID_GETACCEPTEXSOCKADDRS : tGuid = (D1:$B5367DF2; D2:$CBAC; D3:$11CF; D4:($95, $CA, $00, $80, $5F, $48, $A1, $92));
WSAPROTOCOL_LEN = 255;
WSA_FLAG_MULTIPOINT_C_LEAF = $04;
WSA_FLAG_MULTIPOINT_C_ROOT = $02;
WSA_FLAG_MULTIPOINT_D_LEAF = $10;
WSA_FLAG_MULTIPOINT_D_ROOT = $08;
WSA_FLAG_OVERLAPPED = $01;
WSA_INVALID_PARAMETER = ERROR_INVALID_PARAMETER;
WSA_IO_INCOMPLETE = ERROR_IO_INCOMPLETE;
WSA_IO_PENDING = ERROR_IO_PENDING;

Description

Functions and Procedures

function WSAIoctl(s: tSocket; dwIoControlCode: DWORD; lpvInBuffer: pointer; cbInBuffer: DWORD; lpvOutBuffer: pointer; cbOutBuffer: DWORD; lpcbBytesReturned: LPDWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;

– –

function WSASocket(af, iType, protocol: int; lpProtocolInfo: LPWSAPROTOCOL_INFO; g: GROUP; dwFlags: DWORD): tSocket; stdcall;

– –

function WSAConnect(s: tSocket; name: pSockAddr; namelen: int; lpCallerData, lpCalleeData: LPWSABUF; lpSQOS, lpGQOS: LPQOS): int; stdcall;

– –

function WSARecv(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesRecvd: LPDWORD; lpFlags: LPDWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;

– –

function WSASend(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesSent: LPDWORD; dwFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;

– –

function WSASendTo(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesSent: LPDWORD; dwFlags: DWORD; lpTo: pSockAddr; iTolen: int; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;

– –

function WSARecvFrom(s: tSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; lpNumberOfBytesRecvd: LPDWORD; lpFlags: LPDWORD; lpFrom: pSockAddr; lpFromlen: LPINT; lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): int; stdcall;

– –

function WSAGetOverlappedResult(s: tSocket; lpOverlapped: LPWSAOVERLAPPED; lpcbTransfer: LPDWORD; fWait: BOOL; lpdwFlags: LPDWORD ): BOOL; stdcall;

– –

function WSAEventSelect(s: tSocket; hEventObject: WSAEVENT; lNetworkEvents: long): int; stdcall;
 
function getWSAProcAddr(s: tSocket; const guid: tGuid): pointer;

– –

Types

LPWSABUF = ˆWSABUF;
 
LPWSAPROTOCOL_INFO = ˆWSAPROTOCOL_INFO;

a list of dwCatalogEntryIds

TServiceType = LongInt;
 
PQOS = ˆQOS;

additional provider specific stuff

LPQOS = PQOS;
 
GROUP = DWORD;
 
LPINT = ˆint;
 
WSAOVERLAPPED = TOverlapped;
 
LPWSAOVERLAPPED = POverlapped;
 
WSAEVENT = THANDLE;
 
LPWSAOVERLAPPED_COMPLETION_ROUTINE = procedure(const dwError, cbTransferred: DWORD; const lpOverlapped: LPWSAOVERLAPPED; const dwFlags: DWORD); stdcall;
 
proc_acceptEx = function(sListenSocket, sAcceptSocket: tSocket; lpOutputBuffer: pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; lpdwBytesReceived: LPDWORD; lpOverlapped: POVERLAPPED): BOOL; stdcall;
 
proc_getAcceptExSockaddrs = procedure(lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; out localSockaddr: pSockAddr; out localSockaddrLength: int; out remoteSockaddr: pSockAddr; out remoteSockaddrLength: int); stdcall;
 

Constants

FROM_PROTOCOL_INFO = -1;

The following may be used in place of the address family, socket type, or protocol in a call to WSASocket to indicate that the corresponding value should be taken from the supplied WSAPROTOCOL_INFO structure instead of the parameter itself.

IOC_PROTOCOL = $10000000;
 
IOC_UNIX = $00000000;

WinSock 2 extension – manifest constants for WSAIoctl()

IOC_VENDOR = $18000000;
 
IOC_WS2 = $08000000;
 
MAX_PROTOCOL_CHAIN = 7;
 
MSG_INTERRUPT = $10;

WinSock 2 extension – new flags for WSASend(), WSASendTo(), WSARecv() and WSARecvFrom()

MSG_MAXIOVLEN = $10;

send/recv in the interrupt context

SIO_ADDRESS_LIST_CHANGE = 23 OR IOC_WS2 OR IOC_VOID;

see below SOCKET_ADDRESS_LIST

SIO_ADDRESS_LIST_QUERY = 22 OR IOC_WS2 OR IOC_OUT;
 
SIO_ADDRESS_LIST_SORT = 25 OR IOC_WS2 OR IOC_INOUT;
 
SIO_ASSOCIATE_HANDLE = 1 OR IOC_WS2 OR IOC_IN;
 
SIO_ENABLE_CIRCULAR_QUEUEING = 2 OR IOC_WS2 OR IOC_VOID;
 
SIO_FIND_ROUTE = 3 OR IOC_WS2 OR IOC_OUT;
 
SIO_FLUSH = 4 OR IOC_WS2 OR IOC_VOID;
 
SIO_GET_BROADCAST_ADDRESS = 5 OR IOC_WS2 OR IOC_OUT;
 
SIO_GET_EXTENSION_FUNCTION_POINTER = 6 OR IOC_WS2 OR IOC_INOUT;
 
SIO_GET_GROUP_QOS = 8 OR IOC_WS2 OR IOC_INOUT;
 
SIO_GET_QOS = 7 OR IOC_WS2 OR IOC_INOUT;
 
SIO_MULTICAST_SCOPE = 10 OR IOC_WS2 OR IOC_IN;
 
SIO_MULTIPOINT_LOOPBACK = 9 OR IOC_WS2 OR IOC_IN;
 
SIO_QUERY_TARGET_PNP_HANDLE = 24 OR IOC_WS2 OR IOC_OUT;
 
SIO_ROUTING_INTERFACE_CHANGE = 21 OR IOC_WS2 OR IOC_IN;
 
SIO_ROUTING_INTERFACE_QUERY = 20 OR IOC_WS2 OR IOC_INOUT;
 
SIO_SET_GROUP_QOS = 12 OR IOC_WS2 OR IOC_IN;
 
SIO_SET_QOS = 11 OR IOC_WS2 OR IOC_IN;
 
SIO_TRANSLATE_HANDLE = 13 OR IOC_WS2 OR IOC_INOUT;
 
WSAID_ACCEPTEX : tGuid = (D1:$B5367DF1; D2:$CBAC; D3:$11CF; D4:($95, $CA, $00, $80, $5F, $48, $A1, $92));
 
WSAID_GETACCEPTEXSOCKADDRS : tGuid = (D1:$B5367DF2; D2:$CBAC; D3:$11CF; D4:($95, $CA, $00, $80, $5F, $48, $A1, $92));
 
WSAPROTOCOL_LEN = 255;
 
WSA_FLAG_MULTIPOINT_C_LEAF = $04;
 
WSA_FLAG_MULTIPOINT_C_ROOT = $02;
 
WSA_FLAG_MULTIPOINT_D_LEAF = $10;
 
WSA_FLAG_MULTIPOINT_D_ROOT = $08;
 
WSA_FLAG_OVERLAPPED = $01;

WinSock 2 extension – manifest constants for WSASocket()

WSA_INVALID_PARAMETER = ERROR_INVALID_PARAMETER;
 
WSA_IO_INCOMPLETE = ERROR_IO_INCOMPLETE;
 
WSA_IO_PENDING = ERROR_IO_PENDING;
 

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09