// $Id: JwaWinsock2.pas,v 1.10 2005/01/03 08:56:14 marquardt Exp $<br><br>unit JwaWinsock2;<br><br>{$WEAKPACKAGEUNIT}<br><br>{$HPPEMIT ''}<br>{$HPPEMIT '#include "winsock2.h"'}<br>{$HPPEMIT ''}<br><br>{$I jediapilib.inc}<br><br>interface<br><br>uses<br> JwaQos, JwaWinType, JwaWinBase, JwaWinError, JwaWinNT;<br><br>type // TODO<br> ULONG_PTR = ULONG;<br> DWORD_PTR = DWORD;<br> PPChar = ^PChar;<br> {$NODEFINE PPChar}<br> HANDLE = THandle;<br> {$NODEFINE HANDLE}<br> LPHANDLE = ^THandle;<br> {$NODEFINE LPHANDLE}<br> LPBYTE = ^BYTE;<br> {$NODEFINE LPBYTE}<br> LPVOID = Pointer;<br> {$NODEFINE LPVOID}<br> USHORT = Word;<br> {$NODEFINE USHORT}<br> UCHAR = Byte;<br> {$NODEFINE UCHAR}<br> ULONG = Cardinal;<br> {$NODEFINE ULONG}<br><br>//#include <pshpack4.h><br>{$ALIGN ON}<br><br>// Winsock2.h -- definitions to be used with the WinSock 2 DLL and<br>// WinSock 2 applications.<br>//<br>// This header file corresponds to version 2.2.x of the WinSock API<br>// specification.<br>//<br>// This file includes parts which are Copyright (c) 1982-1986 Regents<br>// of the University of California. All rights reserved. The<br>// Berkeley Software License Agreement specifies the terms and<br>// conditions for redistribution.<br>//<br><br>(*<br> * Default: include function prototypes, don't include function typedefs.<br> *)<br><br>// (rom) INCL_WINSOCK_API_PROTOTYPES and INCL_WINSOCK_API_TYPEDEFS IFDEFs<br>// removed because they are without meaning for Delphi.<br><br>const<br> WINSOCK_VERSION = $0202;<br> {$EXTERNALSYM WINSOCK_VERSION}<br><br>//<br>// Basic system type definitions, taken from the BSD file sys/types.h.<br>//<br><br>type<br> u_char = Byte;<br> {$EXTERNALSYM u_char}<br> u_short = Word;<br> {$EXTERNALSYM u_short}<br> u_int = Cardinal;<br> {$EXTERNALSYM u_int}<br> u_long = Cardinal;<br> {$EXTERNALSYM u_long}<br> u_int64 = Int64; // unsigned __int64 !! TODO For Delphi 7 ??<br> {$EXTERNALSYM u_int64}<br><br>//<br>// The new type to be used in all<br>// instances which refer to sockets.<br>//<br><br>type<br> TSocket = Cardinal;<br><br>//<br>// Select uses arrays of SOCKETs. These macros manipulate such<br>// arrays. FD_SETSIZE may be defined by the user before including<br>// this file, but the default here should be >= 64.<br>//<br>// CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE<br>// INCLUDED IN WINSOCK2.H EXACTLY AS SHOWN HERE.<br>//<br><br>const<br> FD_SETSIZE = 64;<br> {$EXTERNALSYM FD_SETSIZE}<br><br>type<br> fd_set = record<br> fd_count: u_int; // how many are SET?<br> fd_array: array [0..FD_SETSIZE - 1] of TSocket; // an array of SOCKETs<br> end;<br> {$EXTERNALSYM fd_set}<br> TFdSet = fd_set;<br> PFdSet = ^fd_set;<br><br>function __WSAFDIsSet(s: TSocket; var FDSet: TFDSet): Integer; stdcall;<br>{$EXTERNALSYM __WSAFDIsSet}<br><br>procedure FD_CLR(fd: TSocket; var fdset: TFdSet);<br>{$EXTERNALSYM FD_CLR}<br><br>procedure _FD_SET(fd: TSocket; var fdset: TFDSet);<br>//{$EXTERNALSYM FD_SET}<br><br>procedure FD_ZERO(var fdset: TFdSet);<br>{$EXTERNALSYM FD_ZERO}<br><br>function FD_ISSET(fd: TSocket; var fdset: TFdSet): Boolean;<br>{$EXTERNALSYM FD_ISSET}<br><br>//<br>// Structure used in select() call, taken from the BSD file sys/time.h.<br>//<br><br>type<br> timeval = record<br> tv_sec: Longint; // seconds<br> tv_usec: Longint; // and microseconds<br> end;<br> {$EXTERNALSYM timeval}<br> TTimeVal = timeval;<br> PTimeVal = ^timeval;<br><br>//<br>// Operations on timevals.<br>//<br>// NB: timercmp does not work for >= or <=.<br>//<br><br>function timerisset(const tvp: TTimeVal): Boolean;<br>{$EXTERNALSYM timerisset}<br><br>//function timercmp(const tvp, uvp: TTimeVal; cmp): Boolean;<br>//{$EXTERNALSYM timercmp}<br><br>procedure timerclear(var tvp: TTimeVal);<br>{$EXTERNALSYM timerclear}<br><br>//<br>// Commands for ioctlsocket(), taken from the BSD file fcntl.h.<br>//<br>//<br>// Ioctl's have the command encoded in the lower word,<br>// and the size of any in or out parameters in the upper<br>// word. The high 2 bits of the upper word are used<br>// to encode the in/out status of the parameter; for now<br>// we restrict parameters to at most 128 bytes.<br>//<br><br>const<br> IOCPARM_MASK = $7f; // parameters must be < 128 bytes<br> {$EXTERNALSYM IOCPARM_MASK}<br> IOC_VOID = $20000000; // no parameters<br> {$EXTERNALSYM IOC_VOID}<br> IOC_OUT = $40000000; // copy out parameters<br> {$EXTERNALSYM IOC_OUT}<br> IOC_IN = DWORD($80000000); // copy in parameters<br> {$EXTERNALSYM IOC_IN}<br> IOC_INOUT = DWORD(IOC_IN or IOC_OUT);<br> {$EXTERNALSYM IOC_INOUT}<br><br> // 0x20000000 distinguishes new & old ioctl's<br><br>function _IO(x, y: DWORD): DWORD;<br>{$EXTERNALSYM _IO}<br><br>function _IOR(x, y, t: DWORD): DWORD;<br>{$EXTERNALSYM _IOR}<br><br>function _IOW(x, y, t: DWORD): DWORD;<br>{$EXTERNALSYM _IOW}<br><br>const<br> FIONREAD = IOC_OUT or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('f') shl 8) or 127; // get # bytes to read<br> {$EXTERNALSYM FIONREAD}<br> FIONBIO = IOC_IN or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('f') shl 8) or 126; // set/clear non-blocking i/o<br> {$EXTERNALSYM FIONBIO}<br> FIOASYNC = IOC_IN or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('f') shl 8) or 125; // set/clear async i/o<br> {$EXTERNALSYM FIOASYNC}<br><br>// Socket I/O Controls<br><br> SIOCSHIWAT = DWORD(IOC_IN or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('s') shl 8) or 0); // set high watermark<br> {$EXTERNALSYM SIOCSHIWAT}<br> SIOCGHIWAT = IOC_OUT or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('s') shl 8) or 1; // get high watermark<br> {$EXTERNALSYM SIOCGHIWAT}<br> SIOCSLOWAT = DWORD(IOC_IN or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('s') shl 8) or 2); // set low watermark<br> {$EXTERNALSYM SIOCSLOWAT}<br> SIOCGLOWAT = IOC_OUT or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('s') shl 8) or 3; // get low watermark<br> {$EXTERNALSYM SIOCGLOWAT}<br> SIOCATMARK = IOC_OUT or ((SizeOf(u_long) and IOCPARM_MASK) shl 16) or (Ord('s') shl 8) or 7; // at oob mark?<br> {$EXTERNALSYM SIOCATMARK}<br><br>//<br>// Structures returned by network data base library, taken from the<br>// BSD file netdb.h. All addresses are supplied in host order, and<br>// returned in network order (suitable for use in system calls).<br>//<br><br>type<br> hostent = record<br> h_name: PChar; // official name of host<br> h_aliases: PPChar; // alias list<br> h_addrtype: Smallint; // host address type<br> h_length: Smallint; // length of address<br> case Integer of<br> 0: (h_addr_list: PPChar); // list of addresses<br> 1: (h_addr: PPChar); // address, for backward compat<br> end;<br> {$EXTERNALSYM hostent}<br> THostEnt = hostent;<br> PHostEnt = ^hostent;<br><br>//<br>// It is assumed here that a network number<br>// fits in 32 bits.<br>//<br><br>type<br> netent = record<br> n_name: PChar; // official name of net<br> n_aliases: PPChar; // alias list<br> n_addrtype: Smallint; // net address type<br> n_net: u_long; // network #<br> end;<br> {$EXTERNALSYM netent}<br> TNetEnt = netent;<br> PNetEnt = ^netent;<br><br> servent = record<br> s_name: PChar; // official service name<br> s_aliases: PPChar; // alias list<br> s_port: Smallint; // port #<br> s_proto: PChar; // protocol to use<br> end;<br> {$EXTERNALSYM servent}<br> TServEnt = servent;<br> PServEnt = ^servent;<br><br> protoent = record<br> p_name: PChar; // official protocol name<br> p_aliases: PPChar; // alias list<br> p_proto: Smallint; // protocol #<br> end;<br> {$EXTERNALSYM protoent}<br> TProtoEnt = protoent;<br> PProtoEnt = ^protoent;<br><br>//<br>// Constants and structures defined by the internet system,<br>// Per RFC 790, September 1981, taken from the BSD file netinet/in.h.<br>//<br><br>//<br>// Protocols<br>//<br><br>const<br> IPPROTO_IP = 0; // dummy for IP<br> {$EXTERNALSYM IPPROTO_IP}<br> IPPROTO_HOPOPTS = 0; // IPv6 hop-by-hop options<br> {$EXTERNALSYM IPPROTO_HOPOPTS}<br> IPPROTO_ICMP = 1; // control message protocol<br> {$EXTERNALSYM IPPROTO_ICMP}<br> IPPROTO_IGMP = 2; // internet group management protocol<br> {$EXTERNALSYM IPPROTO_IGMP}<br> IPPROTO_GGP = 3; // gateway^2 (deprecated)<br> {$EXTERNALSYM IPPROTO_GGP}<br> IPPROTO_IPV4 = 4; // IPv4<br> {$EXTERNALSYM IPPROTO_IPV4}<br> IPPROTO_TCP = 6; // tcp<br> {$EXTERNALSYM IPPROTO_TCP}<br> IPPROTO_PUP = 12; // pup<br> {$EXTERNALSYM IPPROTO_PUP}<br> IPPROTO_UDP = 17; // user datagram protocol<br> {$EXTERNALSYM IPPROTO_UDP}<br> IPPROTO_IDP = 22; // xns idp<br> {$EXTERNALSYM IPPROTO_IDP}<br> IPPROTO_IPV6 = 41; // IPv6<br> {$EXTERNALSYM IPPROTO_IPV6}<br> IPPROTO_ROUTING = 43; // IPv6 routing header<br> {$EXTERNALSYM IPPROTO_ROUTING}<br> IPPROTO_FRAGMENT = 44; // IPv6 fragmentation header<br> {$EXTERNALSYM IPPROTO_FRAGMENT}<br> IPPROTO_ESP = 50; // IPsec ESP header<br> {$EXTERNALSYM IPPROTO_ESP}<br> IPPROTO_AH = 51; // IPsec AH<br> {$EXTERNALSYM IPPROTO_AH}<br> IPPROTO_ICMPV6 = 58; // ICMPv6<br> {$EXTERNALSYM IPPROTO_ICMPV6}<br> IPPROTO_NONE = 59; // IPv6 no next header<br> {$EXTERNALSYM IPPROTO_NONE}<br> IPPROTO_DSTOPTS = 60; // IPv6 destination options<br> {$EXTERNALSYM IPPROTO_DSTOPTS}<br> IPPROTO_ND = 77; // UNOFFICIAL net disk proto<br> {$EXTERNALSYM IPPROTO_ND}<br> IPPROTO_ICLFXBM = 78;<br> {$EXTERNALSYM IPPROTO_ICLFXBM}<br><br> IPPROTO_RAW = 255; // raw IP packet<br> {$EXTERNALSYM IPPROTO_RAW}<br> IPPROTO_MAX = 256;<br> {$EXTERNALSYM IPPROTO_MAX}<br><br>//<br>// Port/socket numbers: network standard functions<br>//<br><br> IPPORT_ECHO = 7;<br> {$EXTERNALSYM IPPORT_ECHO}<br> IPPORT_DISCARD = 9;<br> {$EXTERNALSYM IPPORT_DISCARD}<br> IPPORT_SYSTAT = 11;<br> {$EXTERNALSYM IPPORT_SYSTAT}<br> IPPORT_DAYTIME = 13;<br> {$EXTERNALSYM IPPORT_DAYTIME}<br> IPPORT_NETSTAT = 15;<br> {$EXTERNALSYM IPPORT_NETSTAT}<br> IPPORT_FTP = 21;<br> {$EXTERNALSYM IPPORT_FTP}<br> IPPORT_TELNET = 23;<br> {$EXTERNALSYM IPPORT_TELNET}<br> IPPORT_SMTP = 25;<br> {$EXTERNALSYM IPPORT_SMTP}<br> IPPORT_TIMESERVER = 37;<br> {$EXTERNALSYM IPPORT_TIMESERVER}<br> IPPORT_NAMESERVER = 42;<br> {$EXTERNALSYM IPPORT_NAMESERVER}<br> IPPORT_WHOIS = 43;<br> {$EXTERNALSYM IPPORT_WHOIS}<br> IPPORT_MTP = 57;<br> {$EXTERNALSYM IPPORT_MTP}<br><br>//<br>// Port/socket numbers: host specific functions<br>//<br><br> IPPORT_TFTP = 69;<br> {$EXTERNALSYM IPPORT_TFTP}<br> IPPORT_RJE = 77;<br> {$EXTERNALSYM IPPORT_RJE}<br> IPPORT_FINGER = 79;<br> {$EXTERNALSYM IPPORT_FINGER}<br> IPPORT_TTYLINK = 87;<br> {$EXTERNALSYM IPPORT_TTYLINK}<br> IPPORT_SUPDUP = 95;<br> {$EXTERNALSYM IPPORT_SUPDUP}<br><br>//<br>// UNIX TCP sockets<br>//<br><br> IPPORT_EXECSERVER = 512;<br> {$EXTERNALSYM IPPORT_EXECSERVER}<br> IPPORT_LOGINSERVER = 513;<br> {$EXTERNALSYM IPPORT_LOGINSERVER}<br> IPPORT_CMDSERVER = 514;<br> {$EXTERNALSYM IPPORT_CMDSERVER}<br> IPPORT_EFSSERVER = 520;<br> {$EXTERNALSYM IPPORT_EFSSERVER}<br><br>//<br>// UNIX UDP sockets<br>//<br><br> IPPORT_BIFFUDP = 512;<br> {$EXTERNALSYM IPPORT_BIFFUDP}<br> IPPORT_WHOSERVER = 513;<br> {$EXTERNALSYM IPPORT_WHOSERVER}<br> IPPORT_ROUTESERVER = 520;<br> {$EXTERNALSYM IPPORT_ROUTESERVER}<br><br> // 520+1 also used<br><br>//<br>// Ports < IPPORT_RESERVED are reserved for<br>// privileged processes (e.g. root).<br>//<br><br> IPPORT_RESERVED = 1024;<br> {$EXTERNALSYM IPPORT_RESERVED}<br><br>//<br>// Link numbers<br>//<br><br> IMPLINK_IP = 155;<br> {$EXTERNALSYM IMPLINK_IP}<br> IMPLINK_LOWEXPER = 156;<br> {$EXTERNALSYM IMPLINK_LOWEXPER}<br> IMPLINK_HIGHEXPER = 158;<br> {$EXTERNALSYM IMPLINK_HIGHEXPER}<br><br>//<br>// Internet address (old style... should be updated)<br>//<br><br>type<br> SunB = packed record<br> s_b1, s_b2, s_b3, s_b4: u_char;<br> end;<br> {$EXTERNALSYM SunB}<br><br> SunC = packed record<br> s_c1, s_c2, s_c3, s_c4: Char;<br> end;<br> {$NODEFINE SunC}<br><br> SunW = packed record<br> s_w1, s_w2: u_short;<br> end;<br> {$EXTERNALSYM SunW}<br><br> in_addr = record<br> case Integer of<br> 0: (S_un_b: SunB);<br> 1: (S_un_c: SunC);<br> 2: (S_un_w: SunW);<br> 3: (S_addr: u_long);<br> // #define s_addr S_un.S_addr // can be used for most tcp & ip code<br> // #define s_host S_un.S_un_b.s_b2 // host on imp<br> // #define s_net S_un.S_un_b.s_b1 // netword<br> // #define s_imp S_un.S_un_w.s_w2 // imp<br> // #define s_impno S_un.S_un_b.s_b4 // imp #<br> // #define s_lh S_un.S_un_b.s_b3 // logical host<br> end;<br> {$EXTERNALSYM in_addr}<br> TInAddr = in_addr;<br> PInAddr = ^in_addr;<br><br>//<br>// Definitions of bits in internet address integers.<br>// On subnets, the decomposition of addresses to host and net parts<br>// is done according to subnet mask, not the masks here.<br>//<br><br>function IN_CLASSA(i: DWORD): Boolean;<br>{$EXTERNALSYM IN_CLASSA}<br><br>const<br> IN_CLASSA_NET = DWORD($ff000000);<br> {$EXTERNALSYM IN_CLASSA_NET}<br> IN_CLASSA_NSHIFT = 24;<br> {$EXTERNALSYM IN_CLASSA_NSHIFT}<br> IN_CLASSA_HOST = $00ffffff;<br> {$EXTERNALSYM IN_CLASSA_HOST}<br> IN_CLASSA_MAX = 128;<br> {$EXTERNALSYM IN_CLASSA_MAX}<br><br>function IN_CLASSB(i: DWORD): Boolean;<br>{$EXTERNALSYM IN_CLASSB}<br><br>const<br> IN_CLASSB_NET = DWORD($ffff0000);<br> {$EXTERNALSYM IN_CLASSB_NET}<br> IN_CLASSB_NSHIFT = 16;<br> {$EXTERNALSYM IN_CLASSB_NSHIFT}<br> IN_CLASSB_HOST = $0000ffff;<br> {$EXTERNALSYM IN_CLASSB_HOST}<br> IN_CLASSB_MAX = 65536;<br> {$EXTERNALSYM IN_CLASSB_MAX}<br><br>function IN_CLASSC(i: DWORD): Boolean;<br>{$EXTERNALSYM IN_CLASSC}<br><br>const<br> IN_CLASSC_NET = DWORD($ffffff00);<br> {$EXTERNALSYM IN_CLASSC_NET}<br> IN_CLASSC_NSHIFT = 8;<br> {$EXTERNALSYM IN_CLASSC_NSHIFT}<br> IN_CLASSC_HOST = $000000ff;<br> {$EXTERNALSYM IN_CLASSC_HOST}<br><br>function IN_CLASSD(i: DWORD): Boolean;<br>{$EXTERNALSYM IN_CLASSD}<br><br>const<br> IN_CLASSD_NET = DWORD($f0000000); // These ones aren't really<br> {$EXTERNALSYM IN_CLASSD_NET}<br> IN_CLASSD_NSHIFT = 28; // net and host fields, but<br> {$EXTERNALSYM IN_CLASSD_NSHIFT}<br> IN_CLASSD_HOST = $0fffffff; // routing needn't know.<br> {$EXTERNALSYM IN_CLASSD_HOST}<br><br>function IN_MULTICAST(i: DWORD): Boolean;<br>{$EXTERNALSYM IN_MULTICAST}<br><br>const<br> INADDR_ANY = u_long($00000000);<br> {$EXTERNALSYM INADDR_ANY}<br> INADDR_LOOPBACK = $7f000001;<br> {$EXTERNALSYM INADDR_LOOPBACK}<br> INADDR_BROADCAST = u_long($ffffffff);<br> {$EXTERNALSYM INADDR_BROADCAST}<br> INADDR_NONE = DWORD($ffffffff);<br> {$EXTERNALSYM INADDR_NONE}<br><br> ADDR_ANY = INADDR_ANY;<br> {$EXTERNALSYM ADDR_ANY}<br><br>//<br>// Socket address, internet style.<br>//<br><br>type<br> sockaddr_in = record<br> sin_family: Smallint;<br> sin_port: u_short;<br> sin_addr: in_addr;<br> sin_zero: array [0..7] of Char;<br> end;<br> {$EXTERNALSYM sockaddr_in}<br> TSockAddrIn = sockaddr_in;<br> PSockAddrIn = ^sockaddr_in;<br><br>const<br> WSADESCRIPTION_LEN = 256;<br> {$EXTERNALSYM WSADESCRIPTION_LEN}<br> WSASYS_STATUS_LEN = 128;<br> {$EXTERNALSYM WSASYS_STATUS_LEN}<br><br>type<br> WSAData = record<br> wVersion: WORD;<br> wHighVersion: WORD;<br> szDescription: array [0..WSADESCRIPTION_LEN] of Char;<br> szSystemStatus: array [0..WSASYS_STATUS_LEN] of Char;<br> iMaxSockets: Word;<br> iMaxUdpDg: Word;<br> lpVendorInfo: PChar;<br> end;<br> {$EXTERNALSYM WSAData}<br> LPWSADATA = ^WSAData;<br> {$EXTERNALSYM LPWSADATA}<br> TWsaData = WSAData;<br> PWsaData = LPWSADATA;<br><br>//<br>// Definitions related to sockets: types, address families, options,<br>// taken from the BSD file sys/socket.h.<br>//<br><br>//<br>// This is used instead of -1, since the<br>// SOCKET type is unsigned.<br>//<br><br>const<br> INVALID_SOCKET = TSocket(not 0);<br> {$EXTERNALSYM INVALID_SOCKET}<br> SOCKET_ERROR = -1;<br> {$EXTERNALSYM SOCKET_ERROR}<br><br>//<br>// The following may be used in place of the address family, socket type, or<br>// protocol in a call to WSASocket to indicate that the corresponding value<br>// should be taken from the supplied WSAPROTOCOL_INFO structure instead of the<br>// parameter itself.<br>//<br><br> FROM_PROTOCOL_INFO = -1;<br> {$EXTERNALSYM FROM_PROTOCOL_INFO}<br><br>//<br>// Types<br>//<br><br> SOCK_STREAM = 1; // stream socket<br> {$EXTERNALSYM SOCK_STREAM}<br> SOCK_DGRAM = 2; // datagram socket<br> {$EXTERNALSYM SOCK_DGRAM}<br> SOCK_RAW = 3; // raw-protocol interface<br> {$EXTERNALSYM SOCK_RAW}<br> SOCK_RDM = 4; // reliably-delivered message<br> {$EXTERNALSYM SOCK_RDM}<br> SOCK_SEQPACKET = 5; // sequenced packet stream<br> {$EXTERNALSYM SOCK_SEQPACKET}<br><br>//<br>// Option flags per-socket.<br>//<br><br> SO_DEBUG = $0001; // turn on debugging info recording<br> {$EXTERNALSYM SO_DEBUG}<br> SO_ACCEPTCONN = $0002; // socket has had listen()<br> {$EXTERNALSYM SO_ACCEPTCONN}<br> SO_REUSEADDR = $0004; // allow local address reuse<br> {$EXTERNALSYM SO_REUSEADDR}<br> SO_KEEPALIVE = $0008; // keep connections alive<br> {$EXTERNALSYM SO_KEEPALIVE}<br> SO_DONTROUTE = $0010; // just use interface addresses<br> {$EXTERNALSYM SO_DONTROUTE}<br> SO_BROADCAST = $0020; // permit sending of broadcast msgs<br> {$EXTERNALSYM SO_BROADCAST}<br> SO_USELOOPBACK = $0040; // bypass hardware when possible<br> {$EXTERNALSYM SO_USELOOPBACK}<br> SO_LINGER = $0080; // linger on close if data present<br> {$EXTERNALSYM SO_LINGER}<br> SO_OOBINLINE = $0100; // leave received OOB data in line<br> {$EXTERNALSYM SO_OOBINLINE}<br><br> SO_DONTLINGER = DWORD(not SO_LINGER);<br> {$EXTERNALSYM SO_DONTLINGER}<br> SO_EXCLUSIVEADDRUSE = DWORD(not SO_REUSEADDR); // disallow local address reuse<br> {$EXTERNALSYM SO_EXCLUSIVEADDRUSE}<br><br>//<br>// Additional options.<br>//<br><br> SO_SNDBUF = $1001; // send buffer size<br> {$EXTERNALSYM SO_SNDBUF}<br> SO_RCVBUF = $1002; // receive buffer size<br> {$EXTERNALSYM SO_RCVBUF}<br> SO_SNDLOWAT = $1003; // send low-water mark<br> {$EXTERNALSYM SO_SNDLOWAT}<br> SO_RCVLOWAT = $1004; // receive low-water mark<br> {$EXTERNALSYM SO_RCVLOWAT}<br> SO_SNDTIMEO = $1005; // send timeout<br> {$EXTERNALSYM SO_SNDTIMEO}<br> SO_RCVTIMEO = $1006; // receive timeout<br> {$EXTERNALSYM SO_RCVTIMEO}<br> SO_ERROR = $1007; // get error status and clear<br> {$EXTERNALSYM SO_ERROR}<br> SO_TYPE = $1008; // get socket type<br> {$EXTERNALSYM SO_TYPE}<br><br>//<br>// WinSock 2 extension -- new options<br>//<br><br> SO_GROUP_ID = $2001; // ID of a socket group<br> {$EXTERNALSYM SO_GROUP_ID}<br> SO_GROUP_PRIORITY = $2002; // the relative priority within a group<br> {$EXTERNALSYM SO_GROUP_PRIORITY}<br> SO_MAX_MSG_SIZE = $2003; // maximum message size<br> {$EXTERNALSYM SO_MAX_MSG_SIZE}<br> SO_PROTOCOL_INFOA = $2004; // WSAPROTOCOL_INFOA structure<br> {$EXTERNALSYM SO_PROTOCOL_INFOA}<br> SO_PROTOCOL_INFOW = $2005; // WSAPROTOCOL_INFOW structure<br> {$EXTERNALSYM SO_PROTOCOL_INFOW}<br><br> {$IFDEF UNICODE}<br> SO_PROTOCOL_INFO = SO_PROTOCOL_INFOW;<br> {$EXTERNALSYM SO_PROTOCOL_INFO}<br> {$ELSE}<br> SO_PROTOCOL_INFO = SO_PROTOCOL_INFOA;<br> {$EXTERNALSYM SO_PROTOCOL_INFO}<br> {$ENDIF UNICODE}<br><br> PVD_CONFIG = $3001; // configuration info for service provider<br> {$EXTERNALSYM PVD_CONFIG}<br> SO_CONDITIONAL_ACCEPT = $3002; // enable true conditional accept:<br> // connection is not ack-ed to the<br> // other side until conditional<br> // function returns CF_ACCEPT<br> {$EXTERNALSYM SO_CONDITIONAL_ACCEPT}<br><br>//<br>// TCP options.<br>//<br><br> TCP_NODELAY = $0001;<br> {$EXTERNALSYM TCP_NODELAY}<br><br>//<br>// Address families.<br>//<br><br> AF_UNSPEC = 0; // unspecified<br> {$EXTERNALSYM AF_UNSPEC}<br><br>//<br>// Although AF_UNSPEC is defined for backwards compatibility, using<br>// AF_UNSPEC for the "af" parameter when creating a socket is STRONGLY<br>// DISCOURAGED. The interpretation of the "protocol" parameter<br>// depends on the actual address family chosen. As environments grow<br>// to include more and more address families that use overlapping<br>// protocol values there is more and more chance of choosing an<br>// undesired address family when AF_UNSPEC is used.<br>//<br><br> AF_UNIX = 1; // local to host (pipes, portals<br> {$EXTERNALSYM AF_UNIX}<br> AF_INET = 2; // internetwork: UDP, TCP, etc.<br> {$EXTERNALSYM AF_INET}<br> AF_IMPLINK = 3; // arpanet imp addresses<br> {$EXTERNALSYM AF_IMPLINK}<br> AF_PUP = 4; // pup protocols: e.g. BSP<br> {$EXTERNALSYM AF_PUP}<br> AF_CHAOS = 5; // mit CHAOS protocols<br> {$EXTERNALSYM AF_CHAOS}<br> AF_NS = 6; // XEROX NS protocols<br> {$EXTERNALSYM AF_NS}<br> AF_IPX = AF_NS; // IPX protocols: IPX, SPX, etc.<br> {$EXTERNALSYM AF_IPX}<br> AF_ISO = 7; // ISO protocols<br> {$EXTERNALSYM AF_ISO}<br> AF_OSI = AF_ISO; // OSI is ISO<br> {$EXTERNALSYM AF_OSI}<br> AF_ECMA = 8; // european computer manufacturers<br> {$EXTERNALSYM AF_ECMA}<br> AF_DATAKIT = 9; // datakit protocols<br> {$EXTERNALSYM AF_DATAKIT}<br> AF_CCITT = 10; // CCITT protocols, X.25 etc<br> {$EXTERNALSYM AF_CCITT}<br> AF_SNA = 11; // IBM SNA<br> {$EXTERNALSYM AF_SNA}<br> AF_DECnet = 12; // DECnet<br> {$EXTERNALSYM AF_DECnet}<br> AF_DLI = 13; // Direct data link interface<br> {$EXTERNALSYM AF_DLI}<br> AF_LAT = 14; // LAT<br> {$EXTERNALSYM AF_LAT}<br> AF_HYLINK = 15; // NSC Hyperchannel<br> {$EXTERNALSYM AF_HYLINK}<br> AF_APPLETALK = 16; // AppleTalk<br> {$EXTERNALSYM AF_APPLETALK}<br> AF_NETBIOS = 17; // NetBios-style addresses<br> {$EXTERNALSYM AF_NETBIOS}<br> AF_VOICEVIEW = 18; // VoiceView<br> {$EXTERNALSYM AF_VOICEVIEW}<br> AF_FIREFOX = 19; // Protocols from Firefox<br> {$EXTERNALSYM AF_FIREFOX}<br> AF_UNKNOWN1 = 20; // Somebody is using this!<br> {$EXTERNALSYM AF_UNKNOWN1}<br> AF_BAN = 21; // Banyan<br> {$EXTERNALSYM AF_BAN}<br> AF_ATM = 22; // Native ATM Services<br> {$EXTERNALSYM AF_ATM}<br> AF_INET6 = 23; // Internetwork Version 6<br> {$EXTERNALSYM AF_INET6}<br> AF_CLUSTER = 24; // Microsoft Wolfpack<br> {$EXTERNALSYM AF_CLUSTER}<br> AF_12844 = 25; // IEEE 1284.4 WG AF<br> {$EXTERNALSYM AF_12844}<br> AF_IRDA = 26; // IrDA<br> {$EXTERNALSYM AF_IRDA}<br> AF_NETDES = 28; // Network Designers OSI & gateway enabled protocols<br> {$EXTERNALSYM AF_NETDES}<br><br> AF_TCNPROCESS = 29;<br> {$EXTERNALSYM AF_TCNPROCESS}<br> AF_TCNMESSAGE = 30;<br> {$EXTERNALSYM AF_TCNMESSAGE}<br> AF_ICLFXBM = 31;<br> {$EXTERNALSYM AF_ICLFXBM}<br><br> AF_MAX = 32;<br> {$EXTERNALSYM AF_MAX}<br><br>//<br>// Structure used by kernel to store most<br>// addresses.<br>//<br><br>type<br> sockaddr = record<br> sa_family: u_short; // address family<br> sa_data: array [0..13] of Char; // up to 14 bytes of direct address<br> end;<br> {$EXTERNALSYM sockaddr}<br> TSockAddr = sockaddr;<br> PSockAddr = ^sockaddr;<br><br>//<br>// Portable socket structure (RFC 2553).<br>//<br><br>//<br>// Desired design of maximum size and alignment.<br>// These are implementation specific.<br>//<br><br>const<br> _SS_MAXSIZE = 128; // Maximum size.<br> {$EXTERNALSYM _SS_MAXSIZE}<br> _SS_ALIGNSIZE = SizeOf(Int64); // Desired alignment.<br> {$EXTERNALSYM _SS_ALIGNSIZE}<br><br>//<br>// Definitions used for sockaddr_storage structure paddings design.<br>//<br><br> _SS_PAD1SIZE = _SS_ALIGNSIZE - SizeOf(short);<br> {$EXTERNALSYM _SS_PAD1SIZE}<br> _SS_PAD2SIZE = _SS_MAXSIZE - (SizeOf(short) + _SS_PAD1SIZE + _SS_ALIGNSIZE);<br> {$EXTERNALSYM _SS_PAD2SIZE}<br> <br>type<br> sockaddr_storage = record<br> ss_family: short; // Address family.<br> __ss_pad1: array [0.._SS_PAD1SIZE - 1] of char; // 6 byte pad, this is to make<br> // implementation specific pad up to<br> // alignment field that follows explicit<br> // in the data structure.<br> __ss_align: Int64; // Field to force desired structure.<br> __ss_pad2: array [0.._SS_PAD2SIZE - 1] of char; // 112 byte pad to achieve desired size;<br> // _SS_MAXSIZE value minus size of<br> // ss_family, __ss_pad1, and<br> // __ss_align fields is 112.<br> end;<br> {$EXTERNALSYM sockaddr_storage}<br> TSockAddrStorage = sockaddr_storage;<br> PSockAddrStorage = ^sockaddr_storage;<br><br>//<br>// Structure used by kernel to pass protocol<br>// information in raw sockets.<br>//<br><br> sockproto = record<br> sp_family: u_short; // address family<br> sp_protocol: u_short; // protocol<br> end;<br> {$EXTERNALSYM sockproto}<br> TSockProto = sockproto;<br> PSockProto = ^sockproto;<br><br>//<br>// Protocol families, same as address families for now.<br>//<br><br>const<br> PF_UNSPEC = AF_UNSPEC;<br> {$EXTERNALSYM PF_UNSPEC}<br> PF_UNIX = AF_UNIX;<br> {$EXTERNALSYM PF_UNIX}<br> PF_INET = AF_INET;<br> {$EXTERNALSYM PF_INET}<br> PF_IMPLINK = AF_IMPLINK;<br> {$EXTERNALSYM PF_IMPLINK}<br> PF_PUP = AF_PUP;<br> {$EXTERNALSYM PF_PUP}<br> PF_CHAOS = AF_CHAOS;<br> {$EXTERNALSYM PF_CHAOS}<br> PF_NS = AF_NS;<br> {$EXTERNALSYM PF_NS}<br> PF_IPX = AF_IPX;<br> {$EXTERNALSYM PF_IPX}<br> PF_ISO = AF_ISO;<br> {$EXTERNALSYM PF_ISO}<br> PF_OSI = AF_OSI;<br> {$EXTERNALSYM PF_OSI}<br> PF_ECMA = AF_ECMA;<br> {$EXTERNALSYM PF_ECMA}<br> PF_DATAKIT = AF_DATAKIT;<br> {$EXTERNALSYM PF_DATAKIT}<br> PF_CCITT = AF_CCITT;<br> {$EXTERNALSYM PF_CCITT}<br> PF_SNA = AF_SNA;<br> {$EXTERNALSYM PF_SNA}<br> PF_DECnet = AF_DECnet;<br> {$EXTERNALSYM PF_DECnet}<br> PF_DLI = AF_DLI;<br> {$EXTERNALSYM PF_DLI}<br> PF_LAT = AF_LAT;<br> {$EXTERNALSYM PF_LAT}<br> PF_HYLINK = AF_HYLINK;<br> {$EXTERNALSYM PF_HYLINK}<br> PF_APPLETALK = AF_APPLETALK;<br> {$EXTERNALSYM PF_APPLETALK}<br> PF_VOICEVIEW = AF_VOICEVIEW;<br> {$EXTERNALSYM PF_VOICEVIEW}<br> PF_FIREFOX = AF_FIREFOX;<br> {$EXTERNALSYM PF_FIREFOX}<br> PF_UNKNOWN1 = AF_UNKNOWN1;<br> {$EXTERNALSYM PF_UNKNOWN1}<br> PF_BAN = AF_BAN;<br> {$EXTERNALSYM PF_BAN}<br> PF_ATM = AF_ATM;<br> {$EXTERNALSYM PF_ATM}<br> PF_INET6 = AF_INET6;<br> {$EXTERNALSYM PF_INET6}<br><br> PF_MAX = AF_MAX;<br> {$EXTERNALSYM PF_MAX}<br><br>//<br>// Structure used for manipulating linger option.<br>//<br><br>type<br> linger = record<br> l_onoff: u_short; // option on/off<br> l_linger: u_short; // linger time<br> end;<br> {$EXTERNALSYM linger}<br> TLinger = linger;<br> PLinger = ^linger;<br><br>//<br>// Level number for (get/set)sockopt() to apply to socket itself.<br>//<br><br>const<br> SOL_SOCKET = $ffff; // options for socket level<br> {$EXTERNALSYM SOL_SOCKET}<br><br>//<br>// Maximum queue length specifiable by listen.<br>//<br><br> SOMAXCONN = $7fffffff;<br> {$EXTERNALSYM SOMAXCONN}<br><br> MSG_OOB = $1; // process out-of-band data<br> {$EXTERNALSYM MSG_OOB}<br> MSG_PEEK = $2; // peek at incoming message<br> {$EXTERNALSYM MSG_PEEK}<br> MSG_DONTROUTE = $4; // send without using routing tables<br> {$EXTERNALSYM MSG_DONTROUTE}<br><br> MSG_PARTIAL = $8000; // partial send or recv for message xport<br> {$EXTERNALSYM MSG_PARTIAL}<br><br>//<br>// WinSock 2 extension -- new flags for WSASend(), WSASendTo(), WSARecv() and<br>// WSARecvFrom()<br>//<br><br> MSG_INTERRUPT = $10; // send/recv in the interrupt context<br> {$EXTERNALSYM MSG_INTERRUPT}<br><br> MSG_MAXIOVLEN = 16;<br> {$EXTERNALSYM MSG_MAXIOVLEN}<br><br>//<br>// Define constant based on rfc883, used by gethostbyxxxx() calls.<br>//<br><br> MAXGETHOSTSTRUCT = 1024;<br> {$EXTERNALSYM MAXGETHOSTSTRUCT}<br><br>//<br>// WinSock 2 extension -- bit values and indices for FD_XXX network events<br>//<br><br> FD_READ_BIT = 0;<br> {$EXTERNALSYM FD_READ_BIT}<br> FD_READ = 1 shl FD_READ_BIT;<br> {$EXTERNALSYM FD_READ}<br><br> FD_WRITE_BIT = 1;<br> {$EXTERNALSYM FD_WRITE_BIT}<br> FD_WRITE = 1 shl FD_WRITE_BIT;<br> {$EXTERNALSYM FD_WRITE}<br><br> FD_OOB_BIT = 2;<br> {$EXTERNALSYM FD_OOB_BIT}<br> FD_OOB = 1 shl FD_OOB_BIT;<br> {$EXTERNALSYM FD_OOB}<br><br> FD_ACCEPT_BIT = 3;<br> {$EXTERNALSYM FD_ACCEPT_BIT}<br> FD_ACCEPT = 1 shl FD_ACCEPT_BIT;<br> {$EXTERNALSYM FD_ACCEPT}<br><br> FD_CONNECT_BIT = 4;<br> {$EXTERNALSYM FD_CONNECT_BIT}<br> FD_CONNECT = 1 shl FD_CONNECT_BIT;<br> {$EXTERNALSYM FD_CONNECT}<br><br> FD_CLOSE_BIT = 5;<br> {$EXTERNALSYM FD_CLOSE_BIT}<br> FD_CLOSE = 1 shl FD_CLOSE_BIT;<br> {$EXTERNALSYM FD_CLOSE}<br><br> FD_QOS_BIT = 6;<br> {$EXTERNALSYM FD_QOS_BIT}<br> FD_QOS = 1 shl FD_QOS_BIT;<br> {$EXTERNALSYM FD_QOS}<br><br> FD_GROUP_QOS_BIT = 7;<br> {$EXTERNALSYM FD_GROUP_QOS_BIT}<br> FD_GROUP_QOS = 1 shl FD_GROUP_QOS_BIT;<br> {$EXTERNALSYM FD_GROUP_QOS}<br><br> FD_ROUTING_INTERFACE_CHANGE_BIT = 8;<br> {$EXTERNALSYM FD_ROUTING_INTERFACE_CHANGE_BIT}<br> FD_ROUTING_INTERFACE_CHANGE = 1 shl FD_ROUTING_INTERFACE_CHANGE_BIT;<br> {$EXTERNALSYM FD_ROUTING_INTERFACE_CHANGE}<br><br> FD_ADDRESS_LIST_CHANGE_BIT = 9;<br> {$EXTERNALSYM FD_ADDRESS_LIST_CHANGE_BIT}<br> FD_ADDRESS_LIST_CHANGE = 1 shl FD_ADDRESS_LIST_CHANGE_BIT;<br> {$EXTERNALSYM FD_ADDRESS_LIST_CHANGE}<br><br> FD_MAX_EVENTS = 10;<br> {$EXTERNALSYM FD_MAX_EVENTS}<br> FD_ALL_EVENTS = (1 shl FD_MAX_EVENTS) - 1;<br> {$EXTERNALSYM FD_ALL_EVENTS}<br><br>//<br>// All Windows Sockets error constants are biased by WSABASEERR from<br>// the "normal"<br>//<br><br> WSABASEERR = 10000;<br> {$EXTERNALSYM WSABASEERR}<br><br>//<br>// Windows Sockets definitions of regular Microsoft C error constants<br>//<br><br> WSAEINTR = WSABASEERR + 4;<br> {$EXTERNALSYM WSAEINTR}<br> WSAEBADF = WSABASEERR + 9;<br> {$EXTERNALSYM WSAEBADF}<br> WSAEACCES = WSABASEERR + 13;<br> {$EXTERNALSYM WSAEACCES}<br> WSAEFAULT = WSABASEERR + 14;<br> {$EXTERNALSYM WSAEFAULT}<br> WSAEINVAL = WSABASEERR + 22;<br> {$EXTERNALSYM WSAEINVAL}<br> WSAEMFILE = WSABASEERR + 24;<br> {$EXTERNALSYM WSAEMFILE}<br><br>//<br>// Windows Sockets definitions of regular Berkeley error constants<br>//<br><br> WSAEWOULDBLOCK = WSABASEERR + 35;<br> {$EXTERNALSYM WSAEWOULDBLOCK}<br> WSAEINPROGRESS = WSABASEERR + 36;<br> {$EXTERNALSYM WSAEINPROGRESS}<br> WSAEALREADY = WSABASEERR + 37;<br> {$EXTERNALSYM WSAEALREADY}<br> WSAENOTSOCK = WSABASEERR + 38;<br> {$EXTERNALSYM WSAENOTSOCK}<br> WSAEDESTADDRREQ = WSABASEERR + 39;<br> {$EXTERNALSYM WSAEDESTADDRREQ}<br> WSAEMSGSIZE = WSABASEERR + 40;<br> {$EXTERNALSYM WSAEMSGSIZE}<br> WSAEPROTOTYPE = WSABASEERR + 41;<br> {$EXTERNALSYM WSAEPROTOTYPE}<br> WSAENOPROTOOPT = WSABASEERR + 42;<br> {$EXTERNALSYM WSAENOPROTOOPT}<br> WSAEPROTONOSUPPORT = WSABASEERR + 43;<br> {$EXTERNALSYM WSAEPROTONOSUPPORT}<br> WSAESOCKTNOSUPPORT = WSABASEERR + 44;<br> {$EXTERNALSYM WSAESOCKTNOSUPPORT}<br> WSAEOPNOTSUPP = WSABASEERR + 45;<br> {$EXTERNALSYM WSAEOPNOTSUPP}<br> WSAEPFNOSUPPORT = WSABASEERR + 46;<br> {$EXTERNALSYM WSAEPFNOSUPPORT}<br> WSAEAFNOSUPPORT = WSABASEERR + 47;<br> {$EXTERNALSYM WSAEAFNOSUPPORT}<br> WSAEADDRINUSE = WSABASEERR + 48;<br> {$EXTERNALSYM WSAEADDRINUSE}<br> WSAEADDRNOTAVAIL = WSABASEERR + 49;<br> {$EXTERNALSYM WSAEADDRNOTAVAIL}<br> WSAENETDOWN = WSABASEERR + 50;<br> {$EXTERNALSYM WSAENETDOWN}<br> WSAENETUNREACH = WSABASEERR + 51;<br> {$EXTERNALSYM WSAENETUNREACH}<br> WSAENETRESET = WSABASEERR + 52;<br> {$EXTERNALSYM WSAENETRESET}<br> WSAECONNABORTED = WSABASEERR + 53;<br> {$EXTERNALSYM WSAECONNABORTED}<br> WSAECONNRESET = WSABASEERR + 54;<br> {$EXTERNALSYM WSAECONNRESET}<br> WSAENOBUFS = WSABASEERR + 55;<br> {$EXTERNALSYM WSAENOBUFS}<br> WSAEISCONN = WSABASEERR + 56;<br> {$EXTERNALSYM WSAEISCONN}<br> WSAENOTCONN = WSABASEERR + 57;<br> {$EXTERNALSYM WSAENOTCONN}<br> WSAESHUTDOWN = WSABASEERR + 58;<br> {$EXTERNALSYM WSAESHUTDOWN}<br> WSAETOOMANYREFS = WSABASEERR + 59;<br> {$EXTERNALSYM WSAETOOMANYREFS}<br> WSAETIMEDOUT = WSABASEERR + 60;<br> {$EXTERNALSYM WSAETIMEDOUT}<br> WSAECONNREFUSED = WSABASEERR + 61;<br> {$EXTERNALSYM WSAECONNREFUSED}<br> WSAELOOP = WSABASEERR + 62;<br> {$EXTERNALSYM WSAELOOP}<br> WSAENAMETOOLONG = WSABASEERR + 63;<br> {$EXTERNALSYM WSAENAMETOOLONG}<br> WSAEHOSTDOWN = WSABASEERR + 64;<br> {$EXTERNALSYM WSAEHOSTDOWN}<br> WSAEHOSTUNREACH = WSABASEERR + 65;<br> {$EXTERNALSYM WSAEHOSTUNREACH}<br> WSAENOTEMPTY = WSABASEERR + 66;<br> {$EXTERNALSYM WSAENOTEMPTY}<br> WSAEPROCLIM = WSABASEERR + 67;<br> {$EXTERNALSYM WSAEPROCLIM}<br> WSAEUSERS = WSABASEERR + 68;<br> {$EXTERNALSYM WSAEUSERS}<br> WSAEDQUOT = WSABASEERR + 69;<br> {$EXTERNALSYM WSAEDQUOT}<br> WSAESTALE = WSABASEERR + 70;<br> {$EXTERNALSYM WSAESTALE}<br> WSAEREMOTE = WSABASEERR + 71;<br> {$EXTERNALSYM WSAEREMOTE}<br><br>//<br>// Extended Windows Sockets error constant definitions<br>//<br><br> WSASYSNOTREADY = WSABASEERR + 91;<br> {$EXTERNALSYM WSASYSNOTREADY}<br> WSAVERNOTSUPPORTED = WSABASEERR + 92;<br> {$EXTERNALSYM WSAVERNOTSUPPORTED}<br> WSANOTINITIALISED = WSABASEERR + 93;<br> {$EXTERNALSYM WSANOTINITIALISED}<br> WSAEDISCON = WSABASEERR + 101;<br> {$EXTERNALSYM WSAEDISCON}<br> WSAENOMORE = WSABASEERR + 102;<br> {$EXTERNALSYM WSAENOMORE}<br> WSAECANCELLED = WSABASEERR + 103;<br> {$EXTERNALSYM WSAECANCELLED}<br> WSAEINVALIDPROCTABLE = WSABASEERR + 104;<br> {$EXTERNALSYM WSAEINVALIDPROCTABLE}<br> WSAEINVALIDPROVIDER = WSABASEERR + 105;<br> {$EXTERNALSYM WSAEINVALIDPROVIDER}<br> WSAEPROVIDERFAILEDINIT = WSABASEERR + 106;<br> {$EXTERNALSYM WSAEPROVIDERFAILEDINIT}<br> WSASYSCALLFAILURE = WSABASEERR + 107;<br> {$EXTERNALSYM WSASYSCALLFAILURE}<br> WSASERVICE_NOT_FOUND = WSABASEERR + 108;<br> {$EXTERNALSYM WSASERVICE_NOT_FOUND}<br> WSATYPE_NOT_FOUND = WSABASEERR + 109;<br> {$EXTERNALSYM WSATYPE_NOT_FOUND}<br> WSA_E_NO_MORE = WSABASEERR + 110;<br> {$EXTERNALSYM WSA_E_NO_MORE}<br> WSA_E_CANCELLED = WSABASEERR + 111;<br> {$EXTERNALSYM WSA_E_CANCELLED}<br> WSAEREFUSED = WSABASEERR + 112;<br> {$EXTERNALSYM WSAEREFUSED}<br><br>//<br>// Error return codes from gethostbyname() and gethostbyaddr()<br>// (when using the resolver). Note that these errors are<br>// retrieved via WSAGetLastError() and must therefore follow<br>// the rules for avoiding clashes with error numbers from<br>// specific implementations or language run-time systems.<br>// For this reason the codes are based at WSABASEERR+1001.<br>// Note also that [WSA]NO_ADDRESS is defined only for<br>// compatibility purposes.<br>//<br><br>// Authoritative Answer: Host not found<br><br> WSAHOST_NOT_FOUND = WSABASEERR + 1001;<br> {$EXTERNALSYM WSAHOST_NOT_FOUND}<br><br>// Non-Authoritative: Host not found, or SERVERFAIL<br><br> WSATRY_AGAIN = WSABASEERR + 1002;<br> {$EXTERNALSYM WSATRY_AGAIN}<br><br>// Non-recoverable errors, FORMERR, REFUSED, NOTIMP<br><br> WSANO_RECOVERY = WSABASEERR + 1003;<br> {$EXTERNALSYM WSANO_RECOVERY}<br><br>// Valid name, no data record of requested type<br><br> WSANO_DATA = WSABASEERR + 1004;<br> {$EXTERNALSYM WSANO_DATA}<br><br>//<br>// Define QOS related error return codes<br>//<br>//<br><br> WSA_QOS_RECEIVERS = WSABASEERR + 1005; // at least one Reserve has arrived<br> {$EXTERNALSYM WSA_QOS_RECEIVERS}<br> WSA_QOS_SENDERS = WSABASEERR + 1006; // at least one Path has arrived<br> {$EXTERNALSYM WSA_QOS_SENDERS}<br> WSA_QOS_NO_SENDERS = WSABASEERR + 1007; // there are no senders<br> {$EXTERNALSYM WSA_QOS_NO_SENDERS}<br> WSA_QOS_NO_RECEIVERS = WSABASEERR + 1008; // there are no receivers<br> {$EXTERNALSYM WSA_QOS_NO_RECEIVERS}<br> WSA_QOS_REQUEST_CONFIRMED = WSABASEERR + 1009; // Reserve has been confirmed<br> {$EXTERNALSYM WSA_QOS_REQUEST_CONFIRMED}<br> WSA_QOS_ADMISSION_FAILURE = WSABASEERR + 1010; // error due to lack of resources<br> {$EXTERNALSYM WSA_QOS_ADMISSION_FAILURE}<br> WSA_QOS_POLICY_FAILURE = WSABASEERR + 1011; // rejected for administrative reasons - bad credentials<br> {$EXTERNALSYM WSA_QOS_POLICY_FAILURE}<br> WSA_QOS_BAD_STYLE = WSABASEERR + 1012; // unknown or conflicting style<br> {$EXTERNALSYM WSA_QOS_BAD_STYLE}<br> WSA_QOS_BAD_OBJECT = WSABASEERR + 1013; // problem with some part of the filterspec or providerspecific buffer in general<br> {$EXTERNALSYM WSA_QOS_BAD_OBJECT}<br> WSA_QOS_TRAFFIC_CTRL_ERROR = WSABASEERR + 1014; // problem with some part of the flowspec<br> {$EXTERNALSYM WSA_QOS_TRAFFIC_CTRL_ERROR}<br> WSA_QOS_GENERIC_ERROR = WSABASEERR + 1015; // general error<br> {$EXTERNALSYM WSA_QOS_GENERIC_ERROR}<br> WSA_QOS_ESERVICETYPE = WSABASEERR + 1016; // invalid service type in flowspec<br> {$EXTERNALSYM WSA_QOS_ESERVICETYPE}<br> WSA_QOS_EFLOWSPEC = WSABASEERR + 1017; // invalid flowspec<br> {$EXTERNALSYM WSA_QOS_EFLOWSPEC}<br> WSA_QOS_EPROVSPECBUF = WSABASEERR + 1018; // invalid provider specific buffer<br> {$EXTERNALSYM WSA_QOS_EPROVSPECBUF}<br> WSA_QOS_EFILTERSTYLE = WSABASEERR + 1019; // invalid filter style<br> {$EXTERNALSYM WSA_QOS_EFILTERSTYLE}<br> WSA_QOS_EFILTERTYPE = WSABASEERR + 1020; // invalid filter type<br> {$EXTERNALSYM WSA_QOS_EFILTERTYPE}<br> WSA_QOS_EFILTERCOUNT = WSABASEERR + 1021; // incorrect number of filters<br> {$EXTERNALSYM WSA_QOS_EFILTERCOUNT}<br> WSA_QOS_EOBJLENGTH = WSABASEERR + 1022; // invalid object length<br> {$EXTERNALSYM WSA_QOS_EOBJLENGTH}<br> WSA_QOS_EFLOWCOUNT = WSABASEERR + 1023; // incorrect number of flows<br> {$EXTERNALSYM WSA_QOS_EFLOWCOUNT}<br> WSA_QOS_EUNKOWNPSOBJ = WSABASEERR + 1024; // unknown object in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_EUNKOWNPSOBJ}<br> WSA_QOS_EPOLICYOBJ = WSABASEERR + 1025; // invalid policy object in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_EPOLICYOBJ}<br> WSA_QOS_EFLOWDESC = WSABASEERR + 1026; // invalid flow descriptor in the list<br> {$EXTERNALSYM WSA_QOS_EFLOWDESC}<br> WSA_QOS_EPSFLOWSPEC = WSABASEERR + 1027; // inconsistent flow spec in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_EPSFLOWSPEC}<br> WSA_QOS_EPSFILTERSPEC = WSABASEERR + 1028; // invalid filter spec in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_EPSFILTERSPEC}<br> WSA_QOS_ESDMODEOBJ = WSABASEERR + 1029; // invalid shape discard mode object in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_ESDMODEOBJ}<br> WSA_QOS_ESHAPERATEOBJ = WSABASEERR + 1030; // invalid shaping rate object in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_ESHAPERATEOBJ}<br> WSA_QOS_RESERVED_PETYPE = WSABASEERR + 1031; // reserved policy element in provider specific buffer<br> {$EXTERNALSYM WSA_QOS_RESERVED_PETYPE}<br><br>//<br>// Compatibility macros.<br>//<br><br>function h_errno: Integer;<br>{$EXTERNALSYM h_errno}<br><br>const<br> HOST_NOT_FOUND = WSAHOST_NOT_FOUND;<br> {$EXTERNALSYM HOST_NOT_FOUND}<br> TRY_AGAIN = WSATRY_AGAIN;<br> {$EXTERNALSYM TRY_AGAIN}<br> NO_RECOVERY = WSANO_RECOVERY;<br> {$EXTERNALSYM NO_RECOVERY}<br> NO_DATA = WSANO_DATA;<br> {$EXTERNALSYM NO_DATA}<br><br>// no address, look for MX record<br><br> WSANO_ADDRESS = WSANO_DATA;<br> {$EXTERNALSYM WSANO_ADDRESS}<br> NO_ADDRESS = WSANO_ADDRESS;<br> {$EXTERNALSYM NO_ADDRESS}<br><br>//<br>// Windows Sockets errors redefined as regular Berkeley error constants.<br>// These are commented out in Windows NT to avoid conflicts with errno.h.<br>// Use the WSA constants instead.<br>//<br><br>{$IFDEF FALSE}<br><br>const<br> EWOULDBLOCK = WSAEWOULDBLOCK;<br> {$EXTERNALSYM EWOULDBLOCK}<br> EINPROGRESS = WSAEINPROGRESS;<br> {$EXTERNALSYM EINPROGRESS}<br> EALREADY = WSAEALREADY;<br> {$EXTERNALSYM EALREADY}<br> ENOTSOCK = WSAENOTSOCK;<br> {$EXTERNALSYM ENOTSOCK}<br> EDESTADDRREQ = WSAEDESTADDRREQ;<br> {$EXTERNALSYM EDESTADDRREQ}<br> EMSGSIZE = WSAEMSGSIZE;<br> {$EXTERNALSYM EMSGSIZE}<br> EPROTOTYPE = WSAEPROTOTYPE;<br> {$EXTERNALSYM EPROTOTYPE}<br> ENOPROTOOPT = WSAENOPROTOOPT;<br> {$EXTERNALSYM ENOPROTOOPT}<br> EPROTONOSUPPORT = WSAEPROTONOSUPPORT;<br> {$EXTERNALSYM EPROTONOSUPPORT}<br> ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT;<br> {$EXTERNALSYM ESOCKTNOSUPPORT}<br> EOPNOTSUPP = WSAEOPNOTSUPP;<br> {$EXTERNALSYM EOPNOTSUPP}<br> EPFNOSUPPORT = WSAEPFNOSUPPORT;<br> {$EXTERNALSYM EPFNOSUPPORT}<br> EAFNOSUPPORT = WSAEAFNOSUPPORT;<br> {$EXTERNALSYM EAFNOSUPPORT}<br> EADDRINUSE = WSAEADDRINUSE;<br> {$EXTERNALSYM EADDRINUSE}<br> EADDRNOTAVAIL = WSAEADDRNOTAVAIL;<br> {$EXTERNALSYM EADDRNOTAVAIL}<br> ENETDOWN = WSAENETDOWN;<br> {$EXTERNALSYM ENETDOWN}<br> ENETUNREACH = WSAENETUNREACH;<br> {$EXTERNALSYM ENETUNREACH}<br> ENETRESET = WSAENETRESET;<br> {$EXTERNALSYM ENETRESET}<br> ECONNABORTED = WSAECONNABORTED;<br> {$EXTERNALSYM ECONNABORTED}<br> ECONNRESET = WSAECONNRESET;<br> {$EXTERNALSYM ECONNRESET}<br> ENOBUFS = WSAENOBUFS;<br> {$EXTERNALSYM ENOBUFS}<br> EISCONN = WSAEISCONN;<br> {$EXTERNALSYM EISCONN}<br> ENOTCONN = WSAENOTCONN;<br> {$EXTERNALSYM ENOTCONN}<br> ESHUTDOWN = WSAESHUTDOWN;<br> {$EXTERNALSYM ESHUTDOWN}<br> ETOOMANYREFS = WSAETOOMANYREFS;<br> {$EXTERNALSYM ETOOMANYREFS}<br> ETIMEDOUT = WSAETIMEDOUT;<br> {$EXTERNALSYM ETIMEDOUT}<br> ECONNREFUSED = WSAECONNREFUSED;<br> {$EXTERNALSYM ECONNREFUSED}<br> ELOOP = WSAELOOP;<br> {$EXTERNALSYM ELOOP}<br> ENAMETOOLONG = WSAENAMETOOLONG;<br> {$EXTERNALSYM ENAMETOOLONG}<br> EHOSTDOWN = WSAEHOSTDOWN;<br> {$EXTERNALSYM EHOSTDOWN}<br> EHOSTUNREACH = WSAEHOSTUNREACH;<br> {$EXTERNALSYM EHOSTUNREACH}<br> ENOTEMPTY = WSAENOTEMPTY;<br> {$EXTERNALSYM ENOTEMPTY}<br> EPROCLIM = WSAEPROCLIM;<br> {$EXTERNALSYM EPROCLIM}<br> EUSERS = WSAEUSERS;<br> {$EXTERNALSYM EUSERS}<br> EDQUOT = WSAEDQUOT;<br> {$EXTERNALSYM EDQUOT}<br> ESTALE = WSAESTALE;<br> {$EXTERNALSYM ESTALE}<br> EREMOTE = WSAEREMOTE;<br> {$EXTERNALSYM EREMOTE}<br><br>{$ENDIF FALSE}<br><br>//<br>// WinSock 2 extension -- new error codes and type definition<br>//<br><br>type<br> WSAEVENT = HANDLE;<br> {$EXTERNALSYM WSAEVENT}<br> LPWSAEVENT = LPHANDLE;<br> {$EXTERNALSYM LPWSAEVENT}<br> WSAOVERLAPPED = OVERLAPPED;<br> {$EXTERNALSYM WSAOVERLAPPED}<br> LPWSAOVERLAPPED = ^OVERLAPPED;<br> {$EXTERNALSYM LPWSAOVERLAPPED}<br> TWsaEvent = WSAEVENT;<br> PWsaEvent = LPWSAEVENT;<br> TWsaOverlapped = WSAOVERLAPPED;<br> PWsaOverlapped = LPWSAOVERLAPPED;<br><br>const<br> WSA_IO_PENDING = ERROR_IO_PENDING;<br> {$EXTERNALSYM WSA_IO_PENDING}<br> WSA_IO_INCOMPLETE = ERROR_IO_INCOMPLETE;<br> {$EXTERNALSYM WSA_IO_INCOMPLETE}<br> WSA_INVALID_HANDLE = ERROR_INVALID_HANDLE;<br> {$EXTERNALSYM WSA_INVALID_HANDLE}<br> WSA_INVALID_PARAMETER = ERROR_INVALID_PARAMETER;<br> {$EXTERNALSYM WSA_INVALID_PARAMETER}<br> WSA_NOT_ENOUGH_MEMORY = ERROR_NOT_ENOUGH_MEMORY;<br> {$EXTERNALSYM WSA_NOT_ENOUGH_MEMORY}<br> WSA_OPERATION_ABORTED = ERROR_OPERATION_ABORTED;<br> {$EXTERNALSYM WSA_OPERATION_ABORTED}<br><br> WSA_INVALID_EVENT = WSAEVENT(nil);<br> {$EXTERNALSYM WSA_INVALID_EVENT}<br> WSA_MAXIMUM_WAIT_EVENTS = MAXIMUM_WAIT_OBJECTS;<br> {$EXTERNALSYM WSA_MAXIMUM_WAIT_EVENTS}<br> WSA_WAIT_FAILED = WAIT_FAILED;<br> {$EXTERNALSYM WSA_WAIT_FAILED}<br> WSA_WAIT_EVENT_0 = WAIT_OBJECT_0;<br> {$EXTERNALSYM WSA_WAIT_EVENT_0}<br> WSA_WAIT_IO_COMPLETION = WAIT_IO_COMPLETION;<br> {$EXTERNALSYM WSA_WAIT_IO_COMPLETION}<br> WSA_WAIT_TIMEOUT = WAIT_TIMEOUT;<br> {$EXTERNALSYM WSA_WAIT_TIMEOUT}<br> WSA_INFINITE = INFINITE;<br> {$EXTERNALSYM WSA_INFINITE}<br><br>//<br>// WinSock 2 extension -- WSABUF and QOS struct, include qos.h<br>// to pull in FLOWSPEC and related definitions<br>//<br><br>type<br> _WSABUF = record<br> len: u_long; // the length of the buffer<br> buf: PChar; // the pointer to the buffer<br> end;<br> {$EXTERNALSYM _WSABUF}<br> WSABUF = _WSABUF;<br> {$EXTERNALSYM WSABUF}<br> LPWSABUF = ^_WSABUF;<br> {$EXTERNALSYM LPWSABUF}<br> TWsaBuf = WSABUF;<br> PWsaBuf = LPWSABUF;<br><br> _QualityOfService = record<br> SendingFlowspec: FLOWSPEC; // the flow spec for data sending<br> ReceivingFlowspec: FLOWSPEC; // the flow spec for data receiving<br> ProviderSpecific: WSABUF; // additional provider specific stuff<br> end;<br> {$EXTERNALSYM _QualityOfService}<br> QOS = _QualityOfService;<br> {$EXTERNALSYM QOS}<br> LPQOS = ^_QualityOfService;<br> {$EXTERNALSYM LPQOS}<br> TQOS = QOS;<br> PQOS = LPQOS;<br><br>//<br>// WinSock 2 extension -- manifest constants for return values of the condition function<br>//<br><br>const<br> CF_ACCEPT = $0000;<br> {$EXTERNALSYM CF_ACCEPT}<br> CF_REJECT = $0001;<br> {$EXTERNALSYM CF_REJECT}<br> CF_DEFER = $0002;<br> {$EXTERNALSYM CF_DEFER}<br><br>//<br>// WinSock 2 extension -- manifest constants for shutdown()<br>//<br><br> SD_RECEIVE = $00;<br> {$EXTERNALSYM SD_RECEIVE}<br> SD_SEND = $01;<br> {$EXTERNALSYM SD_SEND}<br> SD_BOTH = $02;<br> {$EXTERNALSYM SD_BOTH}<br><br>//<br>// WinSock 2 extension -- data type and manifest constants for socket groups<br>//<br><br>type<br> GROUP = Cardinal;<br> {$EXTERNALSYM GROUP}<br> TGroup = GROUP;<br> PGroup = ^GROUP;<br><br>const<br> SG_UNCONSTRAINED_GROUP = $01;<br> {$EXTERNALSYM SG_UNCONSTRAINED_GROUP}<br> SG_CONSTRAINED_GROUP = $02;<br> {$EXTERNALSYM SG_CONSTRAINED_GROUP}<br><br>//<br>// WinSock 2 extension -- data type for WSAEnumNetworkEvents()<br>//<br><br>type<br> _WSANETWORKEVENTS = record<br> lNetworkEvents: Longint;<br> iErrorCode: array [0..FD_MAX_EVENTS - 1] of Integer;<br> end;<br> {$EXTERNALSYM _WSANETWORKEVENTS}<br> WSANETWORKEVENTS = _WSANETWORKEVENTS;<br> {$EXTERNALSYM WSANETWORKEVENTS}<br> LPWSANETWORKEVENTS = ^WSANETWORKEVENTS;<br> {$EXTERNALSYM LPWSANETWORKEVENTS}<br> TWsaNetworkEvents = WSANETWORKEVENTS;<br> PWsaNetworkEvents = LPWSANETWORKEVENTS;<br><br>//<br>// WinSock 2 extension -- WSAPROTOCOL_INFO structure and associated<br>// manifest constants<br>//<br><br>const<br> MAX_PROTOCOL_CHAIN = 7;<br> {$EXTERNALSYM MAX_PROTOCOL_CHAIN}<br><br> BASE_PROTOCOL = 1;<br> {$EXTERNALSYM BASE_PROTOCOL}<br> LAYERED_PROTOCOL = 0;<br> {$EXTERNALSYM LAYERED_PROTOCOL}<br><br>type<br> _WSAPROTOCOLCHAIN = record<br> ChainLen: Integer; // the length of the chain,<br> // length = 0 means layered protocol,<br> // length = 1 means base protocol,<br> // length > 1 means protocol chain<br> ChainEntries: array [0..MAX_PROTOCOL_CHAIN - 1] of DWORD; // a list of dwCatalogEntryIds<br> end;<br> {$EXTERNALSYM _WSAPROTOCOLCHAIN}<br> WSAPROTOCOLCHAIN = _WSAPROTOCOLCHAIN;<br> {$EXTERNALSYM WSAPROTOCOLCHAIN}<br> LPWSAPROTOCOLCHAIN = ^WSAPROTOCOLCHAIN;<br> {$EXTERNALSYM LPWSAPROTOCOLCHAIN}<br> TWsaProtocolChain = WSAPROTOCOLCHAIN;<br> PWsaProtocolChain = LPWSAPROTOCOLCHAIN;<br><br>const<br> WSAPROTOCOL_LEN = 255;<br> {$EXTERNALSYM WSAPROTOCOL_LEN}<br><br>type<br> _WSAPROTOCOL_INFOA = record<br> dwServiceFlags1: DWORD;<br> dwServiceFlags2: DWORD;<br> dwServiceFlags3: DWORD;<br> dwServiceFlags4: DWORD;<br> dwProviderFlags: DWORD;<br> ProviderId: TGUID;<br> dwCatalogEntryId: DWORD;<br> ProtocolChain: WSAPROTOCOLCHAIN;<br> iVersion: Integer;<br> iAddressFamily: Integer;<br> iMaxSockAddr: Integer;<br> iMinSockAddr: Integer;<br> iSocketType: Integer;<br> iProtocol: Integer;<br> iProtocolMaxOffset: Integer;<br> iNetworkByteOrder: Integer;<br> iSecurityScheme: Integer;<br> dwMessageSize: DWORD;<br> dwProviderReserved: DWORD;<br> szProtocol: array [0..WSAPROTOCOL_LEN] of Char;<br> end;<br> {$EXTERNALSYM _WSAPROTOCOL_INFOA}<br> WSAPROTOCOL_INFOA = _WSAPROTOCOL_INFOA;<br> {$EXTERNALSYM WSAPROTOCOL_INFOA}<br> LPWSAPROTOCOL_INFOA = ^WSAPROTOCOL_INFOA;<br> {$EXTERNALSYM LPWSAPROTOCOL_INFOA}<br> TWsaProtocolInfoA = WSAPROTOCOL_INFOA;<br> PWsaProtocolInfoA = LPWSAPROTOCOL_INFOA;<br><br> _WSAPROTOCOL_INFOW = record<br> dwServiceFlags1: DWORD;<br> dwServiceFlags2: DWORD;<br> dwServiceFlags3: DWORD;<br> dwServiceFlags4: DWORD;<br> dwProviderFlags: DWORD;<br> ProviderId: TGUID;<br> dwCatalogEntryId: DWORD;<br> ProtocolChain: WSAPROTOCOLCHAIN;<br> iVersion: Integer;<br> iAddressFamily: Integer;<br> iMaxSockAddr: Integer;<br> iMinSockAddr: Integer;<br> iSocketType: Integer;<br> iProtocol: Integer;<br> iProtocolMaxOffset: Integer;<br> iNetworkByteOrder: Integer;<br> iSecurityScheme: Integer;<br> dwMessageSize: DWORD;<br> dwProviderReserved: DWORD;<br> szProtocol: array [0..WSAPROTOCOL_LEN] of WideChar;<br> end;<br> {$EXTERNALSYM _WSAPROTOCOL_INFOW}<br> WSAPROTOCOL_INFOW = _WSAPROTOCOL_INFOW;<br> {$EXTERNALSYM WSAPROTOCOL_INFOW}<br> LPWSAPROTOCOL_INFOW = ^WSAPROTOCOL_INFOW;<br> {$EXTERNALSYM LPWSAPROTOCOL_INFOW}<br> TWsaProtocolInfoW = WSAPROTOCOL_INFOW;<br> PWsaProtocolInfoW = LPWSAPROTOCOL_INFOW;<br><br> {$IFDEF UNICODE}<br> WSAPROTOCOL_INFO = WSAPROTOCOL_INFOW;<br> {$EXTERNALSYM WSAPROTOCOL_INFO}<br> LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOW;<br> {$EXTERNALSYM LPWSAPROTOCOL_INFO}<br> TWsaProtocolInfo = TWsaProtocolInfoW;<br> PWsaProtocolInfo = PWsaProtocolInfoW;<br> {$ELSE}<br> WSAPROTOCOL_INFO = WSAPROTOCOL_INFOA;<br> {$EXTERNALSYM WSAPROTOCOL_INFO}<br> LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOA;<br> {$EXTERNALSYM LPWSAPROTOCOL_INFO}<br> TWsaProtocolInfo = TWsaProtocolInfoA;<br> PWsaProtocolInfo = PWsaProtocolInfoA;<br> {$ENDIF UNICODE}<br><br>// Flag bit definitions for dwProviderFlags<br><br>const<br> PFL_MULTIPLE_PROTO_ENTRIES = $00000001;<br> {$EXTERNALSYM PFL_MULTIPLE_PROTO_ENTRIES}<br> PFL_RECOMMENDED_PROTO_ENTRY = $00000002;<br> {$EXTERNALSYM PFL_RECOMMENDED_PROTO_ENTRY}<br> PFL_HIDDEN = $00000004;<br> {$EXTERNALSYM PFL_HIDDEN}<br> PFL_MATCHES_PROTOCOL_ZERO = $00000008;<br> {$EXTERNALSYM PFL_MATCHES_PROTOCOL_ZERO}<br><br>// Flag bit definitions for dwServiceFlags1<br><br> XP1_CONNECTIONLESS = $00000001;<br> {$EXTERNALSYM XP1_CONNECTIONLESS}<br> XP1_GUARANTEED_DELIVERY = $00000002;<br> {$EXTERNALSYM XP1_GUARANTEED_DELIVERY}<br> XP1_GUARANTEED_ORDER = $00000004;<br> {$EXTERNALSYM XP1_GUARANTEED_ORDER}<br> XP1_MESSAGE_ORIENTED = $00000008;<br> {$EXTERNALSYM XP1_MESSAGE_ORIENTED}<br> XP1_PSEUDO_STREAM = $00000010;<br> {$EXTERNALSYM XP1_PSEUDO_STREAM}<br> XP1_GRACEFUL_CLOSE = $00000020;<br> {$EXTERNALSYM XP1_GRACEFUL_CLOSE}<br> XP1_EXPEDITED_DATA = $00000040;<br> {$EXTERNALSYM XP1_EXPEDITED_DATA}<br> XP1_CONNECT_DATA = $00000080;<br> {$EXTERNALSYM XP1_CONNECT_DATA}<br> XP1_DISCONNECT_DATA = $00000100;<br> {$EXTERNALSYM XP1_DISCONNECT_DATA}<br> XP1_SUPPORT_BROADCAST = $00000200;<br> {$EXTERNALSYM XP1_SUPPORT_BROADCAST}<br> XP1_SUPPORT_MULTIPOINT = $00000400;<br> {$EXTERNALSYM XP1_SUPPORT_MULTIPOINT}<br> XP1_MULTIPOINT_CONTROL_PLANE = $00000800;<br> {$EXTERNALSYM XP1_MULTIPOINT_CONTROL_PLANE}<br> XP1_MULTIPOINT_DATA_PLANE = $00001000;<br> {$EXTERNALSYM XP1_MULTIPOINT_DATA_PLANE}<br> XP1_QOS_SUPPORTED = $00002000;<br> {$EXTERNALSYM XP1_QOS_SUPPORTED}<br> XP1_INTERRUPT = $00004000;<br> {$EXTERNALSYM XP1_INTERRUPT}<br> XP1_UNI_SEND = $00008000;<br> {$EXTERNALSYM XP1_UNI_SEND}<br> XP1_UNI_RECV = $00010000;<br> {$EXTERNALSYM XP1_UNI_RECV}<br> XP1_IFS_HANDLES = $00020000;<br> {$EXTERNALSYM XP1_IFS_HANDLES}<br> XP1_PARTIAL_MESSAGE = $00040000;<br> {$EXTERNALSYM XP1_PARTIAL_MESSAGE}<br><br> BIGENDIAN = $0000;<br> {$EXTERNALSYM BIGENDIAN}<br> LITTLEENDIAN = $0001;<br> {$EXTERNALSYM LITTLEENDIAN}<br><br> SECURITY_PROTOCOL_NONE = $0000;<br> {$EXTERNALSYM SECURITY_PROTOCOL_NONE}<br><br>//<br>// WinSock 2 extension -- manifest constants for WSAJoinLeaf()<br>//<br><br> JL_SENDER_ONLY = $01;<br> {$EXTERNALSYM JL_SENDER_ONLY}<br> JL_RECEIVER_ONLY = $02;<br> {$EXTERNALSYM JL_RECEIVER_ONLY}<br> JL_BOTH = $04;<br> {$EXTERNALSYM JL_BOTH}<br><br>//<br>// WinSock 2 extension -- manifest constants for WSASocket()<br>//<br><br> WSA_FLAG_OVERLAPPED = $01;<br> {$EXTERNALSYM WSA_FLAG_OVERLAPPED}<br> WSA_FLAG_MULTIPOINT_C_ROOT = $02;<br> {$EXTERNALSYM WSA_FLAG_MULTIPOINT_C_ROOT}<br> WSA_FLAG_MULTIPOINT_C_LEAF = $04;<br> {$EXTERNALSYM WSA_FLAG_MULTIPOINT_C_LEAF}<br> WSA_FLAG_MULTIPOINT_D_ROOT = $08;<br> {$EXTERNALSYM WSA_FLAG_MULTIPOINT_D_ROOT}<br> WSA_FLAG_MULTIPOINT_D_LEAF = $10;<br> {$EXTERNALSYM WSA_FLAG_MULTIPOINT_D_LEAF}<br><br>//<br>// WinSock 2 extension -- manifest constants for WSAIoctl()<br>//<br><br> IOC_UNIX = $00000000;<br> {$EXTERNALSYM IOC_UNIX}<br> IOC_WS2 = $08000000;<br> {$EXTERNALSYM IOC_WS2}<br> IOC_PROTOCOL = $10000000;<br> {$EXTERNALSYM IOC_PROTOCOL}<br> IOC_VENDOR = $18000000;<br> {$EXTERNALSYM IOC_VENDOR}<br><br>function _WSAIO(x, y: DWORD): DWORD;<br>{$EXTERNALSYM _WSAIO}<br><br>function _WSAIOR(x, y: DWORD): DWORD;<br>{$EXTERNALSYM _WSAIOR}<br><br>function _WSAIOW(x, y: DWORD): DWORD;<br>{$EXTERNALSYM _WSAIOW}<br><br>function _WSAIORW(x, y: DWORD): DWORD;<br>{$EXTERNALSYM _WSAIORW}<br><br>const<br> SIO_ASSOCIATE_HANDLE = IOC_INOUT or IOC_WS2 or 1;<br> {$EXTERNALSYM SIO_ASSOCIATE_HANDLE}<br> SIO_ENABLE_CIRCULAR_QUEUEING = IOC_VOID or IOC_WS2 or 2;<br> {$EXTERNALSYM SIO_ENABLE_CIRCULAR_QUEUEING}<br> SIO_FIND_ROUTE = IOC_OUT or IOC_WS2 or 3;<br> {$EXTERNALSYM SIO_FIND_ROUTE}<br> SIO_FLUSH = IOC_VOID or IOC_WS2 or 4;<br> {$EXTERNALSYM SIO_FLUSH}<br> SIO_GET_BROADCAST_ADDRESS = IOC_OUT or IOC_WS2 or 5;<br> {$EXTERNALSYM SIO_GET_BROADCAST_ADDRESS}<br> SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT or IOC_WS2 or 6;<br> {$EXTERNALSYM SIO_GET_EXTENSION_FUNCTION_POINTER}<br> SIO_GET_QOS = IOC_INOUT or IOC_WS2 or 7;<br> {$EXTERNALSYM SIO_GET_QOS}<br> SIO_GET_GROUP_QOS = IOC_INOUT or IOC_WS2 or 8;<br> {$EXTERNALSYM SIO_GET_GROUP_QOS}<br> SIO_MULTIPOINT_LOOPBACK = IOC_INOUT or IOC_WS2 or 9;<br> {$EXTERNALSYM SIO_MULTIPOINT_LOOPBACK}<br> SIO_MULTICAST_SCOPE = IOC_INOUT or IOC_WS2 or 10;<br> {$EXTERNALSYM SIO_MULTICAST_SCOPE}<br> SIO_SET_QOS = IOC_INOUT or IOC_WS2 or 11;<br> {$EXTERNALSYM SIO_SET_QOS}<br> SIO_SET_GROUP_QOS = IOC_INOUT or IOC_WS2 or 12;<br> {$EXTERNALSYM SIO_SET_GROUP_QOS}<br> SIO_TRANSLATE_HANDLE = IOC_INOUT or IOC_WS2 or 13;<br> {$EXTERNALSYM SIO_TRANSLATE_HANDLE}<br> SIO_ROUTING_INTERFACE_QUERY = IOC_INOUT or IOC_WS2 or 20;<br> {$EXTERNALSYM SIO_ROUTING_INTERFACE_QUERY}<br> SIO_ROUTING_INTERFACE_CHANGE = IOC_INOUT or IOC_WS2 or 21;<br> {$EXTERNALSYM SIO_ROUTING_INTERFACE_CHANGE}<br> SIO_ADDRESS_LIST_QUERY = IOC_OUT or IOC_WS2 or 22;<br> {$EXTERNALSYM SIO_ADDRESS_LIST_QUERY}<br> SIO_ADDRESS_LIST_CHANGE = IOC_VOID or IOC_WS2 or 23;<br> {$EXTERNALSYM SIO_ADDRESS_LIST_CHANGE}<br> SIO_QUERY_TARGET_PNP_HANDLE = IOC_OUT or IOC_WS2 or 24;<br> {$EXTERNALSYM SIO_QUERY_TARGET_PNP_HANDLE}<br><br> SIO_ADDRESS_LIST_SORT = IOC_INOUT or IOC_WS2 or 25;<br> {$EXTERNALSYM SIO_ADDRESS_LIST_SORT}<br><br>//<br>// WinSock 2 extensions -- data types for the condition function in<br>// WSAAccept() and overlapped I/O completion routine.<br>//<br><br>type<br> LPCONDITIONPROC = function(lpCallerId, lpCallerData: LPWSABUF; lpSQOS, lpGQOS: LPQOS; lpCalleeId, lpCalleeData: LPWSABUF;<br> g: PGROUP; dwCallbackData: DWORD_PTR): Integer; stdcall;<br> {$EXTERNALSYM LPCONDITIONPROC}<br><br> LPWSAOVERLAPPED_COMPLETION_ROUTINE = procedure(dwError, cbTransferred: DWORD; lpOverlapped: LPWSAOVERLAPPED; dwFlags: DWORD); stdcall;<br> {$EXTERNALSYM LPWSAOVERLAPPED_COMPLETION_ROUTINE}<br><br>//<br>// WinSock 2 extension -- manifest constants and associated structures<br>// for WSANSPIoctl()<br>//<br><br>const<br> SIO_NSP_NOTIFY_CHANGE = IOC_IN or IOC_WS2 or 25;<br> {$EXTERNALSYM SIO_NSP_NOTIFY_CHANGE}<br><br>type<br> _WSACOMPLETIONTYPE = (<br> NSP_NOTIFY_IMMEDIATELY,<br> NSP_NOTIFY_HWND,<br> NSP_NOTIFY_EVENT,<br> NSP_NOTIFY_PORT,<br> NSP_NOTIFY_APC);<br> {$EXTERNALSYM _WSACOMPLETIONTYPE}<br> WSACOMPLETIONTYPE = _WSACOMPLETIONTYPE;<br> {$EXTERNALSYM WSACOMPLETIONTYPE}<br> PWSACOMPLETIONTYPE = ^WSACOMPLETIONTYPE;<br> {$EXTERNALSYM PWSACOMPLETIONTYPE}<br> LPWSACOMPLETIONTYPE = ^WSACOMPLETIONTYPE;<br> {$EXTERNALSYM LPWSACOMPLETIONTYPE}<br> TWsaCompletionType = WSACOMPLETIONTYPE;<br><br> _WSACOMPLETION = record<br> Type_: WSACOMPLETIONTYPE;<br> case Integer of // Parameters<br> 0: ( // WindowMessage<br> hWnd: HWND;<br> uMsg: UINT;<br> context: WPARAM);<br> (* TODO<br> 1: ( // Event<br> lpOverlapped: LPWSAOVERLAPPED);<br> 2: ( // Apc<br> lpOverlapped: LPWSAOVERLAPPED;<br> lpfnCompletionProc: LPWSAOVERLAPPED_COMPLETION_ROUTINE);<br> *)<br> 3: ( // Port<br> lpOverlapped: LPWSAOVERLAPPED;<br> hPort: HANDLE;<br> Key: ULONG_PTR);<br> end;<br> {$EXTERNALSYM _WSACOMPLETION}<br> WSACOMPLETION = _WSACOMPLETION;<br> {$EXTERNALSYM WSACOMPLETION}<br> PWSACOMPLETION = ^WSACOMPLETION;<br> {$EXTERNALSYM PWSACOMPLETION}<br> LPWSACOMPLETION = ^WSACOMPLETION;<br> {$EXTERNALSYM LPWSACOMPLETION}<br> TWsaCompletion = WSACOMPLETION;<br><br>//<br>// WinSock 2 extension -- manifest constants for SIO_TRANSLATE_HANDLE ioctl<br>//<br><br>const<br> TH_NETDEV = $00000001;<br> {$EXTERNALSYM TH_NETDEV}<br> TH_TAPI = $00000002;<br> {$EXTERNALSYM TH_TAPI}<br><br>//<br>// Microsoft Windows Extended data types required for the functions to<br>// convert back and forth between binary and string forms of<br>// addresses.<br>//<br><br>type<br> LPSOCKADDR = ^sockaddr;<br> {$EXTERNALSYM LPSOCKADDR}<br><br> PSOCKADDR_STORAGE = ^sockaddr_storage;<br> {$EXTERNALSYM PSOCKADDR_STORAGE}<br> LPSOCKADDR_STORAGE = ^sockaddr_storage;<br> {$EXTERNALSYM LPSOCKADDR_STORAGE}<br><br>//<br>// Manifest constants and type definitions related to name resolution and<br>// registration (RNR) API<br>//<br><br> _BLOB = record<br> cbSize: ULONG;<br> pBlobData: LPBYTE;<br> end;<br> {$EXTERNALSYM _BLOB}<br> BLOB = _BLOB;<br> {$EXTERNALSYM BLOB}<br> LPBLOB = ^BLOB;<br> {$EXTERNALSYM LPBLOB}<br> TBlob = BLOB;<br> PBlob = LPBLOB;<br><br>//<br>// Service Install Flags<br>//<br><br>const<br> SERVICE_MULTIPLE = $00000001;<br> {$EXTERNALSYM SERVICE_MULTIPLE}<br><br>//<br>//& Name Spaces<br>//<br><br> NS_ALL = 0;<br> {$EXTERNALSYM NS_ALL}<br><br> NS_SAP = 1;<br> {$EXTERNALSYM NS_SAP}<br> NS_NDS = 2;<br> {$EXTERNALSYM NS_NDS}<br> NS_PEER_BROWSE = 3;<br> {$EXTERNALSYM NS_PEER_BROWSE}<br> NS_SLP = 5;<br> {$EXTERNALSYM NS_SLP}<br> NS_DHCP = 6;<br> {$EXTERNALSYM NS_DHCP}<br><br> NS_TCPIP_LOCAL = 10;<br> {$EXTERNALSYM NS_TCPIP_LOCAL}<br> NS_TCPIP_HOSTS = 11;<br> {$EXTERNALSYM NS_TCPIP_HOSTS}<br> NS_DNS = 12;<br> {$EXTERNALSYM NS_DNS}<br> NS_NETBT = 13;<br> {$EXTERNALSYM NS_NETBT}<br> NS_WINS = 14;<br> {$EXTERNALSYM NS_WINS}<br> NS_NLA = 15; // Network Location Awareness<br> {$EXTERNALSYM NS_NLA}<br><br> NS_NBP = 20;<br> {$EXTERNALSYM NS_NBP}<br><br> NS_MS = 30;<br> {$EXTERNALSYM NS_MS}<br> NS_STDA = 31;<br> {$EXTERNALSYM NS_STDA}<br> NS_NTDS = 32;<br> {$EXTERNALSYM NS_NTDS}<br><br> NS_X500 = 40;<br> {$EXTERNALSYM NS_X500}<br> NS_NIS = 41;<br> {$EXTERNALSYM NS_NIS}<br> NS_NISPLUS = 42;<br> {$EXTERNALSYM NS_NISPLUS}<br><br> NS_WRQ = 50;<br> {$EXTERNALSYM NS_WRQ}<br><br> NS_NETDES = 60; // Network Designers Limited<br> {$EXTERNALSYM NS_NETDES}<br><br>//<br>// Resolution flags for WSAGetAddressByName().<br>// Note these are also used by the 1.1 API GetAddressByName, so<br>// leave them around.<br>//<br><br> RES_UNUSED_1 = $00000001;<br> {$EXTERNALSYM RES_UNUSED_1}<br> RES_FLUSH_CACHE = $00000002;<br> {$EXTERNALSYM RES_FLUSH_CACHE}<br> RES_SERVICE = $00000004;<br> {$EXTERNALSYM RES_SERVICE}<br><br>//<br>// Well known value names for Service Types<br>//<br><br> SERVICE_TYPE_VALUE_IPXPORTA = 'IpxSocket';<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_IPXPORTA}<br> SERVICE_TYPE_VALUE_IPXPORTW = WideString('IpxSocket');<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_IPXPORTW}<br> SERVICE_TYPE_VALUE_SAPIDA = 'SapId';<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_SAPIDA}<br> SERVICE_TYPE_VALUE_SAPIDW = WideString('SapId');<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_SAPIDW}<br> SERVICE_TYPE_VALUE_TCPPORTA = 'TcpPort';<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_TCPPORTA}<br> SERVICE_TYPE_VALUE_TCPPORTW = WideString('TcpPort');<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_TCPPORTW}<br> SERVICE_TYPE_VALUE_UDPPORTA = 'UdpPort';<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_UDPPORTA}<br> SERVICE_TYPE_VALUE_UDPPORTW = WideString('UdpPort');<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_UDPPORTW}<br> SERVICE_TYPE_VALUE_OBJECTIDA = 'ObjectId';<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_OBJECTIDA}<br> SERVICE_TYPE_VALUE_OBJECTIDW = WideString('ObjectId');<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_OBJECTIDW}<br><br> {$IFDEF UNICODE}<br> SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDW;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_SAPID}<br> SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTW;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_TCPPORT}<br> SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTW;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_UDPPORT}<br> SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDW;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_OBJECTID}<br> {$ELSE}<br> SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDA;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_SAPID}<br> SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTA;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_TCPPORT}<br> SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTA;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_UDPPORT}<br> SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDA;<br> {$EXTERNALSYM SERVICE_TYPE_VALUE_OBJECTID}<br> {$ENDIF UNICODE}<br><br>//<br>// SockAddr Information<br>//<br><br>type<br> LPSOCKET_ADDRESS = ^SOCKET_ADDRESS;<br> {$EXTERNALSYM LPSOCKET_ADDRESS}<br> PSOCKET_ADDRESS = ^SOCKET_ADDRESS;<br> {$EXTERNALSYM PSOCKET_ADDRESS}<br> _SOCKET_ADDRESS = record<br> lpSockaddr: LPSOCKADDR;<br> iSockaddrLength: Integer;<br> end;<br> {$EXTERNALSYM _SOCKET_ADDRESS}<br> SOCKET_ADDRESS = _SOCKET_ADDRESS;<br> {$EXTERNALSYM SOCKET_ADDRESS}<br> TSocketAddress = SOCKET_ADDRESS;<br> PSocketAddress = PSOCKET_ADDRESS;<br><br>//<br>// CSAddr Information<br>//<br><br> LPCSADDR_INFO = ^CSADDR_INFO;<br> {$EXTERNALSYM LPCSADDR_INFO}<br> PCSADDR_INFO = ^CSADDR_INFO;<br> {$EXTERNALSYM PCSADDR_INFO}<br> _CSADDR_INFO = record<br> LocalAddr: SOCKET_ADDRESS;<br> RemoteAddr: SOCKET_ADDRESS;<br> iSocketType: Integer;<br> iProtocol: Integer;<br> end;<br> {$EXTERNALSYM _CSADDR_INFO}<br> CSADDR_INFO = _CSADDR_INFO;<br> {$EXTERNALSYM CSADDR_INFO}<br> TCsAddrInfo = CSADDR_INFO;<br> PCsAddrInfo = PCSADDR_INFO;<br><br>//<br>// Address list returned via SIO_ADDRESS_LIST_QUERY<br>//<br><br> LPSOCKET_ADDRESS_LIST = ^SOCKET_ADDRESS_LIST;<br> {$EXTERNALSYM LPSOCKET_ADDRESS_LIST}<br> _SOCKET_ADDRESS_LIST = record<br> iAddressCount: Integer;<br> Address: array [0..0] of SOCKET_ADDRESS;<br> end;<br> {$EXTERNALSYM _SOCKET_ADDRESS_LIST}<br> SOCKET_ADDRESS_LIST = _SOCKET_ADDRESS_LIST;<br> {$EXTERNALSYM SOCKET_ADDRESS_LIST}<br> TSocketAddressList = SOCKET_ADDRESS_LIST;<br> PSocketAddressList = LPSOCKET_ADDRESS_LIST;<br><br>//<br>// Address Family/Protocol Tuples<br>//<br><br> LPAFPROTOCOLS = ^AFPROTOCOLS;<br> {$EXTERNALSYM LPAFPROTOCOLS}<br> PAFPROTOCOLS = ^AFPROTOCOLS;<br> {$EXTERNALSYM PAFPROTOCOLS}<br> _AFPROTOCOLS = record<br> iAddressFamily: Integer;<br> iProtocol: Integer;<br> end;<br> {$EXTERNALSYM _AFPROTOCOLS}<br> AFPROTOCOLS = _AFPROTOCOLS;<br> {$EXTERNALSYM AFPROTOCOLS}<br> TAfProtocols = AFPROTOCOLS;<br><br>//<br>// Client Query API Typedefs<br>//<br><br>//<br>// The comparators<br>//<br><br> _WSAEcomparator = (COMP_EQUAL, COMP_NOTLESS);<br> {$EXTERNALSYM _WSAEcomparator}<br> WSAECOMPARATOR = _WSAEcomparator;<br> {$EXTERNALSYM WSAECOMPARATOR}<br> PWSAECOMPARATOR = ^WSAECOMPARATOR;<br> {$EXTERNALSYM PWSAECOMPARATOR}<br> LPWSAECOMPARATOR = ^WSAECOMPARATOR;<br> {$EXTERNALSYM LPWSAECOMPARATOR}<br><br> LPWSAVERSION = ^WSAVERSION;<br> {$EXTERNALSYM LPWSAVersion}<br> PWSAVERSION = ^WSAVERSION;<br> {$EXTERNALSYM PWSAVersion}<br> _WSAVersion = record<br> dwVersion: DWORD;<br> ecHow: WSAECOMPARATOR;<br> end;<br> {$EXTERNALSYM _WSAVersion}<br> WSAVERSION = _WSAVersion;<br> {$EXTERNALSYM WSAVERSION}<br> TWsaVersion = WSAVERSION;<br><br> _WSAQuerySetA = record<br> dwSize: DWORD;<br> lpszServiceInstanceName: LPSTR;<br> lpServiceClassId: PGUID;<br> lpVersion: LPWSAVERSION;<br> lpszComment: LPSTR;<br> dwNameSpace: DWORD;<br> lpNSProviderId: PGUID;<br> lpszContext: LPSTR;<br> dwNumberOfProtocols: DWORD;<br> lpafpProtocols: LPAFPROTOCOLS;<br> lpszQueryString: LPSTR;<br> dwNumberOfCsAddrs: DWORD;<br> lpcsaBuffer: LPCSADDR_INFO;<br> dwOutputFlags: DWORD;<br> lpBlob: LPBLOB;<br> end;<br> {$EXTERNALSYM _WSAQuerySetA}<br> WSAQUERYSETA = _WSAQuerySetA;<br> {$EXTERNALSYM WSAQUERYSETA}<br> PWSAQUERYSETA = ^WSAQUERYSETA;<br> {$EXTERNALSYM PWSAQUERYSETA}<br> LPWSAQUERYSETA = ^WSAQUERYSETA;<br> {$EXTERNALSYM LPWSAQUERYSETA}<br> TWsaQuerySetA = WSAQUERYSETA;<br><br> _WSAQuerySetW = record<br> dwSize: DWORD;<br> lpszServiceInstanceName: LPWSTR;<br> lpServiceClassId: PGUID;<br> lpVersion: LPWSAVERSION;<br> lpszComment: LPWSTR;<br> dwNameSpace: DWORD;<br> lpNSProviderId: PGUID;<br> lpszContext: LPWSTR;<br> dwNumberOfProtocols: DWORD;<br> lpafpProtocols: LPAFPROTOCOLS;<br> lpszQueryString: LPWSTR;<br> dwNumberOfCsAddrs: DWORD;<br> lpcsaBuffer: LPCSADDR_INFO;<br> dwOutputFlags: DWORD;<br> lpBlob: LPBLOB;<br> end;<br> {$EXTERNALSYM _WSAQuerySetW}<br> WSAQUERYSETW = _WSAQuerySetW;<br> {$EXTERNALSYM WSAQUERYSETW}<br> PWSAQUERYSETW = ^WSAQUERYSETW;<br> {$EXTERNALSYM PWSAQUERYSETW}<br> LPWSAQUERYSETW = ^WSAQUERYSETW;<br> {$EXTERNALSYM LPWSAQUERYSETW}<br> TWsaQuerySetW = WSAQUERYSETW;<br><br> {$IFDEF UNICODE}<br> WSAQUERYSET = WSAQUERYSETW;<br> {$EXTERNALSYM WSAQUERYSET}<br> PWSAQUERYSET = PWSAQUERYSETW;<br> {$EXTERNALSYM PWSAQUERYSET}<br> LPWSAQUERYSET = LPWSAQUERYSETW;<br> {$EXTERNALSYM LPWSAQUERYSET}<br> TWsaQuerySet = TWsaQuerySetW;<br> {$ELSE}<br> WSAQUERYSET = WSAQUERYSETA;<br> {$EXTERNALSYM WSAQUERYSET}<br> PWSAQUERYSET = PWSAQUERYSETA;<br> {$EXTERNALSYM PWSAQUERYSET}<br> LPWSAQUERYSET = LPWSAQUERYSETA;<br> {$EXTERNALSYM LPWSAQUERYSET}<br> TWsaQuerySet = TWsaQuerySetA;<br> {$ENDIF UNICODE}<br><br>const<br> LUP_DEEP = $0001;<br> {$EXTERNALSYM LUP_DEEP}<br> LUP_CONTAINERS = $0002;<br> {$EXTERNALSYM LUP_CONTAINERS}<br> LUP_NOCONTAINERS = $0004;<br> {$EXTERNALSYM LUP_NOCONTAINERS}<br> LUP_NEAREST = $0008;<br> {$EXTERNALSYM LUP_NEAREST}<br> LUP_RETURN_NAME = $0010;<br> {$EXTERNALSYM LUP_RETURN_NAME}<br> LUP_RETURN_TYPE = $0020;<br> {$EXTERNALSYM LUP_RETURN_TYPE}<br> LUP_RETURN_VERSION = $0040;<br> {$EXTERNALSYM LUP_RETURN_VERSION}<br> LUP_RETURN_COMMENT = $0080;<br> {$EXTERNALSYM LUP_RETURN_COMMENT}<br> LUP_RETURN_ADDR = $0100;<br> {$EXTERNALSYM LUP_RETURN_ADDR}<br> LUP_RETURN_BLOB = $0200;<br> {$EXTERNALSYM LUP_RETURN_BLOB}<br> LUP_RETURN_ALIASES = $0400;<br> {$EXTERNALSYM LUP_RETURN_ALIASES}<br> LUP_RETURN_QUERY_STRING = $0800;<br> {$EXTERNALSYM LUP_RETURN_QUERY_STRING}<br> LUP_RETURN_ALL = $0FF0;<br> {$EXTERNALSYM LUP_RETURN_ALL}<br> LUP_RES_SERVICE = $8000;<br> {$EXTERNALSYM LUP_RES_SERVICE}<br><br> LUP_FLUSHCACHE = $1000;<br> {$EXTERNALSYM LUP_FLUSHCACHE}<br> LUP_FLUSHPREVIOUS = $2000;<br> {$EXTERNALSYM LUP_FLUSHPREVIOUS}<br><br>//<br>// Return flags<br>//<br><br> RESULT_IS_ALIAS = $0001;<br> {$EXTERNALSYM RESULT_IS_ALIAS}<br> RESULT_IS_ADDED = $0010;<br> {$EXTERNALSYM RESULT_IS_ADDED}<br> RESULT_IS_CHANGED = $0020;<br> {$EXTERNALSYM RESULT_IS_CHANGED}<br> RESULT_IS_DELETED = $0040;<br> {$EXTERNALSYM RESULT_IS_DELETED}<br><br>//<br>// Service Address Registration and Deregistration Data Types.<br>//<br><br>type<br> _WSAESETSERVICEOP = (RNRSERVICE_REGISTER, RNRSERVICE_DEREGISTER, RNRSERVICE_DELETE);<br> {$EXTERNALSYM _WSAESETSERVICEOP}<br> WSAESETSERVICEOP = _WSAESETSERVICEOP;<br> {$EXTERNALSYM WSAESETSERVICEOP}<br> PWSAESETSERVICEOP = ^WSAESETSERVICEOP;<br> {$EXTERNALSYM PWSAESETSERVICEOP}<br> LPWSAESETSERVICEOP = ^WSAESETSERVICEOP;<br> {$EXTERNALSYM LPWSAESETSERVICEOP}<br><br>//<br>// Service Installation/Removal Data Types.<br>//<br><br> _WSANSClassInfoA = record<br> lpszName: LPSTR;<br> dwNameSpace: DWORD;<br> dwValueType: DWORD;<br> dwValueSize: DWORD;<br> lpValue: LPVOID;<br> end;<br> {$EXTERNALSYM _WSANSClassInfoA}<br> WSANSCLASSINFOA = _WSANSClassInfoA;<br> {$EXTERNALSYM WSANSCLASSINFOA}<br> PWSANSCLASSINFOA = ^WSANSCLASSINFOA;<br> {$EXTERNALSYM PWSANSCLASSINFOA}<br> LPWSANSCLASSINFOA = ^WSANSCLASSINFOA;<br> {$EXTERNALSYM LPWSANSCLASSINFOA}<br> TWsaNsClassInfoA = WSANSCLASSINFOA;<br><br> _WSANSClassInfoW = record<br> lpszName: LPWSTR;<br> dwNameSpace: DWORD;<br> dwValueType: DWORD;<br> dwValueSize: DWORD;<br> lpValue: LPVOID;<br> end;<br> {$EXTERNALSYM _WSANSClassInfoW}<br> WSANSCLASSINFOW = _WSANSClassInfoW;<br> {$EXTERNALSYM WSANSCLASSINFOW}<br> PWSANSCLASSINFOW = ^WSANSCLASSINFOW;<br> {$EXTERNALSYM PWSANSCLASSINFOW}<br> LPWSANSCLASSINFOW = ^WSANSCLASSINFOW;<br> {$EXTERNALSYM LPWSANSCLASSINFOW}<br> TWsaNsClassInfoW = WSANSCLASSINFOW;<br><br> {$IFDEF UNICODE}<br> WSANSCLASSINFO = WSANSCLASSINFOW;<br> {$EXTERNALSYM WSANSCLASSINFO}<br> PWSANSCLASSINFO = PWSANSCLASSINFOW;<br> {$EXTERNALSYM PWSANSCLASSINFO}<br> LPWSANSCLASSINFO = LPWSANSCLASSINFOW;<br> {$EXTERNALSYM LPWSANSCLASSINFO}<br> TWsaNsClassInfo = TWsaNsClassInfoW;<br> {$ELSE}<br> WSANSCLASSINFO = WSANSCLASSINFOA;<br> {$EXTERNALSYM WSANSCLASSINFO}<br> PWSANSCLASSINFO = PWSANSCLASSINFOA;<br> {$EXTERNALSYM PWSANSCLASSINFO}<br> LPWSANSCLASSINFO = LPWSANSCLASSINFOA;<br> {$EXTERNALSYM LPWSANSCLASSINFO}<br> TWsaNsClassInfo = TWsaNsClassInfoA;<br> {$ENDIF UNICODE}<br><br> _WSAServiceClassInfoA = record<br> lpServiceClassId: PGUID;<br> lpszServiceClassName: LPSTR;<br> dwCount: DWORD;<br> lpClassInfos: LPWSANSCLASSINFOA;<br> end;<br> {$EXTERNALSYM _WSAServiceClassInfoA}<br> WSASERVICECLASSINFOA = _WSAServiceClassInfoA;<br> {$EXTERNALSYM WSASERVICECLASSINFOA}<br> PWSASERVICECLASSINFOA = ^WSASERVICECLASSINFOA;<br> {$EXTERNALSYM PWSASERVICECLASSINFOA}<br> LPWSASERVICECLASSINFOA = ^WSASERVICECLASSINFOA;<br> {$EXTERNALSYM LPWSASERVICECLASSINFOA}<br> TWsaServiceClassInfoA = WSASERVICECLASSINFOA;<br><br> _WSAServiceClassInfoW = record<br> lpServiceClassId: PGUID;<br> lpszServiceClassName: LPWSTR;<br> dwCount: DWORD;<br> lpClassInfos: LPWSANSCLASSINFOW;<br> end;<br> {$EXTERNALSYM _WSAServiceClassInfoW}<br> WSASERVICECLASSINFOW = _WSAServiceClassInfoW;<br> {$EXTERNALSYM WSASERVICECLASSINFOW}<br> PWSASERVICECLASSINFOW = ^WSASERVICECLASSINFOW;<br> {$EXTERNALSYM PWSASERVICECLASSINFOW}<br> LPWSASERVICECLASSINFOW = ^WSASERVICECLASSINFOW;<br> {$EXTERNALSYM LPWSASERVICECLASSINFOW}<br> TWsaServiceClassInfoW = WSASERVICECLASSINFOW;<br><br> {$IFDEF UNICODE}<br> WSASERVICECLASSINFO = WSASERVICECLASSINFOW;<br> {$EXTERNALSYM WSASERVICECLASSINFO}<br> PWSASERVICECLASSINFO = PWSASERVICECLASSINFOW;<br> {$EXTERNALSYM PWSASERVICECLASSINFO}<br> LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOW;<br> {$EXTERNALSYM LPWSASERVICECLASSINFO}<br> TWsaServiceClassInfo = TWsaServiceClassInfoW;<br> {$ELSE}<br> WSASERVICECLASSINFO = WSASERVICECLASSINFOA;<br> {$EXTERNALSYM WSASERVICECLASSINFO}<br> PWSASERVICECLASSINFO = PWSASERVICECLASSINFOA;<br> {$EXTERNALSYM PWSASERVICECLASSINFO}<br> LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOA;<br> {$EXTERNALSYM LPWSASERVICECLASSINFO}<br> TWsaServiceClassInfo = TWsaServiceClassInfoA;<br> {$ENDIF UNICODE}<br><br> LPWSANAMESPACE_INFOA = ^WSANAMESPACE_INFOA;<br> {$EXTERNALSYM LPWSANAMESPACE_INFOA}<br> PWSANAMESPACE_INFOA = ^WSANAMESPACE_INFOA;<br> {$EXTERNALSYM PWSANAMESPACE_INFOA}<br> _WSANAMESPACE_INFOA = record<br> NSProviderId: TGUID;<br> dwNameSpace: DWORD;<br> fActive: BOOL;<br> dwVersion: DWORD;<br> lpszIdentifier: LPSTR;<br> end;<br> {$EXTERNALSYM _WSANAMESPACE_INFOA}<br> WSANAMESPACE_INFOA = _WSANAMESPACE_INFOA;<br> {$EXTERNALSYM WSANAMESPACE_INFOA}<br> TWsaNameSpaceInfoA = WSANAMESPACE_INFOA;<br> PWsaNameSpaceInfoA = LPWSANAMESPACE_INFOA;<br><br> LPWSANAMESPACE_INFOW = ^WSANAMESPACE_INFOW;<br> {$EXTERNALSYM LPWSANAMESPACE_INFOW}<br> PWSANAMESPACE_INFOW = ^WSANAMESPACE_INFOW;<br> {$EXTERNALSYM PWSANAMESPACE_INFOW}<br> _WSANAMESPACE_INFOW = record<br> NSProviderId: TGUID;<br> dwNameSpace: DWORD;<br> fActive: BOOL;<br> dwVersion: DWORD;<br> lpszIdentifier: LPWSTR;<br> end;<br> {$EXTERNALSYM _WSANAMESPACE_INFOW}<br> WSANAMESPACE_INFOW = _WSANAMESPACE_INFOW;<br> {$EXTERNALSYM WSANAMESPACE_INFOW}<br> TWsaNameSpaceInfoW = WSANAMESPACE_INFOW;<br> PWsaNameSpaceInfoW = PWSANAMESPACE_INFOW;<br><br> {$IFDEF UNICODE}<br> WSANAMESPACE_INFO = WSANAMESPACE_INFOW;<br> {$EXTERNALSYM WSANAMESPACE_INFO}<br> PWSANAMESPACE_INFO = PWSANAMESPACE_INFOW;<br> {$EXTERNALSYM PWSANAMESPACE_INFO}<br> LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOW;<br> {$EXTERNALSYM LPWSANAMESPACE_INFO}<br> TWsaNameSpaceInfo = TWsaNameSpaceInfoW;<br> PWsaNameSpaceInfo = PWsaNameSpaceInfoW;<br> {$ELSE}<br> WSANAMESPACE_INFO = WSANAMESPACE_INFOA;<br> {$EXTERNALSYM WSANAMESPACE_INFO}<br> PWSANAMESPACE_INFO = PWSANAMESPACE_INFOA;<br> {$EXTERNALSYM PWSANAMESPACE_INFO}<br> LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOA;<br> {$EXTERNALSYM LPWSANAMESPACE_INFO}<br> TWsaNameSpaceInfo = TWsaNameSpaceInfoA;<br> PWsaNameSpaceInfo = PWsaNameSpaceInfoA;<br> {$ENDIF UNICODE}<br><br>// Socket function prototypes<br><br>function accept(s: TSocket; addr: PSockAddr; addrlen: PINT): TSocket; stdcall;<br>{$EXTERNALSYM accept}<br>function bind(s: TSocket; name: PSockAddr; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM bind}<br>function closesocket(s: TSocket): Integer; stdcall;<br>{$EXTERNALSYM closesocket}<br>function connect(s: TSocket; name: PSockAddr; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM connect}<br>function ioctlsocket(s: TSocket; cmd: Longint; var argp: u_long): Integer; stdcall;<br>{$EXTERNALSYM ioctlsocket}<br>function getpeername(s: TSocket; name: PSockAddr; var namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getpeername}<br>function getsockname(s: TSocket; name: PSockAddr; var namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getsockname}<br>function getsockopt(s: TSocket; level, optname: Integer; optval: PChar; var optlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getsockopt}<br>function htonl(hostlong: u_long): u_long; stdcall;<br>{$EXTERNALSYM htonl}<br>function htons(hostshort: u_short): u_short; stdcall;<br>{$EXTERNALSYM htons}<br>function inet_addr(cp: PChar): u_long; stdcall;<br>{$EXTERNALSYM inet_addr}<br>function inet_ntoa(inaddr: in_addr): PChar; stdcall;<br>{$EXTERNALSYM inet_ntoa}<br>function listen(s: TSocket; backlog: Integer): Integer; stdcall;<br>{$EXTERNALSYM listen}<br>function ntohl(netlong: u_long): u_long; stdcall;<br>{$EXTERNALSYM ntohl}<br>function ntohs(netshort: u_short): u_short; stdcall;<br>{$EXTERNALSYM ntohs}<br>function recv(s: TSocket; var buf; len, flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM recv}<br>function recvfrom(s: TSocket; var buf; len, flags: Integer; from: PSockAddr; var fromlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM recvfrom}<br>function select(nfds: Integer; readfds, writefds, exceptfds: PFdSet; timeout: PTimeVal): Integer; stdcall;<br>{$EXTERNALSYM select}<br>function send(s: TSocket; var buf; len, flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM send}<br>function sendto(s: TSocket; var buf; len, flags: Integer; toaddr: PSockAddr; tolen: Integer): Integer; stdcall;<br>{$EXTERNALSYM sendto}<br>function setsockopt(s: TSocket; level, optname: Integer; optval: PChar; optlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM setsockopt}<br>function shutdown(s: TSocket; how: Integer): Integer; stdcall;<br>{$EXTERNALSYM shutdown}<br>function socket(af, type_, protocol: Integer): TSocket; stdcall;<br>{$EXTERNALSYM socket}<br><br>// Database function prototypes<br><br>function gethostbyaddr(addr: PChar; len, type_: Integer): PHostEnt; stdcall;<br>{$EXTERNALSYM gethostbyaddr}<br>function gethostbyname(name: PChar): PHostEnt; stdcall;<br>{$EXTERNALSYM gethostbyname}<br>function gethostname(name: PChar; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM gethostname}<br>function getservbyport(port: Integer; proto: PChar): PServEnt; stdcall;<br>{$EXTERNALSYM getservbyport}<br>function getservbyname(name, proto: PChar): PServEnt; stdcall;<br>{$EXTERNALSYM getservbyname}<br>function getprotobynumber(number: Integer): PProtoEnt; stdcall;<br>{$EXTERNALSYM getprotobynumber}<br>function getprotobyname(name: PChar): PProtoEnt; stdcall;<br>{$EXTERNALSYM getprotobyname}<br><br>// Microsoft Windows Extension function prototypes<br><br>function WSAStartup(wVersionRequired: WORD; var lpWSAData: TWSAData): Integer; stdcall;<br>{$EXTERNALSYM WSAStartup}<br>function WSACleanup: Integer; stdcall;<br>{$EXTERNALSYM WSACleanup}<br>procedure WSASetLastError(iError: Integer); stdcall;<br>{$EXTERNALSYM WSASetLastError}<br>function WSAGetLastError: Integer; stdcall;<br>{$EXTERNALSYM WSAGetLastError}<br>function WSAIsBlocking: BOOL; stdcall;<br>{$EXTERNALSYM WSAIsBlocking}<br>function WSAUnhookBlockingHook: Integer; stdcall;<br>{$EXTERNALSYM WSAUnhookBlockingHook}<br>function WSASetBlockingHook(lpBlockFunc: FARPROC): FARPROC; stdcall;<br>{$EXTERNALSYM WSASetBlockingHook}<br>function WSACancelBlockingCall: Integer; stdcall;<br>{$EXTERNALSYM WSACancelBlockingCall}<br>function WSAAsyncGetServByName(hWnd: HWND; wMsg: u_int; name, proto, buf: PChar;<br> buflen: Integer): HANDLE; stdcall;<br>{$EXTERNALSYM WSAAsyncGetServByName}<br>function WSAAsyncGetServByPort(hWnd: HWND; wMsg: u_int; port: Integer;<br> proto, buf: PChar; buflen: Integer): HANDLE; stdcall;<br>{$EXTERNALSYM WSAAsyncGetServByPort}<br>function WSAAsyncGetProtoByName(hWnd: HWND; wMsg: u_int; name, buf: PChar;<br> buflen: Integer): HANDLE; stdcall;<br>{$EXTERNALSYM WSAAsyncGetProtoByName}<br>function WSAAsyncGetProtoByNumber(hWnd: HWND; wMsg: u_int; number: Integer;<br> buf: PChar; buflen: Integer): HANDLE; stdcall;<br>{$EXTERNALSYM WSAAsyncGetProtoByNumber}<br>function WSAAsyncGetHostByName(hWnd: HWND; wMsg: u_int; name, buf: PChar;<br> buflen: Integer): HANDLE; stdcall;<br>{$EXTERNALSYM WSAAsyncGetHostByName}<br>function WSAAsyncGetHostByAddr(hWnd: HWND; wMsg: u_int; addr: PChar;<br> len, type_: Integer; buf: PChar; buflen: Integer): HANDLE; stdcall;<br>{$EXTERNALSYM WSAAsyncGetHostByAddr}<br>function WSACancelAsyncRequest(hAsyncTaskHandle: HANDLE): Integer; stdcall;<br>{$EXTERNALSYM WSACancelAsyncRequest}<br>function WSAAsyncSelect(s: TSocket; hWnd: HWND; wMsg: u_int; lEvent: Longint): Integer; stdcall;<br>{$EXTERNALSYM WSAAsyncSelect}<br><br>// WinSock 2 API new function prototypes<br><br>function WSAAccept(s: TSocket; addr: PSockAddr; addrlen: PINT;<br> lpfnCondition: LPCONDITIONPROC; dwCallbackData: DWORD): TSocket; stdcall;<br>{$EXTERNALSYM WSAAccept}<br>function WSACloseEvent(hEvent: WSAEVENT): BOOL; stdcall;<br>{$EXTERNALSYM WSACloseEvent}<br>function WSAConnect(s: TSocket; name: PSockAddr; namelen: Integer; lpCallerData: LPWSABUF;<br> lpCalleeData: LPWSABUF; lpSQOS: LPQOS; lpGQOS: LPQOS): Integer; stdcall;<br>{$EXTERNALSYM WSAConnect}<br>function WSACreateEvent: WSAEVENT; stdcall;<br>{$EXTERNALSYM WSACreateEvent}<br>function WSADuplicateSocketA(s: TSocket; dwProcessId: DWORD; lpProtocolInfo: LPWSAPROTOCOL_INFOA): Integer; stdcall;<br>{$EXTERNALSYM WSADuplicateSocketA}<br>function WSADuplicateSocketW(s: TSocket; dwProcessId: DWORD; lpProtocolInfo: LPWSAPROTOCOL_INFOW): Integer; stdcall;<br>{$EXTERNALSYM WSADuplicateSocketW}<br>function WSADuplicateSocket(s: TSocket; dwProcessId: DWORD; lpProtocolInfo: LPWSAPROTOCOL_INFO): Integer; stdcall;<br>{$EXTERNALSYM WSADuplicateSocket}<br>function WSAEnumNetworkEvents(s: TSocket; hEventObject: WSAEVENT; lpNetworkEvents: LPWSANETWORKEVENTS): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumNetworkEvents}<br>function WSAEnumProtocolsA(lpiProtocols: PINT; lpProtocolBuffer: LPWSAPROTOCOL_INFOA;<br> var lpdwBufferLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumProtocolsA}<br>function WSAEnumProtocolsW(lpiProtocols: PINT; lpProtocolBuffer: LPWSAPROTOCOL_INFOW;<br> var lpdwBufferLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumProtocolsW}<br>function WSAEnumProtocols(lpiProtocols: PINT; lpProtocolBuffer: LPWSAPROTOCOL_INFO;<br> var lpdwBufferLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumProtocols}<br>function WSAEventSelect(s: TSocket; hEventObject: WSAEVENT; lNetworkEvents: Longint): Integer; stdcall;<br>{$EXTERNALSYM WSAEventSelect}<br>function WSAGetOverlappedResult(s: TSocket; lpOverlapped: LPWSAOVERLAPPED;<br> var lpcbTransfer: DWORD; fWait: BOOL; var lpdwFlags: DWORD): BOOL; stdcall; // Thanks Kai Henningsen for var on lpdwFlags<br>{$EXTERNALSYM WSAGetOverlappedResult}<br>function WSAGetQOSByName(s: TSocket; var lpQOSName: WSABUF; lpQOS: LPQOS): BOOL; stdcall;<br>{$EXTERNALSYM WSAGetQOSByName}<br>function WSAHtonl(s: TSocket; hostlong: u_long; var lpnetlong: u_long): Integer; stdcall;<br>{$EXTERNALSYM WSAHtonl}<br>function WSAHtons(s: TSocket; hostshort: u_short; var lpnetshort: u_short): Integer; stdcall;<br>{$EXTERNALSYM WSAHtons}<br>function WSAIoctl(s: TSocket; dwIoControlCode: DWORD; lpvInBuffer: LPVOID; cbInBuffer: DWORD;<br> lpvOutBuffer: LPVOID; cbOutBuffer: DWORD; var lpcbBytesReturned: DWORD;<br> lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;<br>{$EXTERNALSYM WSAIoctl}<br>function WSAJoinLeaf(s: TSocket; name: PSockAddr; namelen: Integer; lpCallerData: LPWSABUF;<br> lpCalleeData: LPWSABUF; lpSQOS, lpGQOS: LPQOS; dwFlags: DWORD): TSocket; stdcall;<br>{$EXTERNALSYM WSAJoinLeaf}<br>function WSANtohl(s: TSocket; netlong: u_long; var lphostlong: u_long): Integer; stdcall;<br>{$EXTERNALSYM WSANtohl}<br>function WSANtohs(s: TSocket; netshort: u_short; var lphostshort: u_short): Integer; stdcall;<br>{$EXTERNALSYM WSANtohs}<br>function WSARecv(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;<br> var lpNumberOfBytesRecvd, lpFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED;<br> lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;<br>{$EXTERNALSYM WSARecv}<br>function WSARecvDisconnect(s: TSocket; lpInboundDisconnectData: LPWSABUF): Integer; stdcall;<br>{$EXTERNALSYM WSARecvDisconnect}<br>function WSARecvFrom(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;<br> var lpNumberOfBytesRecvd, lpFlags: DWORD; lpFrom: PSockAddr; lpFromlen: PINT;<br> lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;<br>{$EXTERNALSYM WSARecvFrom}<br>function WSAResetEvent(hEvent: WSAEVENT): BOOL; stdcall;<br>{$EXTERNALSYM WSAResetEvent}<br>function WSASend(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;<br> var lpNumberOfBytesSent: DWORD; dwFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED;<br> lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;<br>{$EXTERNALSYM WSASend}<br>function WSASendDisconnect(s: TSocket; lpOutboundDisconnectData: LPWSABUF): Integer; stdcall;<br>{$EXTERNALSYM WSASendDisconnect}<br>function WSASendTo(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;<br> var lpNumberOfBytesSent: DWORD; dwFlags: DWORD; lpTo: PSockAddr; iTolen: Integer;<br> lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;<br>{$EXTERNALSYM WSASendTo}<br>function WSASetEvent(hEvent: WSAEVENT): BOOL; stdcall;<br>{$EXTERNALSYM WSASetEvent}<br>function WSASocketA(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFOA;<br> g: GROUP; dwFlags: DWORD): TSocket; stdcall;<br>{$EXTERNALSYM WSASocketA}<br>function WSASocketW(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFOW;<br> g: GROUP; dwFlags: DWORD): TSocket; stdcall;<br>{$EXTERNALSYM WSASocketW}<br>function WSASocket(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFO;<br> g: GROUP; dwFlags: DWORD): TSocket; stdcall;<br>{$EXTERNALSYM WSASocket}<br>function WSAWaitForMultipleEvents(cEvents: DWORD; lphEvents: PWSAEVENT;<br> fWaitAll: BOOL; dwTimeout: DWORD; fAlertable: BOOL): DWORD; stdcall;<br>{$EXTERNALSYM WSAWaitForMultipleEvents}<br>function WSAAddressToStringA(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;<br> lpProtocolInfo: LPWSAPROTOCOL_INFOA; lpszAddressString: LPSTR;<br> var lpdwAddressStringLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAAddressToStringA}<br>function WSAAddressToStringW(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;<br> lpProtocolInfo: LPWSAPROTOCOL_INFOW; lpszAddressString: LPWSTR;<br> var lpdwAddressStringLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAAddressToStringW}<br>function WSAAddressToString(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;<br> lpProtocolInfo: LPWSAPROTOCOL_INFO; lpszAddressString: LPTSTR;<br> var lpdwAddressStringLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAAddressToString}<br>function WSAStringToAddressA(AddressString: LPSTR; AddressFamily: Integer;<br> lpProtocolInfo: LPWSAPROTOCOL_INFOA; lpAddress: LPSOCKADDR;<br> var lpAddressLength: Integer): Integer; stdcall;<br>{$EXTERNALSYM WSAStringToAddressA}<br>function WSAStringToAddressW(AddressString: LPWSTR; AddressFamily: Integer;<br> lpProtocolInfo: LPWSAPROTOCOL_INFOW; lpAddress: LPSOCKADDR;<br> var lpAddressLength: Integer): Integer; stdcall;<br>{$EXTERNALSYM WSAStringToAddressW}<br>function WSAStringToAddress(AddressString: LPTSTR; AddressFamily: Integer;<br> lpProtocolInfo: LPWSAPROTOCOL_INFO; lpAddress: LPSOCKADDR;<br> var lpAddressLength: Integer): Integer; stdcall;<br>{$EXTERNALSYM WSAStringToAddress}<br><br>// Registration and Name Resolution API functions<br><br>function WSALookupServiceBeginA(lpqsRestrictions: LPWSAQUERYSETA;<br> dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceBeginA}<br>function WSALookupServiceBeginW(lpqsRestrictions: LPWSAQUERYSETW;<br> dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceBeginW}<br>function WSALookupServiceBegin(lpqsRestrictions: LPWSAQUERYSET;<br> dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceBegin}<br>function WSALookupServiceNextA(hLookup: HANDLE; dwControlFlags: DWORD;<br> var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSETA): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceNextA}<br>function WSALookupServiceNextW(hLookup: HANDLE; dwControlFlags: DWORD;<br> var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSETW): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceNextW}<br>function WSALookupServiceNext(hLookup: HANDLE; dwControlFlags: DWORD;<br> var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSET): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceNext}<br>function WSANSPIoctl(hLookup: HANDLE; dwControlCode: DWORD; lpvInBuffer: LPVOID; cbInBuffer: DWORD;<br> lpvOutBuffer: LPVOID; cbOutBuffer: DWORD; lpcbBytesReturned: LPDWORD; lpCompletion: LPWSACOMPLETION): Integer; stdcall;<br>{$EXTERNALSYM WSANSPIoctl}<br>function WSALookupServiceEnd(hLookup: HANDLE): Integer; stdcall;<br>{$EXTERNALSYM WSALookupServiceEnd}<br>function WSAInstallServiceClassA(lpServiceClassInfo: LPWSASERVICECLASSINFOA): Integer; stdcall;<br>{$EXTERNALSYM WSAInstallServiceClassA}<br>function WSAInstallServiceClassW(lpServiceClassInfo: LPWSASERVICECLASSINFOW): Integer; stdcall;<br>{$EXTERNALSYM WSAInstallServiceClassW}<br>function WSAInstallServiceClass(lpServiceClassInfo: LPWSASERVICECLASSINFO): Integer; stdcall;<br>{$EXTERNALSYM WSAInstallServiceClass}<br>function WSARemoveServiceClass(const lpServiceClassId: TGUID): Integer; stdcall;<br>{$EXTERNALSYM WSARemoveServiceClass}<br>function WSAGetServiceClassInfoA(const lpProviderId, lpServiceClassId: TGUID;<br> var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFOA): Integer; stdcall;<br>{$EXTERNALSYM WSAGetServiceClassInfoA}<br>function WSAGetServiceClassInfoW(const lpProviderId, lpServiceClassId: TGUID;<br> var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFOW): Integer; stdcall;<br>{$EXTERNALSYM WSAGetServiceClassInfoW}<br>function WSAGetServiceClassInfo(const lpProviderId, lpServiceClassId: TGUID;<br> var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFO): Integer; stdcall;<br>{$EXTERNALSYM WSAGetServiceClassInfo}<br>function WSAEnumNameSpaceProvidersA(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFOA): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumNameSpaceProvidersA}<br>function WSAEnumNameSpaceProvidersW(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFOW): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumNameSpaceProvidersW}<br>function WSAEnumNameSpaceProviders(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFO): Integer; stdcall;<br>{$EXTERNALSYM WSAEnumNameSpaceProviders}<br>function WSAGetServiceClassNameByClassIdA(const lpServiceClassId: TGUID;<br> lpszServiceClassName: LPSTR; var lpdwBufferLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAGetServiceClassNameByClassIdA}<br>function WSAGetServiceClassNameByClassIdW(const lpServiceClassId: TGUID;<br> lpszServiceClassName: LPWSTR; var lpdwBufferLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAGetServiceClassNameByClassIdW}<br>function WSAGetServiceClassNameByClassId(const lpServiceClassId: TGUID;<br> lpszServiceClassName: LPTSTR; var lpdwBufferLength: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSAGetServiceClassNameByClassId}<br>function WSASetServiceA(lpqsRegInfo: LPWSAQUERYSETA; essoperation: WSAESETSERVICEOP;<br> dwControlFlags: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSASetServiceA}<br>function WSASetServiceW(lpqsRegInfo: LPWSAQUERYSETW; essoperation: WSAESETSERVICEOP;<br> dwControlFlags: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSASetServiceW}<br>function WSASetService(lpqsRegInfo: LPWSAQUERYSET; essoperation: WSAESETSERVICEOP;<br> dwControlFlags: DWORD): Integer; stdcall;<br>{$EXTERNALSYM WSASetService}<br>function WSAProviderConfigChange(var lpNotificationHandle: HANDLE;<br> lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;<br>{$EXTERNALSYM WSAProviderConfigChange}<br><br>// Microsoft Windows Extended data types<br><br>type<br> PSOCKADDR_IN = ^sockaddr_in;<br> {$EXTERNALSYM PSOCKADDR_IN}<br> LPSOCKADDR_IN = ^sockaddr_in;<br> {$EXTERNALSYM LPSOCKADDR_IN}<br> LPLINGER = PLINGER;<br> {$EXTERNALSYM LPLINGER}<br> PIN_ADDR = ^in_addr;<br> {$EXTERNALSYM PIN_ADDR}<br> LPIN_ADDR = ^in_addr;<br> {$EXTERNALSYM LPIN_ADDR}<br> PFD_SET = ^fd_set;<br> {$EXTERNALSYM PFD_SET}<br> LPFD_SET = ^fd_set;<br> {$EXTERNALSYM LPFD_SET}<br> LPHOSTENT = PHOSTENT;<br> {$EXTERNALSYM LPHOSTENT}<br> LPSERVENT = PSERVENT;<br> {$EXTERNALSYM LPSERVENT}<br> LPPROTOENT = PPROTOENT;<br> {$EXTERNALSYM LPPROTOENT}<br> LPTIMEVAL = PTIMEVAL;<br> {$EXTERNALSYM LPTIMEVAL}<br><br>//<br>// Windows message parameter composition and decomposition<br>// macros.<br>//<br>// WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation<br>// when constructing the response to a WSAAsyncGetXByY() routine.<br>//<br><br>function WSAMAKEASYNCREPLY(buflen, error: WORD): DWORD;<br>{$EXTERNALSYM WSAMAKEASYNCREPLY}<br><br>//<br>// WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation<br>// when constructing the response to WSAAsyncSelect().<br>//<br><br>function WSAMAKESELECTREPLY(event, error: WORD): DWORD;<br>{$EXTERNALSYM WSAMAKESELECTREPLY}<br><br>//<br>// WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application<br>// to extract the buffer length from the lParam in the response<br>// to a WSAAsyncGetXByY().<br>//<br><br>function WSAGETASYNCBUFLEN(lParam: DWORD): WORD;<br>{$EXTERNALSYM WSAGETASYNCBUFLEN}<br><br>//<br>// WSAGETASYNCERROR is intended for use by the Windows Sockets application<br>// to extract the error code from the lParam in the response<br>// to a WSAGetXByY().<br>//<br><br>function WSAGETASYNCERROR(lParam: DWORD): WORD;<br>{$EXTERNALSYM WSAGETASYNCERROR}<br><br>//<br>// WSAGETSELECTEVENT is intended for use by the Windows Sockets application<br>// to extract the event code from the lParam in the response<br>// to a WSAAsyncSelect().<br>//<br><br>function WSAGETSELECTEVENT(lParam: DWORD): WORD;<br>{$EXTERNALSYM WSAGETSELECTEVENT}<br><br>//<br>// WSAGETSELECTERROR is intended for use by the Windows Sockets application<br>// to extract the error code from the lParam in the response<br>// to a WSAAsyncSelect().<br>//<br><br>function WSAGETSELECTERROR(lParam: DWORD): WORD;<br>{$EXTERNALSYM WSAGETSELECTERROR}<br><br>implementation<br><br>const<br> ws2_32 = 'ws2_32.dll';<br> {$IFDEF UNICODE}<br> AWSuffix = 'W';<br> {$ELSE}<br> AWSuffix = 'A';<br> {$ENDIF UNICODE}<br><br>procedure FD_CLR(fd: TSocket; var fdset: TFdSet);<br>var<br> I: Cardinal;<br>begin<br> I := 0;<br> while I < fdset.fd_count do<br> begin<br> if fdset.fd_array = fd then<br> begin<br> while I < fdset.fd_count - 1 do<br> begin<br> fdset.fd_array := fdset.fd_array[I + 1];<br> Inc(I);<br> end;<br> fdset.fd_count := fdset.fd_count - 1;<br> Break;<br> end;<br> Inc(I);<br> end;<br>end;<br><br>procedure _FD_SET(fd: TSocket; var fdset: TFDSet);<br>var<br> I: Cardinal;<br>begin<br> I := 0;<br> while I < fdset.fd_count do<br> begin<br> if fdset.fd_array = fd then<br> Break;<br> Inc(I);<br> end;<br> if I = fdset.fd_count then<br> begin<br> if fdset.fd_count < FD_SETSIZE then<br> begin<br> fdset.fd_array := fd;<br> fdset.fd_count := fdset.fd_count + 1;<br> end;<br> end;<br>end;<br><br>procedure FD_ZERO(var fdset: TFdSet);<br>begin<br> fdset.fd_count := 0;<br>end;<br><br>function FD_ISSET(fd: TSocket; var fdset: TFdSet): Boolean;<br>begin<br> Result := __WSAFDIsSet(fd, fdset) <> 0;<br>end;<br><br>function timerisset(const tvp: TTimeVal): Boolean;<br>begin<br> Result := (tvp.tv_sec <> 0) or (tvp.tv_usec <> 0);<br>end;<br><br>procedure timerclear(var tvp: TTimeVal);<br>begin<br> tvp.tv_sec := 0;<br> tvp.tv_usec := 0;<br>end;<br><br>function _IO(x, y: DWORD): DWORD;<br>begin<br> Result := IOC_VOID or (x shl 8) or y;<br>end;<br><br>function _IOR(x, y, t: DWORD): DWORD;<br>begin<br> Result := IOC_OUT or ((T and IOCPARM_MASK) shl 16) or (x shl 8) or y;<br>end;<br><br>function _IOW(x, y, t: DWORD): DWORD;<br>begin<br> Result := DWORD(IOC_IN or ((T and IOCPARM_MASK) shl 16) or (x shl 8) or y);<br>end;<br><br>function IN_CLASSA(i: DWORD): Boolean;<br>begin<br> Result := i and DWORD($80000000) = 0;<br>end;<br><br>function IN_CLASSB(i: DWORD): Boolean;<br>begin<br> Result := i and DWORD($C0000000) = DWORD($80000000);<br>end;<br><br>function IN_CLASSC(i: DWORD): Boolean;<br>begin<br> Result := (i and DWORD($e0000000)) = DWORD($C0000000);<br>end;<br><br>function IN_CLASSD(i: DWORD): Boolean;<br>begin<br> Result := (i and DWORD($f0000000)) = DWORD($e0000000);<br>end;<br><br>function IN_MULTICAST(i: DWORD): Boolean;<br>begin<br> Result := IN_CLASSD(i);<br>end;<br><br>function h_errno: Integer;<br>begin<br> Result := WSAGetLastError;<br>end;<br><br>function _WSAIO(x, y: DWORD): DWORD;<br>begin<br> Result := IOC_VOID or x or y;<br>end;<br><br>function _WSAIOR(x, y: DWORD): DWORD;<br>begin<br> Result := IOC_OUT or x or y;<br>end;<br><br>function _WSAIOW(x, y: DWORD): DWORD;<br>begin<br> Result := IOC_IN or x or y;<br>end;<br><br>function _WSAIORW(x, y: DWORD): DWORD;<br>begin<br> Result := IOC_INOUT or x or y;<br>end;<br><br>function WSAMAKEASYNCREPLY(buflen, error: WORD): DWORD;<br>begin<br> Result := MAKELONG(buflen, error);<br>end;<br><br>function WSAMAKESELECTREPLY(event, error: WORD): DWORD;<br>begin<br> Result := MAKELONG(event, error);<br>end;<br><br>function WSAGETASYNCBUFLEN(lParam: DWORD): WORD;<br>begin<br> Result := LOWORD(lParam);<br>end;<br><br>function WSAGETASYNCERROR(lParam: DWORD): WORD;<br>begin<br> Result := HIWORD(lParam);<br>end;<br><br>function WSAGETSELECTEVENT(lParam: DWORD): WORD;<br>begin<br> Result := LOWORD(lParam);<br>end;<br><br>function WSAGETSELECTERROR(lParam: DWORD): WORD;<br>begin<br> Result := HIWORD(lParam);<br>end;<br><br>{$IFDEF DYNAMIC_LINK}<br><br>var<br> ___WSAFDIsSet: Pointer;<br><br>function __WSAFDIsSet;<br>begin<br> GetProcedureAddress(___WSAFDIsSet, ws2_32, '__WSAFDIsSet');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [___WSAFDIsSet]<br> end;<br>end;<br><br>var<br> _accept: Pointer;<br><br>function accept;<br>begin<br> GetProcedureAddress(_accept, ws2_32, 'accept');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_accept]<br> end;<br>end;<br><br>var<br> _bind: Pointer;<br><br>function bind;<br>begin<br> GetProcedureAddress(_bind, ws2_32, 'bind');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_bind]<br> end;<br>end;<br><br>var<br> _closesocket: Pointer;<br><br>function closesocket;<br>begin<br> GetProcedureAddress(_closesocket, ws2_32, 'closesocket');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_closesocket]<br> end;<br>end;<br><br>var<br> _connect: Pointer;<br><br>function connect;<br>begin<br> GetProcedureAddress(_connect, ws2_32, 'connect');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_connect]<br> end;<br>end;<br><br>var<br> _ioctlsocket: Pointer;<br><br>function ioctlsocket;<br>begin<br> GetProcedureAddress(_ioctlsocket, ws2_32, 'ioctlsocket');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_ioctlsocket]<br> end;<br>end;<br><br>var<br> _getpeername: Pointer;<br><br>function getpeername;<br>begin<br> GetProcedureAddress(_getpeername, ws2_32, 'getpeername');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getpeername]<br> end;<br>end;<br><br>var<br> _getsockname: Pointer;<br><br>function getsockname;<br>begin<br> GetProcedureAddress(_getsockname, ws2_32, 'getsockname');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getsockname]<br> end;<br>end;<br><br>var<br> _getsockopt: Pointer;<br><br>function getsockopt;<br>begin<br> GetProcedureAddress(_getsockopt, ws2_32, 'getsockopt');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getsockopt]<br> end;<br>end;<br><br>var<br> _htonl: Pointer;<br><br>function htonl;<br>begin<br> GetProcedureAddress(_htonl, ws2_32, 'htonl');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_htonl]<br> end;<br>end;<br><br>var<br> _htons: Pointer;<br><br>function htons;<br>begin<br> GetProcedureAddress(_htons, ws2_32, 'htons');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_htons]<br> end;<br>end;<br><br>var<br> _inet_addr: Pointer;<br><br>function inet_addr;<br>begin<br> GetProcedureAddress(_inet_addr, ws2_32, 'inet_addr');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_inet_addr]<br> end;<br>end;<br><br>var<br> _inet_ntoa: Pointer;<br><br>function inet_ntoa;<br>begin<br> GetProcedureAddress(_inet_ntoa, ws2_32, 'inet_ntoa');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_inet_ntoa]<br> end;<br>end;<br><br>var<br> _listen: Pointer;<br><br>function listen;<br>begin<br> GetProcedureAddress(_listen, ws2_32, 'listen');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_listen]<br> end;<br>end;<br><br>var<br> _ntohl: Pointer;<br><br>function ntohl;<br>begin<br> GetProcedureAddress(_ntohl, ws2_32, 'ntohl');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_ntohl]<br> end;<br>end;<br><br>var<br> _ntohs: Pointer;<br><br>function ntohs;<br>begin<br> GetProcedureAddress(_ntohs, ws2_32, 'ntohs');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_ntohs]<br> end;<br>end;<br><br>var<br> _recv: Pointer;<br><br>function recv;<br>begin<br> GetProcedureAddress(_recv, ws2_32, 'recv');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_recv]<br> end;<br>end;<br><br>var<br> _recvfrom: Pointer;<br><br>function recvfrom;<br>begin<br> GetProcedureAddress(_recvfrom, ws2_32, 'recvfrom');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_recvfrom]<br> end;<br>end;<br><br>var<br> _select: Pointer;<br><br>function select;<br>begin<br> GetProcedureAddress(_select, ws2_32, 'select');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_select]<br> end;<br>end;<br><br>var<br> _send: Pointer;<br><br>function send;<br>begin<br> GetProcedureAddress(_send, ws2_32, 'send');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_send]<br> end;<br>end;<br><br>var<br> _sendto: Pointer;<br><br>function sendto;<br>begin<br> GetProcedureAddress(_sendto, ws2_32, 'sendto');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_sendto]<br> end;<br>end;<br><br>var<br> _setsockopt: Pointer;<br><br>function setsockopt;<br>begin<br> GetProcedureAddress(_setsockopt, ws2_32, 'setsockopt');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_setsockopt]<br> end;<br>end;<br><br>var<br> _shutdown: Pointer;<br><br>function shutdown;<br>begin<br> GetProcedureAddress(_shutdown, ws2_32, 'shutdown');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_shutdown]<br> end;<br>end;<br><br>var<br> _socket: Pointer;<br><br>function socket;<br>begin<br> GetProcedureAddress(_socket, ws2_32, 'socket');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_socket]<br> end;<br>end;<br><br>var<br> _gethostbyaddr: Pointer;<br><br>function gethostbyaddr;<br>begin<br> GetProcedureAddress(_gethostbyaddr, ws2_32, 'gethostbyaddr');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_gethostbyaddr]<br> end;<br>end;<br><br>var<br> _gethostbyname: Pointer;<br><br>function gethostbyname;<br>begin<br> GetProcedureAddress(_gethostbyname, ws2_32, 'gethostbyname');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_gethostbyname]<br> end;<br>end;<br><br>var<br> _gethostname: Pointer;<br><br>function gethostname;<br>begin<br> GetProcedureAddress(_gethostname, ws2_32, 'gethostname');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_gethostname]<br> end;<br>end;<br><br>var<br> _getservbyport: Pointer;<br><br>function getservbyport;<br>begin<br> GetProcedureAddress(_getservbyport, ws2_32, 'getservbyport');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getservbyport]<br> end;<br>end;<br><br>var<br> _getservbyname: Pointer;<br><br>function getservbyname;<br>begin<br> GetProcedureAddress(_getservbyname, ws2_32, 'getservbyname');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getservbyname]<br> end;<br>end;<br><br>var<br> _getprotobynumber: Pointer;<br><br>function getprotobynumber;<br>begin<br> GetProcedureAddress(_getprotobynumber, ws2_32, 'getprotobynumber');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getprotobynumber]<br> end;<br>end;<br><br>var<br> _getprotobyname: Pointer;<br><br>function getprotobyname;<br>begin<br> GetProcedureAddress(_getprotobyname, ws2_32, 'getprotobyname');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_getprotobyname]<br> end;<br>end;<br><br>var<br> _WSAStartup: Pointer;<br><br>function WSAStartup;<br>begin<br> GetProcedureAddress(_WSAStartup, ws2_32, 'WSAStartup');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAStartup]<br> end;<br>end;<br><br>var<br> _WSACleanup: Pointer;<br><br>function WSACleanup;<br>begin<br> GetProcedureAddress(_WSACleanup, ws2_32, 'WSACleanup');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSACleanup]<br> end;<br>end;<br><br>var<br> _WSASetLastError: Pointer;<br><br>procedure WSASetLastError;<br>begin<br> GetProcedureAddress(_WSASetLastError, ws2_32, 'WSASetLastError');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASetLastError]<br> end;<br>end;<br><br>var<br> _WSAGetLastError: Pointer;<br><br>function WSAGetLastError;<br>begin<br> GetProcedureAddress(_WSAGetLastError, ws2_32, 'WSAGetLastError');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetLastError]<br> end;<br>end;<br><br>var<br> _WSAIsBlocking: Pointer;<br><br>function WSAIsBlocking;<br>begin<br> GetProcedureAddress(_WSAIsBlocking, ws2_32, 'WSAIsBlocking');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAIsBlocking]<br> end;<br>end;<br><br>var<br> _WSAUnhookBlockingHook: Pointer;<br><br>function WSAUnhookBlockingHook;<br>begin<br> GetProcedureAddress(_WSAUnhookBlockingHook, ws2_32, 'WSAUnhookBlockingHook');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAUnhookBlockingHook]<br> end;<br>end;<br><br>var<br> _WSASetBlockingHook: Pointer;<br><br>function WSASetBlockingHook;<br>begin<br> GetProcedureAddress(_WSASetBlockingHook, ws2_32, 'WSASetBlockingHook');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASetBlockingHook]<br> end;<br>end;<br><br>var<br> _WSACancelBlockingCall: Pointer;<br><br>function WSACancelBlockingCall;<br>begin<br> GetProcedureAddress(_WSACancelBlockingCall, ws2_32, 'WSACancelBlockingCall');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSACancelBlockingCall]<br> end;<br>end;<br><br>var<br> _WSAAsyncGetServByName: Pointer;<br><br>function WSAAsyncGetServByName;<br>begin<br> GetProcedureAddress(_WSAAsyncGetServByName, ws2_32, 'WSAAsyncGetServByName');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncGetServByName]<br> end;<br>end;<br><br>var<br> _WSAAsyncGetServByPort: Pointer;<br><br>function WSAAsyncGetServByPort;<br>begin<br> GetProcedureAddress(_WSAAsyncGetServByPort, ws2_32, 'WSAAsyncGetServByPort');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncGetServByPort]<br> end;<br>end;<br><br>var<br> _WSAAsyncGetProtoByName: Pointer;<br><br>function WSAAsyncGetProtoByName;<br>begin<br> GetProcedureAddress(_WSAAsyncGetProtoByName, ws2_32, 'WSAAsyncGetProtoByName');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncGetProtoByName]<br> end;<br>end;<br><br>var<br> _WSAAsyncGetProtoByNumber: Pointer;<br><br>function WSAAsyncGetProtoByNumber;<br>begin<br> GetProcedureAddress(_WSAAsyncGetProtoByNumber, ws2_32, 'WSAAsyncGetProtoByNumber');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncGetProtoByNumber]<br> end;<br>end;<br><br>var<br> _WSAAsyncGetHostByName: Pointer;<br><br>function WSAAsyncGetHostByName;<br>begin<br> GetProcedureAddress(_WSAAsyncGetHostByName, ws2_32, 'WSAAsyncGetHostByName');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncGetHostByName]<br> end;<br>end;<br><br>var<br> _WSAAsyncGetHostByAddr: Pointer;<br><br>function WSAAsyncGetHostByAddr;<br>begin<br> GetProcedureAddress(_WSAAsyncGetHostByAddr, ws2_32, 'WSAAsyncGetHostByAddr');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncGetHostByAddr]<br> end;<br>end;<br><br>var<br> _WSACancelAsyncRequest: Pointer;<br><br>function WSACancelAsyncRequest;<br>begin<br> GetProcedureAddress(_WSACancelAsyncRequest, ws2_32, 'WSACancelAsyncRequest');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSACancelAsyncRequest]<br> end;<br>end;<br><br>var<br> _WSAAsyncSelect: Pointer;<br><br>function WSAAsyncSelect;<br>begin<br> GetProcedureAddress(_WSAAsyncSelect, ws2_32, 'WSAAsyncSelect');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAsyncSelect]<br> end;<br>end;<br><br>var<br> _WSAAccept: Pointer;<br><br>function WSAAccept;<br>begin<br> GetProcedureAddress(_WSAAccept, ws2_32, 'WSAAccept');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAccept]<br> end;<br>end;<br><br>var<br> _WSACloseEvent: Pointer;<br><br>function WSACloseEvent;<br>begin<br> GetProcedureAddress(_WSACloseEvent, ws2_32, 'WSACloseEvent');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSACloseEvent]<br> end;<br>end;<br><br>var<br> _WSAConnect: Pointer;<br><br>function WSAConnect;<br>begin<br> GetProcedureAddress(_WSAConnect, ws2_32, 'WSAConnect');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAConnect]<br> end;<br>end;<br><br>var<br> _WSACreateEvent: Pointer;<br><br>function WSACreateEvent;<br>begin<br> GetProcedureAddress(_WSACreateEvent, ws2_32, 'WSACreateEvent');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSACreateEvent]<br> end;<br>end;<br><br>var<br> _WSADuplicateSocketA: Pointer;<br><br>function WSADuplicateSocketA;<br>begin<br> GetProcedureAddress(_WSADuplicateSocketA, ws2_32, 'WSADuplicateSocketA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSADuplicateSocketA]<br> end;<br>end;<br><br>var<br> _WSADuplicateSocketW: Pointer;<br><br>function WSADuplicateSocketW;<br>begin<br> GetProcedureAddress(_WSADuplicateSocketW, ws2_32, 'WSADuplicateSocketW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSADuplicateSocketW]<br> end;<br>end;<br><br>var<br> _WSADuplicateSocket: Pointer;<br><br>function WSADuplicateSocket;<br>begin<br> GetProcedureAddress(_WSADuplicateSocket, ws2_32, 'WSADuplicateSocket' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSADuplicateSocket]<br> end;<br>end;<br><br>var<br> _WSAEnumNetworkEvents: Pointer;<br><br>function WSAEnumNetworkEvents;<br>begin<br> GetProcedureAddress(_WSAEnumNetworkEvents, ws2_32, 'WSAEnumNetworkEvents');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumNetworkEvents]<br> end;<br>end;<br><br>var<br> _WSAEnumProtocolsA: Pointer;<br><br>function WSAEnumProtocolsA;<br>begin<br> GetProcedureAddress(_WSAEnumProtocolsA, ws2_32, 'WSAEnumProtocolsA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumProtocolsA]<br> end;<br>end;<br><br>var<br> _WSAEnumProtocolsW: Pointer;<br><br>function WSAEnumProtocolsW;<br>begin<br> GetProcedureAddress(_WSAEnumProtocolsW, ws2_32, 'WSAEnumProtocolsW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumProtocolsW]<br> end;<br>end;<br><br>var<br> _WSAEnumProtocols: Pointer;<br><br>function WSAEnumProtocols;<br>begin<br> GetProcedureAddress(_WSAEnumProtocols, ws2_32, 'WSAEnumProtocols' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumProtocols]<br> end;<br>end;<br><br>var<br> _WSAEventSelect: Pointer;<br><br>function WSAEventSelect;<br>begin<br> GetProcedureAddress(_WSAEventSelect, ws2_32, 'WSAEventSelect');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEventSelect]<br> end;<br>end;<br><br>var<br> _WSAGetOverlappedResult: Pointer;<br><br>function WSAGetOverlappedResult;<br>begin<br> GetProcedureAddress(_WSAGetOverlappedResult, ws2_32, 'WSAGetOverlappedResult');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetOverlappedResult]<br> end;<br>end;<br><br>var<br> _WSAGetQOSByName: Pointer;<br><br>function WSAGetQOSByName;<br>begin<br> GetProcedureAddress(_WSAGetQOSByName, ws2_32, 'WSAGetQOSByName');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetQOSByName]<br> end;<br>end;<br><br>var<br> _WSAHtonl: Pointer;<br><br>function WSAHtonl;<br>begin<br> GetProcedureAddress(_WSAHtonl, ws2_32, 'WSAHtonl');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAHtonl]<br> end;<br>end;<br><br>var<br> _WSAHtons: Pointer;<br><br>function WSAHtons;<br>begin<br> GetProcedureAddress(_WSAHtons, ws2_32, 'WSAHtons');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAHtons]<br> end;<br>end;<br><br>var<br> _WSAIoctl: Pointer;<br><br>function WSAIoctl;<br>begin<br> GetProcedureAddress(_WSAIoctl, ws2_32, 'WSAIoctl');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAIoctl]<br> end;<br>end;<br><br>var<br> _WSAJoinLeaf: Pointer;<br><br>function WSAJoinLeaf;<br>begin<br> GetProcedureAddress(_WSAJoinLeaf, ws2_32, 'WSAJoinLeaf');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAJoinLeaf]<br> end;<br>end;<br><br>var<br> _WSANtohl: Pointer;<br><br>function WSANtohl;<br>begin<br> GetProcedureAddress(_WSANtohl, ws2_32, 'WSANtohl');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSANtohl]<br> end;<br>end;<br><br>var<br> _WSANtohs: Pointer;<br><br>function WSANtohs;<br>begin<br> GetProcedureAddress(_WSANtohs, ws2_32, 'WSANtohs');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSANtohs]<br> end;<br>end;<br><br>var<br> _WSARecv: Pointer;<br><br>function WSARecv;<br>begin<br> GetProcedureAddress(_WSARecv, ws2_32, 'WSARecv');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSARecv]<br> end;<br>end;<br><br>var<br> _WSARecvDisconnect: Pointer;<br><br>function WSARecvDisconnect;<br>begin<br> GetProcedureAddress(_WSARecvDisconnect, ws2_32, 'WSARecvDisconnect');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSARecvDisconnect]<br> end;<br>end;<br><br>var<br> _WSARecvFrom: Pointer;<br><br>function WSARecvFrom;<br>begin<br> GetProcedureAddress(_WSARecvFrom, ws2_32, 'WSARecvFrom');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSARecvFrom]<br> end;<br>end;<br><br>var<br> _WSAResetEvent: Pointer;<br><br>function WSAResetEvent;<br>begin<br> GetProcedureAddress(_WSAResetEvent, ws2_32, 'WSAResetEvent');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAResetEvent]<br> end;<br>end;<br><br>var<br> _WSASend: Pointer;<br><br>function WSASend;<br>begin<br> GetProcedureAddress(_WSASend, ws2_32, 'WSASend');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASend]<br> end;<br>end;<br><br>var<br> _WSASendDisconnect: Pointer;<br><br>function WSASendDisconnect;<br>begin<br> GetProcedureAddress(_WSASendDisconnect, ws2_32, 'WSASendDisconnect');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASendDisconnect]<br> end;<br>end;<br><br>var<br> _WSASendTo: Pointer;<br><br>function WSASendTo;<br>begin<br> GetProcedureAddress(_WSASendTo, ws2_32, 'WSASendTo');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASendTo]<br> end;<br>end;<br><br>var<br> _WSASetEvent: Pointer;<br><br>function WSASetEvent;<br>begin<br> GetProcedureAddress(_WSASetEvent, ws2_32, 'WSASetEvent');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASetEvent]<br> end;<br>end;<br><br>var<br> _WSASocketA: Pointer;<br><br>function WSASocketA;<br>begin<br> GetProcedureAddress(_WSASocketA, ws2_32, 'WSASocketA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASocketA]<br> end;<br>end;<br><br>var<br> _WSASocketW: Pointer;<br><br>function WSASocketW;<br>begin<br> GetProcedureAddress(_WSASocketW, ws2_32, 'WSASocketW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASocketW]<br> end;<br>end;<br><br>var<br> _WSASocket: Pointer;<br><br>function WSASocket;<br>begin<br> GetProcedureAddress(_WSASocket, ws2_32, 'WSASocket' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASocket]<br> end;<br>end;<br><br>var<br> _WSAWaitForMultipleEvents: Pointer;<br><br>function WSAWaitForMultipleEvents;<br>begin<br> GetProcedureAddress(_WSAWaitForMultipleEvents, ws2_32, 'WSAWaitForMultipleEvents');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAWaitForMultipleEvents]<br> end;<br>end;<br><br>var<br> _WSAAddressToStringA: Pointer;<br><br>function WSAAddressToStringA;<br>begin<br> GetProcedureAddress(_WSAAddressToStringA, ws2_32, 'WSAAddressToStringA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAddressToStringA]<br> end;<br>end;<br><br>var<br> _WSAAddressToStringW: Pointer;<br><br>function WSAAddressToStringW;<br>begin<br> GetProcedureAddress(_WSAAddressToStringW, ws2_32, 'WSAAddressToStringW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAddressToStringW]<br> end;<br>end;<br><br>var<br> _WSAAddressToString: Pointer;<br><br>function WSAAddressToString;<br>begin<br> GetProcedureAddress(_WSAAddressToString, ws2_32, 'WSAAddressToString' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAAddressToString]<br> end;<br>end;<br><br>var<br> _WSAStringToAddressA: Pointer;<br><br>function WSAStringToAddressA;<br>begin<br> GetProcedureAddress(_WSAStringToAddressA, ws2_32, 'WSAStringToAddressA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAStringToAddressA]<br> end;<br>end;<br><br>var<br> _WSAStringToAddressW: Pointer;<br><br>function WSAStringToAddressW;<br>begin<br> GetProcedureAddress(_WSAStringToAddressW, ws2_32, 'WSAStringToAddressW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAStringToAddressW]<br> end;<br>end;<br><br>var<br> _WSAStringToAddress: Pointer;<br><br>function WSAStringToAddress;<br>begin<br> GetProcedureAddress(_WSAStringToAddress, ws2_32, 'WSAStringToAddress' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAStringToAddress]<br> end;<br>end;<br><br>var<br> _WSALookupServiceBeginA: Pointer;<br><br>function WSALookupServiceBeginA;<br>begin<br> GetProcedureAddress(_WSALookupServiceBeginA, ws2_32, 'WSALookupServiceBeginA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceBeginA]<br> end;<br>end;<br><br>var<br> _WSALookupServiceBeginW: Pointer;<br><br>function WSALookupServiceBeginW;<br>begin<br> GetProcedureAddress(_WSALookupServiceBeginW, ws2_32, 'WSALookupServiceBeginW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceBeginW]<br> end;<br>end;<br><br>var<br> _WSALookupServiceBegin: Pointer;<br><br>function WSALookupServiceBegin;<br>begin<br> GetProcedureAddress(_WSALookupServiceBegin, ws2_32, 'WSALookupServiceBegin' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceBegin]<br> end;<br>end;<br><br>var<br> _WSALookupServiceNextA: Pointer;<br><br>function WSALookupServiceNextA;<br>begin<br> GetProcedureAddress(_WSALookupServiceNextA, ws2_32, 'WSALookupServiceNextA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceNextA]<br> end;<br>end;<br><br>var<br> _WSALookupServiceNextW: Pointer;<br><br>function WSALookupServiceNextW;<br>begin<br> GetProcedureAddress(_WSALookupServiceNextW, ws2_32, 'WSALookupServiceNextW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceNextW]<br> end;<br>end;<br><br>var<br> _WSALookupServiceNext: Pointer;<br><br>function WSALookupServiceNext;<br>begin<br> GetProcedureAddress(_WSALookupServiceNext, ws2_32, 'WSALookupServiceNext' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceNext]<br> end;<br>end;<br><br>var<br> _WSANSPIoctl: Pointer;<br><br>function WSANSPIoctl;<br>begin<br> GetProcedureAddress(_WSANSPIoctl, ws2_32, 'WSANSPIoctl');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSANSPIoctl]<br> end;<br>end;<br><br>var<br> _WSALookupServiceEnd: Pointer;<br><br>function WSALookupServiceEnd;<br>begin<br> GetProcedureAddress(_WSALookupServiceEnd, ws2_32, 'WSALookupServiceEnd');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSALookupServiceEnd]<br> end;<br>end;<br><br>var<br> _WSAInstallServiceClassA: Pointer;<br><br>function WSAInstallServiceClassA;<br>begin<br> GetProcedureAddress(_WSAInstallServiceClassA, ws2_32, 'WSAInstallServiceClassA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAInstallServiceClassA]<br> end;<br>end;<br><br>var<br> _WSAInstallServiceClassW: Pointer;<br><br>function WSAInstallServiceClassW;<br>begin<br> GetProcedureAddress(_WSAInstallServiceClassW, ws2_32, 'WSAInstallServiceClassW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAInstallServiceClassW]<br> end;<br>end;<br><br>var<br> _WSAInstallServiceClass: Pointer;<br><br>function WSAInstallServiceClass;<br>begin<br> GetProcedureAddress(_WSAInstallServiceClass, ws2_32, 'WSAInstallServiceClass' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAInstallServiceClass]<br> end;<br>end;<br><br>var<br> _WSARemoveServiceClass: Pointer;<br><br>function WSARemoveServiceClass;<br>begin<br> GetProcedureAddress(_WSARemoveServiceClass, ws2_32, 'WSARemoveServiceClass');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSARemoveServiceClass]<br> end;<br>end;<br><br>var<br> _WSAGetServiceClassInfoA: Pointer;<br><br>function WSAGetServiceClassInfoA;<br>begin<br> GetProcedureAddress(_WSAGetServiceClassInfoA, ws2_32, 'WSAGetServiceClassInfoA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetServiceClassInfoA]<br> end;<br>end;<br><br>var<br> _WSAGetServiceClassInfoW: Pointer;<br><br>function WSAGetServiceClassInfoW;<br>begin<br> GetProcedureAddress(_WSAGetServiceClassInfoW, ws2_32, 'WSAGetServiceClassInfoW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetServiceClassInfoW]<br> end;<br>end;<br><br>var<br> _WSAGetServiceClassInfo: Pointer;<br><br>function WSAGetServiceClassInfo;<br>begin<br> GetProcedureAddress(_WSAGetServiceClassInfo, ws2_32, 'WSAGetServiceClassInfo' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetServiceClassInfo]<br> end;<br>end;<br><br>var<br> _WSAEnumNameSpaceProvidersA: Pointer;<br><br>function WSAEnumNameSpaceProvidersA;<br>begin<br> GetProcedureAddress(_WSAEnumNameSpaceProvidersA, ws2_32, 'WSAEnumNameSpaceProvidersA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumNameSpaceProvidersA]<br> end;<br>end;<br><br>var<br> _WSAEnumNameSpaceProvidersW: Pointer;<br><br>function WSAEnumNameSpaceProvidersW;<br>begin<br> GetProcedureAddress(_WSAEnumNameSpaceProvidersW, ws2_32, 'WSAEnumNameSpaceProvidersW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumNameSpaceProvidersW]<br> end;<br>end;<br><br>var<br> _WSAEnumNameSpaceProviders: Pointer;<br><br>function WSAEnumNameSpaceProviders;<br>begin<br> GetProcedureAddress(_WSAEnumNameSpaceProviders, ws2_32, 'WSAEnumNameSpaceProviders' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAEnumNameSpaceProviders]<br> end;<br>end;<br><br>var<br> _WSAGetServClassNameByClassIdA: Pointer;<br><br>function WSAGetServiceClassNameByClassIdA;<br>begin<br> GetProcedureAddress(_WSAGetServClassNameByClassIdA, ws2_32, 'WSAGetServiceClassNameByClassIdA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetServClassNameByClassIdA]<br> end;<br>end;<br><br>var<br> _WSAGetServClassNameByClassIdW: Pointer;<br><br>function WSAGetServiceClassNameByClassIdW;<br>begin<br> GetProcedureAddress(_WSAGetServClassNameByClassIdW, ws2_32, 'WSAGetServiceClassNameByClassIdW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetServClassNameByClassIdW]<br> end;<br>end;<br><br>var<br> _WSAGetServClassNameByClassId: Pointer;<br><br>function WSAGetServiceClassNameByClassId;<br>begin<br> GetProcedureAddress(_WSAGetServClassNameByClassId, ws2_32, 'WSAGetServiceClassNameByClassId' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAGetServClassNameByClassId]<br> end;<br>end;<br><br>var<br> _WSASetServiceA: Pointer;<br><br>function WSASetServiceA;<br>begin<br> GetProcedureAddress(_WSASetServiceA, ws2_32, 'WSASetServiceA');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASetServiceA]<br> end;<br>end;<br><br>var<br> _WSASetServiceW: Pointer;<br><br>function WSASetServiceW;<br>begin<br> GetProcedureAddress(_WSASetServiceW, ws2_32, 'WSASetServiceW');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASetServiceW]<br> end;<br>end;<br><br>var<br> _WSASetService: Pointer;<br><br>function WSASetService;<br>begin<br> GetProcedureAddress(_WSASetService, ws2_32, 'WSASetService' + AWSuffix);<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSASetService]<br> end;<br>end;<br><br>var<br> _WSAProviderConfigChange: Pointer;<br><br>function WSAProviderConfigChange;<br>begin<br> GetProcedureAddress(_WSAProviderConfigChange, ws2_32, 'WSAProviderConfigChange');<br> asm<br> MOV ESP, EBP<br> POP EBP<br> JMP [_WSAProviderConfigChange]<br> end;<br>end;<br><br>{$ELSE}<br><br>function __WSAFDIsSet; external ws2_32 name '__WSAFDIsSet';<br>function accept; external ws2_32 name 'accept';<br>function bind; external ws2_32 name 'bind';<br>function closesocket; external ws2_32 name 'closesocket';<br>function connect; external ws2_32 name 'connect';<br>function ioctlsocket; external ws2_32 name 'ioctlsocket';<br>function getpeername; external ws2_32 name 'getpeername';<br>function getsockname; external ws2_32 name 'getsockname';<br>function getsockopt; external ws2_32 name 'getsockopt';<br>function htonl; external ws2_32 name 'htonl';<br>function htons; external ws2_32 name 'htons';<br>function inet_addr; external ws2_32 name 'inet_addr';<br>function inet_ntoa; external ws2_32 name 'inet_ntoa';<br>function listen; external ws2_32 name 'listen';<br>function ntohl; external ws2_32 name 'ntohl';<br>function ntohs; external ws2_32 name 'ntohs';<br>function recv; external ws2_32 name 'recv';<br>function recvfrom; external ws2_32 name 'recvfrom';<br>function select; external ws2_32 name 'select';<br>function send; external ws2_32 name 'send';<br>function sendto; external ws2_32 name 'sendto';<br>function setsockopt; external ws2_32 name 'setsockopt';<br>function shutdown; external ws2_32 name 'shutdown';<br>function socket; external ws2_32 name 'socket';<br>function gethostbyaddr; external ws2_32 name 'gethostbyaddr';<br>function gethostbyname; external ws2_32 name 'gethostbyname';<br>function gethostname; external ws2_32 name 'gethostname';<br>function getservbyport; external ws2_32 name 'getservbyport';<br>function getservbyname; external ws2_32 name 'getservbyname';<br>function getprotobynumber; external ws2_32 name 'getprotobynumber';<br>function getprotobyname; external ws2_32 name 'getprotobyname';<br>function WSAStartup; external ws2_32 name 'WSAStartup';<br>function WSACleanup; external ws2_32 name 'WSACleanup';<br>procedure WSASetLastError; external ws2_32 name 'WSASetLastError';<br>function WSAGetLastError; external ws2_32 name 'WSAGetLastError';<br>function WSAIsBlocking; external ws2_32 name 'WSAIsBlocking';<br>function WSAUnhookBlockingHook; external ws2_32 name 'WSAUnhookBlockingHook';<br>function WSASetBlockingHook; external ws2_32 name 'WSASetBlockingHook';<br>function WSACancelBlockingCall; external ws2_32 name 'WSACancelBlockingCall';<br>function WSAAsyncGetServByName; external ws2_32 name 'WSAAsyncGetServByName';<br>function WSAAsyncGetServByPort; external ws2_32 name 'WSAAsyncGetServByPort';<br>function WSAAsyncGetProtoByName; external ws2_32 name 'WSAAsyncGetProtoByName';<br>function WSAAsyncGetProtoByNumber; external ws2_32 name 'WSAAsyncGetProtoByNumber';<br>function WSAAsyncGetHostByName; external ws2_32 name 'WSAAsyncGetHostByName';<br>function WSAAsyncGetHostByAddr; external ws2_32 name 'WSAAsyncGetHostByAddr';<br>function WSACancelAsyncRequest; external ws2_32 name 'WSACancelAsyncRequest';<br>function WSAAsyncSelect; external ws2_32 name 'WSAAsyncSelect';<br>function WSAAccept; external ws2_32 name 'WSAAccept';<br>function WSACloseEvent; external ws2_32 name 'WSACloseEvent';<br>function WSAConnect; external ws2_32 name 'WSAConnect';<br>function WSACreateEvent; external ws2_32 name 'WSACreateEvent';<br>function WSADuplicateSocketA; external ws2_32 name 'WSADuplicateSocketA';<br>function WSADuplicateSocketW; external ws2_32 name 'WSADuplicateSocketW';<br>function WSADuplicateSocket; external ws2_32 name 'WSADuplicateSocket' + AWSuffix;<br>function WSAEnumNetworkEvents; external ws2_32 name 'WSAEnumNetworkEvents';<br>function WSAEnumProtocolsA; external ws2_32 name 'WSAEnumProtocolsA';<br>function WSAEnumProtocolsW; external ws2_32 name 'WSAEnumProtocolsW';<br>function WSAEnumProtocols; external ws2_32 name 'WSAEnumProtocols' + AWSuffix;<br>function WSAEventSelect; external ws2_32 name 'WSAEventSelect';<br>function WSAGetOverlappedResult; external ws2_32 name 'WSAGetOverlappedResult';<br>function WSAGetQOSByName; external ws2_32 name 'WSAGetQOSByName';<br>function WSAHtonl; external ws2_32 name 'WSAHtonl';<br>function WSAHtons; external ws2_32 name 'WSAHtons';<br>function WSAIoctl; external ws2_32 name 'WSAIoctl';<br>function WSAJoinLeaf; external ws2_32 name 'WSAJoinLeaf';<br>function WSANtohl; external ws2_32 name 'WSANtohl';<br>function WSANtohs; external ws2_32 name 'WSANtohs';<br>function WSARecv; external ws2_32 name 'WSARecv';<br>function WSARecvDisconnect; external ws2_32 name 'WSARecvDisconnect';<br>function WSARecvFrom; external ws2_32 name 'WSARecvFrom';<br>function WSAResetEvent; external ws2_32 name 'WSAResetEvent';<br>function WSASend; external ws2_32 name 'WSASend';<br>function WSASendDisconnect; external ws2_32 name 'WSASendDisconnect';<br>function WSASendTo; external ws2_32 name 'WSASendTo';<br>function WSASetEvent; external ws2_32 name 'WSASetEvent';<br>function WSASocketA; external ws2_32 name 'WSASocketA';<br>function WSASocketW; external ws2_32 name 'WSASocketW';<br>function WSASocket; external ws2_32 name 'WSASocket' + AWSuffix;<br>function WSAWaitForMultipleEvents; external ws2_32 name 'WSAWaitForMultipleEvents';<br>function WSAAddressToStringA; external ws2_32 name 'WSAAddressToStringA';<br>function WSAAddressToStringW; external ws2_32 name 'WSAAddressToStringW';<br>function WSAAddressToString; external ws2_32 name 'WSAAddressToString' + AWSuffix;<br>function WSAStringToAddressA; external ws2_32 name 'WSAStringToAddressA';<br>function WSAStringToAddressW; external ws2_32 name 'WSAStringToAddressW';<br>function WSAStringToAddress; external ws2_32 name 'WSAStringToAddress' + AWSuffix;<br>function WSALookupServiceBeginA; external ws2_32 name 'WSALookupServiceBeginA';<br>function WSALookupServiceBeginW; external ws2_32 name 'WSALookupServiceBeginW';<br>function WSALookupServiceBegin; external ws2_32 name 'WSALookupServiceBegin' + AWSuffix;<br>function WSALookupServiceNextA; external ws2_32 name 'WSALookupServiceNextA';<br>function WSALookupServiceNextW; external ws2_32 name 'WSALookupServiceNextW';<br>function WSALookupServiceNext; external ws2_32 name 'WSALookupServiceNext' + AWSuffix;<br>function WSANSPIoctl; external ws2_32 name 'WSANSPIoctl';<br>function WSALookupServiceEnd; external ws2_32 name 'WSALookupServiceEnd';<br>function WSAInstallServiceClassA; external ws2_32 name 'WSAInstallServiceClassA';<br>function WSAInstallServiceClassW; external ws2_32 name 'WSAInstallServiceClassW';<br>function WSAInstallServiceClass; external ws2_32 name 'WSAInstallServiceClass' + AWSuffix;<br>function WSARemoveServiceClass; external ws2_32 name 'WSARemoveServiceClass';<br>function WSAGetServiceClassInfoA; external ws2_32 name 'WSAGetServiceClassInfoA';<br>function WSAGetServiceClassInfoW; external ws2_32 name 'WSAGetServiceClassInfoW';<br>function WSAGetServiceClassInfo; external ws2_32 name 'WSAGetServiceClassInfo' + AWSuffix;<br>function WSAEnumNameSpaceProvidersA; external ws2_32 name 'WSAEnumNameSpaceProvidersA';<br>function WSAEnumNameSpaceProvidersW; external ws2_32 name 'WSAEnumNameSpaceProvidersW';<br>function WSAEnumNameSpaceProviders; external ws2_32 name 'WSAEnumNameSpaceProviders' + AWSuffix;<br>function WSAGetServiceClassNameByClassIdA; external ws2_32 name 'WSAGetServiceClassNameByClassIdA';<br>function WSAGetServiceClassNameByClassIdW; external ws2_32 name 'WSAGetServiceClassNameByClassIdW';<br>function WSAGetServiceClassNameByClassId; external ws2_32 name 'WSAGetServiceClassNameByClassId' + AWSuffix;<br>function WSASetServiceA; external ws2_32 name 'WSASetServiceA';<br>function WSASetServiceW; external ws2_32 name 'WSASetServiceW';<br>function WSASetService; external ws2_32 name 'WSASetService' + AWSuffix;<br>function WSAProviderConfigChange; external ws2_32 name 'WSAProviderConfigChange';<br><br>{$ENDIF DYNAMIC_LINK}<br><br>end.