找JwaWinsock2.pas急??? ( 积分: 50 )

  • 主题发起人 主题发起人 fl_xyg
  • 开始时间 开始时间
F

fl_xyg

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