Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stWinsock2

Classes, interfaces and records

recordfd_set

fd_count: u_int; fd_array: array [0..FD_SETSIZE - 1] of TSocket;

recordtimeval

tv_sec: Longint; tv_usec: Longint;

recordhostent

h_name: PAnsiChar; h_aliases: PPAnsiChar; h_addrtype: SmallInt; h_length: SmallInt; h_addr_list: PPAnsiChar;

recordservent

The 64-bit layout swaps the last two fields; both are declared as the platform requires, so s_port reads correctly either way.

s_name: PAnsiChar; s_aliases: PPAnsiChar; s_proto: PAnsiChar; s_port: SmallInt; s_port: SmallInt; s_proto: PAnsiChar;

recordin_addr

(no public members)

recordin6_addr

(no public members)

recordsockaddr

sa_family: u_short; sa_data: array [0..13] of AnsiChar;

recordsockaddr_in

Either family in one record - see the note at the top of the unit.

sin_addr: TInAddr; sin_zero: array [0..7] of u_char); sin6_flowinfo: u_long; sin6_addr: TInAddr6; sin6_scope_id: u_long);

recordsockaddr_in6

sin6_family: u_short; sin6_port: u_short; sin6_flowinfo: u_long; sin6_addr: TInAddr6; sin6_scope_id: u_long;

recordsockaddr_storage

128 bytes, aligned for the widest family: the buffer to receive into when the address family is not known in advance.

ss_family: u_short; __ss_pad1: array [0..5] of AnsiChar; __ss_align: Int64; __ss_pad2: array [0..111] of AnsiChar;

recordlinger

l_onoff: u_short; l_linger: u_short;

recordWSAPOLLFD

fd: TSocket; events: SmallInt; revents: SmallInt;

recordWSAData

The 64-bit layout puts the counts and the vendor pointer before the two strings; both are declared as the platform requires.

wVersion: Word; wHighVersion: Word; iMaxSockets: Word; iMaxUdpDg: Word; lpVendorInfo: PAnsiChar; szDescription: array [0..WSADESCRIPTION_LEN] of AnsiChar; szSystemStatus: array [0..WSASYS_STATUS_LEN] of AnsiChar; szDescription: array [0..WSADESCRIPTION_LEN] of AnsiChar; szSystemStatus: array [0..WSASYS_STATUS_LEN] of AnsiChar; iMaxSockets: Word; iMaxUdpDg: Word; lpVendorInfo: PAnsiChar;

recordWSABUF

len: u_long; buf: PAnsiChar;

recordWSAMSG

name: PSockAddr; namelen: Integer; lpBuffers: LPWSABUF; dwBufferCount: DWORD; Control: WSABUF; dwFlags: DWORD;

recordWSACMSGHDR

cmsg_len: NativeUInt; cmsg_level, cmsg_type: Integer;

recordWSAPROTOCOLCHAIN

ChainLen: Integer; ChainEntries: array [0..MAX_PROTOCOL_CHAIN - 1] of DWORD;

recordWSAPROTOCOL_INFOA

dwServiceFlags1: DWORD; dwServiceFlags2: DWORD; dwServiceFlags3: DWORD; dwServiceFlags4: DWORD; dwProviderFlags: DWORD; ProviderId: TGUID; dwCatalogEntryId: DWORD; ProtocolChain: WSAPROTOCOLCHAIN; iVersion: Integer; iAddressFamily: Integer; iMaxSockAddr: Integer; iMinSockAddr: Integer; iSocketType: Integer; iProtocol: Integer; iProtocolMaxOffset: Integer; iNetworkByteOrder: Integer; iSecurityScheme: Integer; dwMessageSize: DWORD; dwProviderReserved: DWORD; szProtocol: array [0..WSAPROTOCOL_LEN] of AnsiChar;

recordWSAPROTOCOL_INFOW

dwServiceFlags1: DWORD; dwServiceFlags2: DWORD; dwServiceFlags3: DWORD; dwServiceFlags4: DWORD; dwProviderFlags: DWORD; ProviderId: TGUID; dwCatalogEntryId: DWORD; ProtocolChain: WSAPROTOCOLCHAIN; iVersion: Integer; iAddressFamily: Integer; iMaxSockAddr: Integer; iMinSockAddr: Integer; iSocketType: Integer; iProtocol: Integer; iProtocolMaxOffset: Integer; iNetworkByteOrder: Integer; iSecurityScheme: Integer; dwMessageSize: DWORD; dwProviderReserved: DWORD; szProtocol: array [0..WSAPROTOCOL_LEN] of WideChar;

recordaddrinfo

ai_addrlen is a size_t: 8 bytes in a 64-bit process.

ai_flags: Integer; ai_family: Integer; ai_socktype: Integer; ai_protocol: Integer; ai_addrlen: size_t; ai_canonname: PAnsiChar; ai_addr: PSockAddr; ai_next: PAddrInfo;

Types (enumerations, sets, aliases)

typeu_char

  u_char = Byte;

typeu_short

  u_short = Word;

typeu_int

  u_int = Cardinal;

typeu_long

  u_long = Cardinal;

typePPAnsiChar

  PPAnsiChar = ^PAnsiChar;

typesize_t

  size_t = NativeUInt;

typesocklen_t

  socklen_t = Integer;

typeTSocket

  TSocket = NativeUInt;

typeGROUP

  GROUP = Cardinal;

typeTFdSet

  TFdSet = fd_set;

typePFdSet

  PFdSet = ^fd_set;

typeTTimeVal

  TTimeVal = timeval;

typePTimeVal

  PTimeVal = ^timeval;

typeTHostEnt

  THostEnt = hostent;

typePHostEnt

  PHostEnt = ^hostent;

typeTServEnt

  TServEnt = servent;

typePServEnt

  PServEnt = ^servent;

typeTInAddr

  TInAddr = in_addr;

typePInAddr

  PInAddr = ^in_addr;

typeTInAddr6

  TInAddr6 = in6_addr;

typePInAddr6

  PInAddr6 = ^in6_addr;

typeTSockAddr

  TSockAddr = sockaddr;

typePSockAddr

  PSockAddr = ^sockaddr;

typeTSockAddrIn

  TSockAddrIn = sockaddr_in;

typePSockAddrIn

  PSockAddrIn = ^sockaddr_in;

typeTSockAddrIn6

  TSockAddrIn6 = sockaddr_in6;

typePSockAddrIn6

  PSockAddrIn6 = ^sockaddr_in6;

typeTSockAddrStorage

  TSockAddrStorage = sockaddr_storage;

typePSockAddrStorage

  PSockAddrStorage = ^sockaddr_storage;

typeTLinger

  TLinger = linger;

typePLinger

  PLinger = ^linger;

typeLPWSAPOLLFD

  LPWSAPOLLFD = ^WSAPOLLFD;

typeTWsaPollFd

  TWsaPollFd = WSAPOLLFD;

typePWsaPollFd

  PWsaPollFd = LPWSAPOLLFD;

typeWSAEVENT

  WSAEVENT = THandle;

typePWSAEVENT

  PWSAEVENT = ^WSAEVENT;

typeLPWSAEVENT

  LPWSAEVENT = PWSAEVENT;

typeTWsaEvent

  TWsaEvent = WSAEVENT;

typeWSAOVERLAPPED

Layout-identical to OVERLAPPED, and a completion port hands back that same pointer, so this is an alias rather than a second declaration.

  WSAOVERLAPPED = TOverlapped;

typeLPWSAOVERLAPPED

  LPWSAOVERLAPPED = ^TOverlapped;

typeTWsaOverlapped

  TWsaOverlapped = WSAOVERLAPPED;

typePWsaOverlapped

  PWsaOverlapped = LPWSAOVERLAPPED;

procLPWSAOVERLAPPED_COMPLETION_ROUTINE

  LPWSAOVERLAPPED_COMPLETION_ROUTINE = procedure(dwError, cbTransferred: DWORD;
    lpOverlapped: LPWSAOVERLAPPED; dwFlags: DWORD); stdcall;

typeTWsaData

  TWsaData = WSAData;

typeLPWSADATA

  LPWSADATA = ^WSAData;

typePWsaData

  PWsaData = LPWSADATA;

typeLPWSABUF

  LPWSABUF = ^WSABUF;

typeTWsaBuf

  TWsaBuf = WSABUF;

typePWsaBuf

  PWsaBuf = LPWSABUF;

typeLPWSAMSG

  LPWSAMSG = ^WSAMSG;

typePWSACMSGHDR

  PWSACMSGHDR = ^WSACMSGHDR;

procLPFN_WSARECVMSG

  LPFN_WSARECVMSG = function(s: TSocket; lpMsg: LPWSAMSG;
    lpdwNumberOfBytesRecvd: PDWORD; lpOverlapped: LPWSAOVERLAPPED;
    lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;

procLPFN_WSASENDMSG

  LPFN_WSASENDMSG = function(s: TSocket; lpMsg: LPWSAMSG; dwFlags: DWORD;
    lpNumberOfBytesSent: PDWORD; lpOverlapped: LPWSAOVERLAPPED;
    lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;

typeTWsaProtocolChain

  TWsaProtocolChain = WSAPROTOCOLCHAIN;

typeLPWSAPROTOCOL_INFOA

  LPWSAPROTOCOL_INFOA = ^WSAPROTOCOL_INFOA;

typeLPWSAPROTOCOL_INFOW

  LPWSAPROTOCOL_INFOW = ^WSAPROTOCOL_INFOW;

typeWSAPROTOCOL_INFO

  WSAPROTOCOL_INFO = WSAPROTOCOL_INFOW;

typeLPWSAPROTOCOL_INFO

  LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOW;

typeWSAPROTOCOL_INFO

  WSAPROTOCOL_INFO = WSAPROTOCOL_INFOA;

typeLPWSAPROTOCOL_INFO

  LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOA;

typeTWsaProtocolInfo

  TWsaProtocolInfo = WSAPROTOCOL_INFO;

typePWsaProtocolInfo

  PWsaProtocolInfo = LPWSAPROTOCOL_INFO;

typePAddrInfo

  PAddrInfo = ^addrinfo;

typeTAddrInfo

  TAddrInfo = addrinfo;

typeADDRINFOA

  ADDRINFOA = addrinfo;

typePADDRINFOA

  PADDRINFOA = PAddrInfo;

typeLPADDRINFOA

  LPADDRINFOA = PAddrInfo;

Routines