📄 adwutil.pas
字号:
EConnAborted = wsaEConnAborted;
EConnReset = wsaEConnReset;
ENoBufs = wsaENoBufs;
EIsConn = wsaEIsConn;
ENotConn = wsaENotConn;
EShutDown = wsaEShutDown;
ETooManyRefs = wsaETooManyRefs;
ETimedOut = wsaETimedOut;
EConnRefused = wsaEConnRefused;
ELoop = wsaELoop;
ENameTooLong = wsaENameTooLong;
EHostDown = wsaEHostDown;
EHostUnreach = wsaEHostUnreach;
ENotEmpty = wsaENotEmpty;
EProcLim = wsaEProcLim;
EUsers = wsaEUsers;
EDQuot = wsaEDQuot;
EStale = wsaEStale;
ERemote = wsaERemote;
type
PFDSet = ^TFDSet;
TFDSet = packed record
fd_count : Integer;
fd_array : array[0..Pred(Fd_SETSIZE)] of TSocket;
end;
PTimeVal = ^TTimeVal;
TTimeVal = packed record
tv_sec : LongInt;
tv_usec : LongInt;
end;
const
MaxAddrs = 256;
MaxAlias = 256;
type
{ moved to OOMisc to prevent type conflicts } {!!.06}
{SunB = packed record
s_b1, s_b2, s_b3, s_b4 : AnsiChar;
end;
SunW = packed record
s_w1, s_w2 : Word;
end;
PInaddr = ^TInaddr;
TInaddr = packed record
case Integer of
0 : (S_un_b : SunB);
1 : (S_un_w : SunW);
2 : (S_addr : LongInt);
end;}
PAddrArray = ^TAddrArray;
TAddrArray = array[0..MaxAddrs-1] of PInAddr;
PAliasArray = ^TAliasArray;
TAliasArray = array[0..MaxAlias-1] of PAnsiChar;
{ Host Entity }
PHostEnt = ^THostEnt;
THostEnt = packed record
h_name : PAnsiChar; { Official name of host }
h_aliases : PAliasArray; { Alias list }
h_addrtype : SmallInt; { Host address type }
h_length : SmallInt; { Length of address }
h_addr_list : PAddrArray; { List of addresses }
end;
{ Network Entity }
PNetEnt = ^TNetEnt;
TNetEnt = packed record
n_name : PAnsiChar;
n_aliases : ^PAnsiChar;
n_addrtype : SmallInt;
n_net : LongInt;
end;
{ Server Entity }
PServEnt = ^TServEnt;
TServEnt = packed record
s_name : PAnsiChar;
s_aliases : ^PAnsiChar;
s_port : SmallInt;
s_proto : PAnsiChar;
end;
{ Protocol Entity }
PProtoEnt = ^TProtoEnt;
TProtoEnt = packed record
p_name : PAnsiChar;
p_aliases : ^PAnsiChar;
p_proto : SmallInt;
end;
PSockAddrIn = ^TSockAddrIn;
TSockAddrIn = packed record
case Integer of
0: (sin_family : Word;
sin_port : Word;
sin_addr : TInAddr;
sin_zero : array[0..7] of AnsiChar);
1: (sa_family : Word;
sa_data : array[0..13] of AnsiChar)
end;
PwsaData = ^TwsaData;
TwsaData = packed record
wVersion : Word;
wHighVersion : Word;
szDescription : array[0..wsaDESCRIPTION_Len] of AnsiChar;
szSystemStatus : array[0..wsaSYS_STATUS_Len] of AnsiChar;
iMaxSockets : Word;
iMaxUdpDg : Word;
lpVendorInfo : PAnsiChar;
end;
{$IFDEF Win32}
PTransmitFileBuffers = ^TTransmitFileBuffers;
TTransmitFileBuffers = packed record
Head : Pointer;
HeadLength : DWORD;
Tail : Pointer;
TailLength : DWORD;
end;
{$ENDIF}
{ Structure used by kernel to store most addresses. }
PSockAddr = ^TSockAddr;
TSockAddr = TSockAddrIn;
{ Structure used by kernel to pass protocol information in raw sockets. }
PSockProto = ^TSockProto;
TSockProto = packed record
sp_family : Word;
sp_protocol : Word;
end;
{ Structure used for manipulating linger option. }
PLinger = ^TLinger;
TLinger = packed record
l_onoff : Word;
l_linger : Word;
end;
{ Winsock data record }
PWsDataRec = ^TWsDataRec;
TWsDataRec = record
WsSockAddr : TSockAddrIn;
WsHostAddr : TSockAddrIn;
WsIsClient : Boolean;
WsIsTelnet : Boolean;
end;
{ Socket function types }
TfnAccept = function(S : TSocket;
var Addr : TSockAddr;
var Addrlen : Integer) : TSocket;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnBind = function(S : TSocket;
var Addr : TSockAddr;
NameLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnCloseSocket = function(S : TSocket) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnConnect = function(S : TSocket;
var Name : TSockAddr;
NameLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnIOCtlSocket = function(S : TSocket;
Cmd : LongInt;
var Arg : LongInt) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetPeerName = function(S : TSocket;
var Name : TSockAddr;
var NameLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetSockName = function(S : TSocket;
var Name : TSockAddr;
var NameLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetSockOpt = function(S : TSocket;
Level, OptName : Integer;
var OptVal; var OptLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
Tfnhtonl = function(HostLong : LongInt) : LongInt;
{$IFDEF Win32} stdcall; {$ENDIF}
Tfnhtons = function(HostShort : Word) : Word;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnINet_Addr = function(Cp : PAnsiChar) : LongInt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnINet_NtoA = function(InAddr : TInAddr) : PAnsiChar;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnListen = function(S : TSocket; Backlog : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
Tfnntohl = function(NetLong : LongInt) : LongInt;
{$IFDEF Win32} stdcall; {$ENDIF}
Tfnntohs = function(NetShort : Word) : Word;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnRecv = function(S : TSocket; var Buf;
Len, Flags : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnRecvFrom = function(S : TSocket; var Buf;
Len, Flags : Integer;
var From : TSockAddr;
var FromLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnSelect = function(Nfds : Integer;
Readfds, Writefds,
Exceptfds : PFDSet;
Timeout : PTimeVal) : LongInt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnSend = function(S : TSocket; var Buf;
Len, Flags : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnSendTo = function(S : TSocket; var Buf;
Len, Flags : Integer;
var AddrTo : TSockAddr;
ToLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnSetSockOpt = function(S : TSocket;
Level, OptName : Integer;
var OptVal; OptLen : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnShutdown = function(S : TSocket; How : Integer) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnSocket = function(Af, Struct, Protocol : Integer) : TSocket;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetHostByAddr = function(var Addr; Len, Struct : Integer): PHostEnt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetHostByName = function(Name : PAnsiChar) : PHostEnt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetHostName = function(Name : PAnsiChar;
Len : Integer): Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetServByPort = function(Port : Word; Proto : PAnsiChar) : PServEnt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetServByName = function(Name, Proto : PAnsiChar) : PServEnt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetProtoByNumber = function(Proto : Integer) : PProtoEnt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnGetProtoByName = function(Name : PAnsiChar) : PProtoEnt;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaStartup = function(wVersionRequired : Word;
var WSData : TwsaData) : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaCleanup = function : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaSetLastError = procedure(iError : Integer);
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaGetLastError = function : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaIsBlocking = function : BOOL;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaUnhookBlockingHook = function : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaSetBlockingHook = function(lpBlockFunc : TFarProc) : TFarProc;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaCancelBlockingCall = function : Integer;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaAsyncGetServByName = function(HWindow : HWnd; wMsg : Integer;
Name, Proto, Buf : PAnsiChar;
BufLen : Integer) : THandle;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaAsyncGetServByPort = function(HWindow : HWnd;
wMsg, Port : Integer;
Proto, Buf : PAnsiChar;
BufLen : Integer) : THandle;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaAsyncGetProtoByName = function(HWindow : HWnd;
wMsg : Integer;
Name, Buf : PAnsiChar;
BufLen : Integer) : THandle;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaAsyncGetProtoByNumber = function(HWindow : HWnd;
wMsg : Integer;
Number : Integer;
Buf : PAnsiChar;
BufLen : Integer) : THandle;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaAsyncGetHostByName = function(HWindow : HWnd;
wMsg : Integer;
Name, Buf : PAnsiChar;
BufLen : Integer) : THandle;
{$IFDEF Win32} stdcall; {$ENDIF}
TfnwsaAsyncGetHostByAddr = function(HWindow : HWnd;
wMsg : Integer;
Addr : PAnsiChar;
Len, Struct : Integer;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -