JwaWinsock2.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:139k
源码类别:
Windows编程
开发平台:
Delphi
- {$EXTERNALSYM WSAGetQOSByName}
- function WSAHtonl(s: TSocket; hostlong: u_long; var lpnetlong: u_long): Integer; stdcall;
- {$EXTERNALSYM WSAHtonl}
- function WSAHtons(s: TSocket; hostshort: u_short; var lpnetshort: u_short): Integer; stdcall;
- {$EXTERNALSYM WSAHtons}
- function WSAIoctl(s: TSocket; dwIoControlCode: DWORD; lpvInBuffer: LPVOID; cbInBuffer: DWORD;
- lpvOutBuffer: LPVOID; cbOutBuffer: DWORD; var lpcbBytesReturned: DWORD;
- lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;
- {$EXTERNALSYM WSAIoctl}
- function WSAJoinLeaf(s: TSocket; name: PSockAddr; namelen: Integer; lpCallerData: LPWSABUF;
- lpCalleeData: LPWSABUF; lpSQOS, lpGQOS: LPQOS; dwFlags: DWORD): TSocket; stdcall;
- {$EXTERNALSYM WSAJoinLeaf}
- function WSANtohl(s: TSocket; netlong: u_long; var lphostlong: u_long): Integer; stdcall;
- {$EXTERNALSYM WSANtohl}
- function WSANtohs(s: TSocket; netshort: u_short; var lphostshort: u_short): Integer; stdcall;
- {$EXTERNALSYM WSANtohs}
- function WSARecv(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;
- var lpNumberOfBytesRecvd, lpFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED;
- lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;
- {$EXTERNALSYM WSARecv}
- function WSARecvDisconnect(s: TSocket; lpInboundDisconnectData: LPWSABUF): Integer; stdcall;
- {$EXTERNALSYM WSARecvDisconnect}
- function WSARecvFrom(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;
- var lpNumberOfBytesRecvd, lpFlags: DWORD; lpFrom: PSockAddr; lpFromlen: PINT;
- lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;
- {$EXTERNALSYM WSARecvFrom}
- function WSAResetEvent(hEvent: WSAEVENT): BOOL; stdcall;
- {$EXTERNALSYM WSAResetEvent}
- function WSASend(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;
- var lpNumberOfBytesSent: DWORD; dwFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED;
- lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;
- {$EXTERNALSYM WSASend}
- function WSASendDisconnect(s: TSocket; lpOutboundDisconnectData: LPWSABUF): Integer; stdcall;
- {$EXTERNALSYM WSASendDisconnect}
- function WSASendTo(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD;
- var lpNumberOfBytesSent: DWORD; dwFlags: DWORD; lpTo: PSockAddr; iTolen: Integer;
- lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;
- {$EXTERNALSYM WSASendTo}
- function WSASetEvent(hEvent: WSAEVENT): BOOL; stdcall;
- {$EXTERNALSYM WSASetEvent}
- function WSASocketA(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFOA;
- g: GROUP; dwFlags: DWORD): TSocket; stdcall;
- {$EXTERNALSYM WSASocketA}
- function WSASocketW(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFOW;
- g: GROUP; dwFlags: DWORD): TSocket; stdcall;
- {$EXTERNALSYM WSASocketW}
- {$IFDEF UNICODE}
- function WSASocket(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFOW;
- g: GROUP; dwFlags: DWORD): TSocket; stdcall;
- {$EXTERNALSYM WSASocket}
- {$ELSE}
- function WSASocket(af, type_, protocol: Integer; lpProtocolInfo: LPWSAPROTOCOL_INFOA;
- g: GROUP; dwFlags: DWORD): TSocket; stdcall;
- {$EXTERNALSYM WSASocket}
- {$ENDIF}
- function WSAWaitForMultipleEvents(cEvents: DWORD; lphEvents: PWSAEVENT;
- fWaitAll: BOOL; dwTimeout: DWORD; fAlertable: BOOL): DWORD; stdcall;
- {$EXTERNALSYM WSAWaitForMultipleEvents}
- function WSAAddressToStringA(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;
- lpProtocolInfo: LPWSAPROTOCOL_INFOA; lpszAddressString: LPSTR;
- var lpdwAddressStringLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAAddressToStringA}
- function WSAAddressToStringW(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;
- lpProtocolInfo: LPWSAPROTOCOL_INFOW; lpszAddressString: LPWSTR;
- var lpdwAddressStringLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAAddressToStringW}
- {$IFDEF UNICODE}
- function WSAAddressToString(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;
- lpProtocolInfo: LPWSAPROTOCOL_INFOW; lpszAddressString: LPWSTR;
- var lpdwAddressStringLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAAddressToString}
- {$ELSE}
- function WSAAddressToString(lpsaAddress: LPSOCKADDR; dwAddressLength: DWORD;
- lpProtocolInfo: LPWSAPROTOCOL_INFOA; lpszAddressString: LPSTR;
- var lpdwAddressStringLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAAddressToString}
- {$ENDIF}
- function WSAStringToAddressA(AddressString: LPSTR; AddressFamily: Integer;
- lpProtocolInfo: LPWSAPROTOCOL_INFOA; lpAddress: LPSOCKADDR;
- var lpAddressLength: Integer): Integer; stdcall;
- {$EXTERNALSYM WSAStringToAddressA}
- function WSAStringToAddressW(AddressString: LPWSTR; AddressFamily: Integer;
- lpProtocolInfo: LPWSAPROTOCOL_INFOW; lpAddress: LPSOCKADDR;
- var lpAddressLength: Integer): Integer; stdcall;
- {$EXTERNALSYM WSAStringToAddressW}
- {$IFDEF UNICODE}
- function WSAStringToAddress(AddressString: LPWSTR; AddressFamily: Integer;
- lpProtocolInfo: LPWSAPROTOCOL_INFOW; lpAddress: LPSOCKADDR;
- var lpAddressLength: Integer): Integer; stdcall;
- {$EXTERNALSYM WSAStringToAddress}
- {$ELSE}
- function WSAStringToAddress(AddressString: LPSTR; AddressFamily: Integer;
- lpProtocolInfo: LPWSAPROTOCOL_INFOA; lpAddress: LPSOCKADDR;
- var lpAddressLength: Integer): Integer; stdcall;
- {$EXTERNALSYM WSAStringToAddress}
- {$ENDIF}
- // Registration and Name Resolution API functions
- function WSALookupServiceBeginA(lpqsRestrictions: LPWSAQUERYSETA;
- dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceBeginA}
- function WSALookupServiceBeginW(lpqsRestrictions: LPWSAQUERYSETW;
- dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceBeginW}
- {$IFDEF UNICODE}
- function WSALookupServiceBegin(lpqsRestrictions: LPWSAQUERYSETW;
- dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceBegin}
- {$ELSE}
- function WSALookupServiceBegin(lpqsRestrictions: LPWSAQUERYSETA;
- dwControlFlags: DWORD; var lphLookup: HANDLE): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceBegin}
- {$ENDIF}
- function WSALookupServiceNextA(hLookup: HANDLE; dwControlFlags: DWORD;
- var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSETA): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceNextA}
- function WSALookupServiceNextW(hLookup: HANDLE; dwControlFlags: DWORD;
- var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSETW): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceNextW}
- {$IFDEF UNICODE}
- function WSALookupServiceNext(hLookup: HANDLE; dwControlFlags: DWORD;
- var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSETW): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceNext}
- {$ELSE}
- function WSALookupServiceNext(hLookup: HANDLE; dwControlFlags: DWORD;
- var lpdwBufferLength: DWORD; lpqsResults: LPWSAQUERYSETA): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceNext}
- {$ENDIF}
- function WSANSPIoctl(hLookup: HANDLE; dwControlCode: DWORD; lpvInBuffer: LPVOID; cbInBuffer: DWORD;
- lpvOutBuffer: LPVOID; cbOutBuffer: DWORD; lpcbBytesReturned: LPDWORD; lpCompletion: LPWSACOMPLETION): Integer; stdcall;
- {$EXTERNALSYM WSANSPIoctl}
- function WSALookupServiceEnd(hLookup: HANDLE): Integer; stdcall;
- {$EXTERNALSYM WSALookupServiceEnd}
- function WSAInstallServiceClassA(lpServiceClassInfo: LPWSASERVICECLASSINFOA): Integer; stdcall;
- {$EXTERNALSYM WSAInstallServiceClassA}
- function WSAInstallServiceClassW(lpServiceClassInfo: LPWSASERVICECLASSINFOW): Integer; stdcall;
- {$EXTERNALSYM WSAInstallServiceClassW}
- {$IFDEF UNICODE}
- function WSAInstallServiceClass(lpServiceClassInfo: LPWSASERVICECLASSINFOW): Integer; stdcall;
- {$EXTERNALSYM WSAInstallServiceClass}
- {$ELSE}
- function WSAInstallServiceClass(lpServiceClassInfo: LPWSASERVICECLASSINFOA): Integer; stdcall;
- {$EXTERNALSYM WSAInstallServiceClass}
- {$ENDIF}
- function WSARemoveServiceClass(const lpServiceClassId: TGUID): Integer; stdcall;
- {$EXTERNALSYM WSARemoveServiceClass}
- function WSAGetServiceClassInfoA(const lpProviderId, lpServiceClassId: TGUID;
- var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFOA): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassInfoA}
- function WSAGetServiceClassInfoW(const lpProviderId, lpServiceClassId: TGUID;
- var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFOW): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassInfoW}
- {$IFDEF UNICODE}
- function WSAGetServiceClassInfo(const lpProviderId, lpServiceClassId: TGUID;
- var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFOW): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassInfo}
- {$ELSE}
- function WSAGetServiceClassInfo(const lpProviderId, lpServiceClassId: TGUID;
- var lpdwBufSize: DWORD; lpServiceClassInfo: LPWSASERVICECLASSINFOA): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassInfo}
- {$ENDIF}
- function WSAEnumNameSpaceProvidersA(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFOA): Integer; stdcall;
- {$EXTERNALSYM WSAEnumNameSpaceProvidersA}
- function WSAEnumNameSpaceProvidersW(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFOW): Integer; stdcall;
- {$EXTERNALSYM WSAEnumNameSpaceProvidersW}
- {$IFDEF UNICODE}
- function WSAEnumNameSpaceProviders(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFOW): Integer; stdcall;
- {$EXTERNALSYM WSAEnumNameSpaceProviders}
- {$ELSE}
- function WSAEnumNameSpaceProviders(var lpdwBufferLength: DWORD; lpnspBuffer: LPWSANAMESPACE_INFOA): Integer; stdcall;
- {$EXTERNALSYM WSAEnumNameSpaceProviders}
- {$ENDIF}
- function WSAGetServiceClassNameByClassIdA(const lpServiceClassId: TGUID;
- lpszServiceClassName: LPSTR; var lpdwBufferLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassNameByClassIdA}
- function WSAGetServiceClassNameByClassIdW(const lpServiceClassId: TGUID;
- lpszServiceClassName: LPWSTR; var lpdwBufferLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassNameByClassIdW}
- {$IFDEF UNICODE}
- function WSAGetServiceClassNameByClassId(const lpServiceClassId: TGUID;
- lpszServiceClassName: LPWSTR; var lpdwBufferLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassNameByClassId}
- {$ELSE}
- function WSAGetServiceClassNameByClassId(const lpServiceClassId: TGUID;
- lpszServiceClassName: LPSTR; var lpdwBufferLength: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSAGetServiceClassNameByClassId}
- {$ENDIF}
- function WSASetServiceA(lpqsRegInfo: LPWSAQUERYSETA; essoperation: WSAESETSERVICEOP;
- dwControlFlags: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSASetServiceA}
- function WSASetServiceW(lpqsRegInfo: LPWSAQUERYSETW; essoperation: WSAESETSERVICEOP;
- dwControlFlags: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSASetServiceW}
- {$IFDEF UNICODE}
- function WSASetService(lpqsRegInfo: LPWSAQUERYSETW; essoperation: WSAESETSERVICEOP;
- dwControlFlags: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSASetService}
- {$ELSE}
- function WSASetService(lpqsRegInfo: LPWSAQUERYSETA; essoperation: WSAESETSERVICEOP;
- dwControlFlags: DWORD): Integer; stdcall;
- {$EXTERNALSYM WSASetService}
- {$ENDIF}
- function WSAProviderConfigChange(var lpNotificationHandle: HANDLE;
- lpOverlapped: LPWSAOVERLAPPED; lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE): Integer; stdcall;
- {$EXTERNALSYM WSAProviderConfigChange}
- // Microsoft Windows Extended data types
- type
- PSOCKADDR_IN = ^sockaddr_in;
- {$EXTERNALSYM PSOCKADDR_IN}
- LPSOCKADDR_IN = ^sockaddr_in;
- {$EXTERNALSYM LPSOCKADDR_IN}
- LPLINGER = PLINGER;
- {$EXTERNALSYM LPLINGER}
- PIN_ADDR = ^in_addr;
- {$EXTERNALSYM PIN_ADDR}
- LPIN_ADDR = ^in_addr;
- {$EXTERNALSYM LPIN_ADDR}
- PFD_SET = ^fd_set;
- {$EXTERNALSYM PFD_SET}
- LPFD_SET = ^fd_set;
- {$EXTERNALSYM LPFD_SET}
- LPHOSTENT = PHOSTENT;
- {$EXTERNALSYM LPHOSTENT}
- LPSERVENT = PSERVENT;
- {$EXTERNALSYM LPSERVENT}
- LPPROTOENT = PPROTOENT;
- {$EXTERNALSYM LPPROTOENT}
- LPTIMEVAL = PTIMEVAL;
- {$EXTERNALSYM LPTIMEVAL}
- //
- // Windows message parameter composition and decomposition
- // macros.
- //
- // WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation
- // when constructing the response to a WSAAsyncGetXByY() routine.
- //
- function WSAMAKEASYNCREPLY(buflen, error: WORD): DWORD;
- {$EXTERNALSYM WSAMAKEASYNCREPLY}
- //
- // WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation
- // when constructing the response to WSAAsyncSelect().
- //
- function WSAMAKESELECTREPLY(event, error: WORD): DWORD;
- {$EXTERNALSYM WSAMAKESELECTREPLY}
- //
- // WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application
- // to extract the buffer length from the lParam in the response
- // to a WSAAsyncGetXByY().
- //
- function WSAGETASYNCBUFLEN(lParam: DWORD): WORD;
- {$EXTERNALSYM WSAGETASYNCBUFLEN}
- //
- // WSAGETASYNCERROR is intended for use by the Windows Sockets application
- // to extract the error code from the lParam in the response
- // to a WSAGetXByY().
- //
- function WSAGETASYNCERROR(lParam: DWORD): WORD;
- {$EXTERNALSYM WSAGETASYNCERROR}
- //
- // WSAGETSELECTEVENT is intended for use by the Windows Sockets application
- // to extract the event code from the lParam in the response
- // to a WSAAsyncSelect().
- //
- function WSAGETSELECTEVENT(lParam: DWORD): WORD;
- {$EXTERNALSYM WSAGETSELECTEVENT}
- //
- // WSAGETSELECTERROR is intended for use by the Windows Sockets application
- // to extract the error code from the lParam in the response
- // to a WSAAsyncSelect().
- //
- function WSAGETSELECTERROR(lParam: DWORD): WORD;
- {$EXTERNALSYM WSAGETSELECTERROR}
- implementation
- const
- ws2_32 = 'ws2_32.dll';
- {$IFDEF DYNAMIC_LINK}
- var
- ___WSAFDIsSet: Pointer;
- function __WSAFDIsSet;
- begin
- GetProcedureAddress(___WSAFDIsSet, ws2_32, '__WSAFDIsSet');
- asm
- mov esp, ebp
- pop ebp
- jmp [___WSAFDIsSet]
- end;
- end;
- {$ELSE}
- function __WSAFDIsSet; external ws2_32 name '__WSAFDIsSet';
- {$ENDIF DYNAMIC_LINK}
- procedure FD_CLR(fd: TSocket; var fdset: TFdSet);
- var
- I: Cardinal;
- begin
- I := 0;
- while I < fdset.fd_count do
- begin
- if fdset.fd_array[I] = fd then
- begin
- while I < fdset.fd_count - 1 do
- begin
- fdset.fd_array[I] := fdset.fd_array[I + 1];
- Inc(I);
- end;
- fdset.fd_count := fdset.fd_count - 1;
- Break;
- end;
- Inc(I);
- end;
- end;
- procedure _FD_SET(fd: TSocket; var fdset: TFDSet);
- var
- I: Cardinal;
- begin
- I := 0;
- while I < fdset.fd_count do
- begin
- if fdset.fd_array[I] = fd then Break;
- Inc(I);
- end;
- if I = fdset.fd_count then
- begin
- if fdset.fd_count < FD_SETSIZE then
- begin
- fdset.fd_array[I] := fd;
- fdset.fd_count := fdset.fd_count + 1;
- end;
- end;
- end;
- procedure FD_ZERO(var fdset: TFdSet);
- begin
- fdset.fd_count := 0;
- end;
- function FD_ISSET(fd: TSocket; var fdset: TFdSet): Boolean;
- begin
- Result := __WSAFDIsSet(fd, fdset) <> 0;
- end;
- function timerisset(const tvp: TTimeVal): Boolean;
- begin
- Result := (tvp.tv_sec <> 0) or (tvp.tv_usec <> 0);
- end;
- procedure timerclear(var tvp: TTimeVal);
- begin
- tvp.tv_sec := 0;
- tvp.tv_usec := 0;
- end;
- function _IO(x, y: DWORD): DWORD;
- begin
- Result := IOC_VOID or (x shl 8) or y;
- end;
- function _IOR(x, y, t: DWORD): DWORD;
- begin
- Result := IOC_OUT or ((T and IOCPARM_MASK) shl 16) or (x shl 8) or y;
- end;
- function _IOW(x, y, t: DWORD): DWORD;
- begin
- Result := DWORD(IOC_IN or ((T and IOCPARM_MASK) shl 16) or (x shl 8) or y);
- end;
- function IN_CLASSA(i: DWORD): Boolean;
- begin
- Result := i and DWORD($80000000) = 0;
- end;
- function IN_CLASSB(i: DWORD): Boolean;
- begin
- Result := i and DWORD($C0000000) = DWORD($80000000);
- end;
- function IN_CLASSC(i: DWORD): Boolean;
- begin
- Result := (i and DWORD($e0000000)) = DWORD($C0000000);
- end;
- function IN_CLASSD(i: DWORD): Boolean;
- begin
- Result := (i and DWORD($f0000000)) = DWORD($e0000000);
- end;
- function IN_MULTICAST(i: DWORD): Boolean;
- begin
- Result := IN_CLASSD(i);
- end;
- function h_errno: Integer;
- begin
- Result := WSAGetLastError;
- end;
- function _WSAIO(x, y: DWORD): DWORD;
- begin
- Result := IOC_VOID or x or y;
- end;
- function _WSAIOR(x, y: DWORD): DWORD;
- begin
- Result := IOC_OUT or x or y;
- end;
- function _WSAIOW(x, y: DWORD): DWORD;
- begin
- Result := IOC_IN or x or y;
- end;
- function _WSAIORW(x, y: DWORD): DWORD;
- begin
- Result := IOC_INOUT or x or y;
- end;
- {$IFDEF DYNAMIC_LINK}
- var
- _accept: Pointer;
- function accept;
- begin
- GetProcedureAddress(_accept, ws2_32, 'accept');
- asm
- mov esp, ebp
- pop ebp
- jmp [_accept]
- end;
- end;
- {$ELSE}
- function accept; external ws2_32 name 'accept';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _bind: Pointer;
- function bind;
- begin
- GetProcedureAddress(_bind, ws2_32, 'bind');
- asm
- mov esp, ebp
- pop ebp
- jmp [_bind]
- end;
- end;
- {$ELSE}
- function bind; external ws2_32 name 'bind';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _closesocket: Pointer;
- function closesocket;
- begin
- GetProcedureAddress(_closesocket, ws2_32, 'closesocket');
- asm
- mov esp, ebp
- pop ebp
- jmp [_closesocket]
- end;
- end;
- {$ELSE}
- function closesocket; external ws2_32 name 'closesocket';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _connect: Pointer;
- function connect;
- begin
- GetProcedureAddress(_connect, ws2_32, 'connect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_connect]
- end;
- end;
- {$ELSE}
- function connect; external ws2_32 name 'connect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _ioctlsocket: Pointer;
- function ioctlsocket;
- begin
- GetProcedureAddress(_ioctlsocket, ws2_32, 'ioctlsocket');
- asm
- mov esp, ebp
- pop ebp
- jmp [_ioctlsocket]
- end;
- end;
- {$ELSE}
- function ioctlsocket; external ws2_32 name 'ioctlsocket';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getpeername: Pointer;
- function getpeername;
- begin
- GetProcedureAddress(_getpeername, ws2_32, 'getpeername');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getpeername]
- end;
- end;
- {$ELSE}
- function getpeername; external ws2_32 name 'getpeername';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getsockname: Pointer;
- function getsockname;
- begin
- GetProcedureAddress(_getsockname, ws2_32, 'getsockname');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getsockname]
- end;
- end;
- {$ELSE}
- function getsockname; external ws2_32 name 'getsockname';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getsockopt: Pointer;
- function getsockopt;
- begin
- GetProcedureAddress(_getsockopt, ws2_32, 'getsockopt');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getsockopt]
- end;
- end;
- {$ELSE}
- function getsockopt; external ws2_32 name 'getsockopt';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _htonl: Pointer;
- function htonl;
- begin
- GetProcedureAddress(_htonl, ws2_32, 'htonl');
- asm
- mov esp, ebp
- pop ebp
- jmp [_htonl]
- end;
- end;
- {$ELSE}
- function htonl; external ws2_32 name 'htonl';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _htons: Pointer;
- function htons;
- begin
- GetProcedureAddress(_htons, ws2_32, 'htons');
- asm
- mov esp, ebp
- pop ebp
- jmp [_htons]
- end;
- end;
- {$ELSE}
- function htons; external ws2_32 name 'htons';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _inet_addr: Pointer;
- function inet_addr;
- begin
- GetProcedureAddress(_inet_addr, ws2_32, 'inet_addr');
- asm
- mov esp, ebp
- pop ebp
- jmp [_inet_addr]
- end;
- end;
- {$ELSE}
- function inet_addr; external ws2_32 name 'inet_addr';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _inet_ntoa: Pointer;
- function inet_ntoa;
- begin
- GetProcedureAddress(_inet_ntoa, ws2_32, 'inet_ntoa');
- asm
- mov esp, ebp
- pop ebp
- jmp [_inet_ntoa]
- end;
- end;
- {$ELSE}
- function inet_ntoa; external ws2_32 name 'inet_ntoa';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _listen: Pointer;
- function listen;
- begin
- GetProcedureAddress(_listen, ws2_32, 'listen');
- asm
- mov esp, ebp
- pop ebp
- jmp [_listen]
- end;
- end;
- {$ELSE}
- function listen; external ws2_32 name 'listen';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _ntohl: Pointer;
- function ntohl;
- begin
- GetProcedureAddress(_ntohl, ws2_32, 'ntohl');
- asm
- mov esp, ebp
- pop ebp
- jmp [_ntohl]
- end;
- end;
- {$ELSE}
- function ntohl; external ws2_32 name 'ntohl';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _ntohs: Pointer;
- function ntohs;
- begin
- GetProcedureAddress(_ntohs, ws2_32, 'ntohs');
- asm
- mov esp, ebp
- pop ebp
- jmp [_ntohs]
- end;
- end;
- {$ELSE}
- function ntohs; external ws2_32 name 'ntohs';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _recv: Pointer;
- function recv;
- begin
- GetProcedureAddress(_recv, ws2_32, 'recv');
- asm
- mov esp, ebp
- pop ebp
- jmp [_recv]
- end;
- end;
- {$ELSE}
- function recv; external ws2_32 name 'recv';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _recvfrom: Pointer;
- function recvfrom;
- begin
- GetProcedureAddress(_recvfrom, ws2_32, 'recvfrom');
- asm
- mov esp, ebp
- pop ebp
- jmp [_recvfrom]
- end;
- end;
- {$ELSE}
- function recvfrom; external ws2_32 name 'recvfrom';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _select: Pointer;
- function select;
- begin
- GetProcedureAddress(_select, ws2_32, 'select');
- asm
- mov esp, ebp
- pop ebp
- jmp [_select]
- end;
- end;
- {$ELSE}
- function select; external ws2_32 name 'select';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _send: Pointer;
- function send;
- begin
- GetProcedureAddress(_send, ws2_32, 'send');
- asm
- mov esp, ebp
- pop ebp
- jmp [_send]
- end;
- end;
- {$ELSE}
- function send; external ws2_32 name 'send';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _sendto: Pointer;
- function sendto;
- begin
- GetProcedureAddress(_sendto, ws2_32, 'sendto');
- asm
- mov esp, ebp
- pop ebp
- jmp [_sendto]
- end;
- end;
- {$ELSE}
- function sendto; external ws2_32 name 'sendto';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _setsockopt: Pointer;
- function setsockopt;
- begin
- GetProcedureAddress(_setsockopt, ws2_32, 'setsockopt');
- asm
- mov esp, ebp
- pop ebp
- jmp [_setsockopt]
- end;
- end;
- {$ELSE}
- function setsockopt; external ws2_32 name 'setsockopt';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _shutdown: Pointer;
- function shutdown;
- begin
- GetProcedureAddress(_shutdown, ws2_32, 'shutdown');
- asm
- mov esp, ebp
- pop ebp
- jmp [_shutdown]
- end;
- end;
- {$ELSE}
- function shutdown; external ws2_32 name 'shutdown';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _socket: Pointer;
- function socket;
- begin
- GetProcedureAddress(_socket, ws2_32, 'socket');
- asm
- mov esp, ebp
- pop ebp
- jmp [_socket]
- end;
- end;
- {$ELSE}
- function socket; external ws2_32 name 'socket';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _gethostbyaddr: Pointer;
- function gethostbyaddr;
- begin
- GetProcedureAddress(_gethostbyaddr, ws2_32, 'gethostbyaddr');
- asm
- mov esp, ebp
- pop ebp
- jmp [_gethostbyaddr]
- end;
- end;
- {$ELSE}
- function gethostbyaddr; external ws2_32 name 'gethostbyaddr';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _gethostbyname: Pointer;
- function gethostbyname;
- begin
- GetProcedureAddress(_gethostbyname, ws2_32, 'gethostbyname');
- asm
- mov esp, ebp
- pop ebp
- jmp [_gethostbyname]
- end;
- end;
- {$ELSE}
- function gethostbyname; external ws2_32 name 'gethostbyname';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _gethostname: Pointer;
- function gethostname;
- begin
- GetProcedureAddress(_gethostname, ws2_32, 'gethostname');
- asm
- mov esp, ebp
- pop ebp
- jmp [_gethostname]
- end;
- end;
- {$ELSE}
- function gethostname; external ws2_32 name 'gethostname';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getservbyport: Pointer;
- function getservbyport;
- begin
- GetProcedureAddress(_getservbyport, ws2_32, 'getservbyport');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getservbyport]
- end;
- end;
- {$ELSE}
- function getservbyport; external ws2_32 name 'getservbyport';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getservbyname: Pointer;
- function getservbyname;
- begin
- GetProcedureAddress(_getservbyname, ws2_32, 'getservbyname');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getservbyname]
- end;
- end;
- {$ELSE}
- function getservbyname; external ws2_32 name 'getservbyname';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getprotobynumber: Pointer;
- function getprotobynumber;
- begin
- GetProcedureAddress(_getprotobynumber, ws2_32, 'getprotobynumber');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getprotobynumber]
- end;
- end;
- {$ELSE}
- function getprotobynumber; external ws2_32 name 'getprotobynumber';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _getprotobyname: Pointer;
- function getprotobyname;
- begin
- GetProcedureAddress(_getprotobyname, ws2_32, 'getprotobyname');
- asm
- mov esp, ebp
- pop ebp
- jmp [_getprotobyname]
- end;
- end;
- {$ELSE}
- function getprotobyname; external ws2_32 name 'getprotobyname';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAStartup: Pointer;
- function WSAStartup;
- begin
- GetProcedureAddress(_WSAStartup, ws2_32, 'WSAStartup');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAStartup]
- end;
- end;
- {$ELSE}
- function WSAStartup; external ws2_32 name 'WSAStartup';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSACleanup: Pointer;
- function WSACleanup;
- begin
- GetProcedureAddress(_WSACleanup, ws2_32, 'WSACleanup');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSACleanup]
- end;
- end;
- {$ELSE}
- function WSACleanup; external ws2_32 name 'WSACleanup';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetLastError: Pointer;
- procedure WSASetLastError;
- begin
- GetProcedureAddress(_WSASetLastError, ws2_32, 'WSASetLastError');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetLastError]
- end;
- end;
- {$ELSE}
- procedure WSASetLastError; external ws2_32 name 'WSASetLastError';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetLastError: Pointer;
- function WSAGetLastError;
- begin
- GetProcedureAddress(_WSAGetLastError, ws2_32, 'WSAGetLastError');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetLastError]
- end;
- end;
- {$ELSE}
- function WSAGetLastError; external ws2_32 name 'WSAGetLastError';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAIsBlocking: Pointer;
- function WSAIsBlocking;
- begin
- GetProcedureAddress(_WSAIsBlocking, ws2_32, 'WSAIsBlocking');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAIsBlocking]
- end;
- end;
- {$ELSE}
- function WSAIsBlocking; external ws2_32 name 'WSAIsBlocking';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAUnhookBlockingHook: Pointer;
- function WSAUnhookBlockingHook;
- begin
- GetProcedureAddress(_WSAUnhookBlockingHook, ws2_32, 'WSAUnhookBlockingHook');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAUnhookBlockingHook]
- end;
- end;
- {$ELSE}
- function WSAUnhookBlockingHook; external ws2_32 name 'WSAUnhookBlockingHook';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetBlockingHook: Pointer;
- function WSASetBlockingHook;
- begin
- GetProcedureAddress(_WSASetBlockingHook, ws2_32, 'WSASetBlockingHook');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetBlockingHook]
- end;
- end;
- {$ELSE}
- function WSASetBlockingHook; external ws2_32 name 'WSASetBlockingHook';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSACancelBlockingCall: Pointer;
- function WSACancelBlockingCall;
- begin
- GetProcedureAddress(_WSACancelBlockingCall, ws2_32, 'WSACancelBlockingCall');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSACancelBlockingCall]
- end;
- end;
- {$ELSE}
- function WSACancelBlockingCall; external ws2_32 name 'WSACancelBlockingCall';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncGetServByName: Pointer;
- function WSAAsyncGetServByName;
- begin
- GetProcedureAddress(_WSAAsyncGetServByName, ws2_32, 'WSAAsyncGetServByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncGetServByName]
- end;
- end;
- {$ELSE}
- function WSAAsyncGetServByName; external ws2_32 name 'WSAAsyncGetServByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncGetServByPort: Pointer;
- function WSAAsyncGetServByPort;
- begin
- GetProcedureAddress(_WSAAsyncGetServByPort, ws2_32, 'WSAAsyncGetServByPort');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncGetServByPort]
- end;
- end;
- {$ELSE}
- function WSAAsyncGetServByPort; external ws2_32 name 'WSAAsyncGetServByPort';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncGetProtoByName: Pointer;
- function WSAAsyncGetProtoByName;
- begin
- GetProcedureAddress(_WSAAsyncGetProtoByName, ws2_32, 'WSAAsyncGetProtoByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncGetProtoByName]
- end;
- end;
- {$ELSE}
- function WSAAsyncGetProtoByName; external ws2_32 name 'WSAAsyncGetProtoByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncGetProtoByNumber: Pointer;
- function WSAAsyncGetProtoByNumber;
- begin
- GetProcedureAddress(_WSAAsyncGetProtoByNumber, ws2_32, 'WSAAsyncGetProtoByNumber');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncGetProtoByNumber]
- end;
- end;
- {$ELSE}
- function WSAAsyncGetProtoByNumber; external ws2_32 name 'WSAAsyncGetProtoByNumber';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncGetHostByName: Pointer;
- function WSAAsyncGetHostByName;
- begin
- GetProcedureAddress(_WSAAsyncGetHostByName, ws2_32, 'WSAAsyncGetHostByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncGetHostByName]
- end;
- end;
- {$ELSE}
- function WSAAsyncGetHostByName; external ws2_32 name 'WSAAsyncGetHostByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncGetHostByAddr: Pointer;
- function WSAAsyncGetHostByAddr;
- begin
- GetProcedureAddress(_WSAAsyncGetHostByAddr, ws2_32, 'WSAAsyncGetHostByAddr');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncGetHostByAddr]
- end;
- end;
- {$ELSE}
- function WSAAsyncGetHostByAddr; external ws2_32 name 'WSAAsyncGetHostByAddr';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSACancelAsyncRequest: Pointer;
- function WSACancelAsyncRequest;
- begin
- GetProcedureAddress(_WSACancelAsyncRequest, ws2_32, 'WSACancelAsyncRequest');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSACancelAsyncRequest]
- end;
- end;
- {$ELSE}
- function WSACancelAsyncRequest; external ws2_32 name 'WSACancelAsyncRequest';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAsyncSelect: Pointer;
- function WSAAsyncSelect;
- begin
- GetProcedureAddress(_WSAAsyncSelect, ws2_32, 'WSAAsyncSelect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAsyncSelect]
- end;
- end;
- {$ELSE}
- function WSAAsyncSelect; external ws2_32 name 'WSAAsyncSelect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAccept: Pointer;
- function WSAAccept;
- begin
- GetProcedureAddress(_WSAAccept, ws2_32, 'WSAAccept');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAccept]
- end;
- end;
- {$ELSE}
- function WSAAccept; external ws2_32 name 'WSAAccept';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSACloseEvent: Pointer;
- function WSACloseEvent;
- begin
- GetProcedureAddress(_WSACloseEvent, ws2_32, 'WSACloseEvent');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSACloseEvent]
- end;
- end;
- {$ELSE}
- function WSACloseEvent; external ws2_32 name 'WSACloseEvent';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAConnect: Pointer;
- function WSAConnect;
- begin
- GetProcedureAddress(_WSAConnect, ws2_32, 'WSAConnect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAConnect]
- end;
- end;
- {$ELSE}
- function WSAConnect; external ws2_32 name 'WSAConnect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSACreateEvent: Pointer;
- function WSACreateEvent;
- begin
- GetProcedureAddress(_WSACreateEvent, ws2_32, 'WSACreateEvent');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSACreateEvent]
- end;
- end;
- {$ELSE}
- function WSACreateEvent; external ws2_32 name 'WSACreateEvent';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSADuplicateSocketA: Pointer;
- function WSADuplicateSocketA;
- begin
- GetProcedureAddress(_WSADuplicateSocketA, ws2_32, 'WSADuplicateSocketA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSADuplicateSocketA]
- end;
- end;
- {$ELSE}
- function WSADuplicateSocketA; external ws2_32 name 'WSADuplicateSocketA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSADuplicateSocketW: Pointer;
- function WSADuplicateSocketW;
- begin
- GetProcedureAddress(_WSADuplicateSocketW, ws2_32, 'WSADuplicateSocketW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSADuplicateSocketW]
- end;
- end;
- {$ELSE}
- function WSADuplicateSocketW; external ws2_32 name 'WSADuplicateSocketW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSADuplicateSocket: Pointer;
- function WSADuplicateSocket;
- begin
- GetProcedureAddress(_WSADuplicateSocket, ws2_32, 'WSADuplicateSocketW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSADuplicateSocket]
- end;
- end;
- {$ELSE}
- function WSADuplicateSocket; external ws2_32 name 'WSADuplicateSocketW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSADuplicateSocket: Pointer;
- function WSADuplicateSocket;
- begin
- GetProcedureAddress(_WSADuplicateSocket, ws2_32, 'WSADuplicateSocketA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSADuplicateSocket]
- end;
- end;
- {$ELSE}
- function WSADuplicateSocket; external ws2_32 name 'WSADuplicateSocketA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumNetworkEvents: Pointer;
- function WSAEnumNetworkEvents;
- begin
- GetProcedureAddress(_WSAEnumNetworkEvents, ws2_32, 'WSAEnumNetworkEvents');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumNetworkEvents]
- end;
- end;
- {$ELSE}
- function WSAEnumNetworkEvents; external ws2_32 name 'WSAEnumNetworkEvents';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumProtocolsA: Pointer;
- function WSAEnumProtocolsA;
- begin
- GetProcedureAddress(_WSAEnumProtocolsA, ws2_32, 'WSAEnumProtocolsA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumProtocolsA]
- end;
- end;
- {$ELSE}
- function WSAEnumProtocolsA; external ws2_32 name 'WSAEnumProtocolsA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumProtocolsW: Pointer;
- function WSAEnumProtocolsW;
- begin
- GetProcedureAddress(_WSAEnumProtocolsW, ws2_32, 'WSAEnumProtocolsW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumProtocolsW]
- end;
- end;
- {$ELSE}
- function WSAEnumProtocolsW; external ws2_32 name 'WSAEnumProtocolsW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumProtocols: Pointer;
- function WSAEnumProtocols;
- begin
- GetProcedureAddress(_WSAEnumProtocols, ws2_32, 'WSAEnumProtocolsW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumProtocols]
- end;
- end;
- {$ELSE}
- function WSAEnumProtocols; external ws2_32 name 'WSAEnumProtocolsW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumProtocols: Pointer;
- function WSAEnumProtocols;
- begin
- GetProcedureAddress(_WSAEnumProtocols, ws2_32, 'WSAEnumProtocolsA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumProtocols]
- end;
- end;
- {$ELSE}
- function WSAEnumProtocols; external ws2_32 name 'WSAEnumProtocolsA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEventSelect: Pointer;
- function WSAEventSelect;
- begin
- GetProcedureAddress(_WSAEventSelect, ws2_32, 'WSAEventSelect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEventSelect]
- end;
- end;
- {$ELSE}
- function WSAEventSelect; external ws2_32 name 'WSAEventSelect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetOverlappedResult: Pointer;
- function WSAGetOverlappedResult;
- begin
- GetProcedureAddress(_WSAGetOverlappedResult, ws2_32, 'WSAGetOverlappedResult');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetOverlappedResult]
- end;
- end;
- {$ELSE}
- function WSAGetOverlappedResult; external ws2_32 name 'WSAGetOverlappedResult';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetQOSByName: Pointer;
- function WSAGetQOSByName;
- begin
- GetProcedureAddress(_WSAGetQOSByName, ws2_32, 'WSAGetQOSByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetQOSByName]
- end;
- end;
- {$ELSE}
- function WSAGetQOSByName; external ws2_32 name 'WSAGetQOSByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAHtonl: Pointer;
- function WSAHtonl;
- begin
- GetProcedureAddress(_WSAHtonl, ws2_32, 'WSAHtonl');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAHtonl]
- end;
- end;
- {$ELSE}
- function WSAHtonl; external ws2_32 name 'WSAHtonl';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAHtons: Pointer;
- function WSAHtons;
- begin
- GetProcedureAddress(_WSAHtons, ws2_32, 'WSAHtons');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAHtons]
- end;
- end;
- {$ELSE}
- function WSAHtons; external ws2_32 name 'WSAHtons';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAIoctl: Pointer;
- function WSAIoctl;
- begin
- GetProcedureAddress(_WSAIoctl, ws2_32, 'WSAIoctl');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAIoctl]
- end;
- end;
- {$ELSE}
- function WSAIoctl; external ws2_32 name 'WSAIoctl';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAJoinLeaf: Pointer;
- function WSAJoinLeaf;
- begin
- GetProcedureAddress(_WSAJoinLeaf, ws2_32, 'WSAJoinLeaf');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAJoinLeaf]
- end;
- end;
- {$ELSE}
- function WSAJoinLeaf; external ws2_32 name 'WSAJoinLeaf';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSANtohl: Pointer;
- function WSANtohl;
- begin
- GetProcedureAddress(_WSANtohl, ws2_32, 'WSANtohl');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSANtohl]
- end;
- end;
- {$ELSE}
- function WSANtohl; external ws2_32 name 'WSANtohl';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSANtohs: Pointer;
- function WSANtohs;
- begin
- GetProcedureAddress(_WSANtohs, ws2_32, 'WSANtohs');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSANtohs]
- end;
- end;
- {$ELSE}
- function WSANtohs; external ws2_32 name 'WSANtohs';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSARecv: Pointer;
- function WSARecv;
- begin
- GetProcedureAddress(_WSARecv, ws2_32, 'WSARecv');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSARecv]
- end;
- end;
- {$ELSE}
- function WSARecv; external ws2_32 name 'WSARecv';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSARecvDisconnect: Pointer;
- function WSARecvDisconnect;
- begin
- GetProcedureAddress(_WSARecvDisconnect, ws2_32, 'WSARecvDisconnect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSARecvDisconnect]
- end;
- end;
- {$ELSE}
- function WSARecvDisconnect; external ws2_32 name 'WSARecvDisconnect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSARecvFrom: Pointer;
- function WSARecvFrom;
- begin
- GetProcedureAddress(_WSARecvFrom, ws2_32, 'WSARecvFrom');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSARecvFrom]
- end;
- end;
- {$ELSE}
- function WSARecvFrom; external ws2_32 name 'WSARecvFrom';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAResetEvent: Pointer;
- function WSAResetEvent;
- begin
- GetProcedureAddress(_WSAResetEvent, ws2_32, 'WSAResetEvent');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAResetEvent]
- end;
- end;
- {$ELSE}
- function WSAResetEvent; external ws2_32 name 'WSAResetEvent';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASend: Pointer;
- function WSASend;
- begin
- GetProcedureAddress(_WSASend, ws2_32, 'WSASend');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASend]
- end;
- end;
- {$ELSE}
- function WSASend; external ws2_32 name 'WSASend';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASendDisconnect: Pointer;
- function WSASendDisconnect;
- begin
- GetProcedureAddress(_WSASendDisconnect, ws2_32, 'WSASendDisconnect');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASendDisconnect]
- end;
- end;
- {$ELSE}
- function WSASendDisconnect; external ws2_32 name 'WSASendDisconnect';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASendTo: Pointer;
- function WSASendTo;
- begin
- GetProcedureAddress(_WSASendTo, ws2_32, 'WSASendTo');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASendTo]
- end;
- end;
- {$ELSE}
- function WSASendTo; external ws2_32 name 'WSASendTo';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetEvent: Pointer;
- function WSASetEvent;
- begin
- GetProcedureAddress(_WSASetEvent, ws2_32, 'WSASetEvent');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetEvent]
- end;
- end;
- {$ELSE}
- function WSASetEvent; external ws2_32 name 'WSASetEvent';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASocketA: Pointer;
- function WSASocketA;
- begin
- GetProcedureAddress(_WSASocketA, ws2_32, 'WSASocketA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASocketA]
- end;
- end;
- {$ELSE}
- function WSASocketA; external ws2_32 name 'WSASocketA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASocketW: Pointer;
- function WSASocketW;
- begin
- GetProcedureAddress(_WSASocketW, ws2_32, 'WSASocketW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASocketW]
- end;
- end;
- {$ELSE}
- function WSASocketW; external ws2_32 name 'WSASocketW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASocket: Pointer;
- function WSASocket;
- begin
- GetProcedureAddress(_WSASocket, ws2_32, 'WSASocketW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASocket]
- end;
- end;
- {$ELSE}
- function WSASocket; external ws2_32 name 'WSASocketW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASocket: Pointer;
- function WSASocket;
- begin
- GetProcedureAddress(_WSASocket, ws2_32, 'WSASocketA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASocket]
- end;
- end;
- {$ELSE}
- function WSASocket; external ws2_32 name 'WSASocketA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAWaitForMultipleEvents: Pointer;
- function WSAWaitForMultipleEvents;
- begin
- GetProcedureAddress(_WSAWaitForMultipleEvents, ws2_32, 'WSAWaitForMultipleEvents');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAWaitForMultipleEvents]
- end;
- end;
- {$ELSE}
- function WSAWaitForMultipleEvents; external ws2_32 name 'WSAWaitForMultipleEvents';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAddressToStringA: Pointer;
- function WSAAddressToStringA;
- begin
- GetProcedureAddress(_WSAAddressToStringA, ws2_32, 'WSAAddressToStringA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAddressToStringA]
- end;
- end;
- {$ELSE}
- function WSAAddressToStringA; external ws2_32 name 'WSAAddressToStringA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAddressToStringW: Pointer;
- function WSAAddressToStringW;
- begin
- GetProcedureAddress(_WSAAddressToStringW, ws2_32, 'WSAAddressToStringW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAddressToStringW]
- end;
- end;
- {$ELSE}
- function WSAAddressToStringW; external ws2_32 name 'WSAAddressToStringW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAddressToString: Pointer;
- function WSAAddressToString;
- begin
- GetProcedureAddress(_WSAAddressToString, ws2_32, 'WSAAddressToStringW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAddressToString]
- end;
- end;
- {$ELSE}
- function WSAAddressToString; external ws2_32 name 'WSAAddressToStringW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAAddressToString: Pointer;
- function WSAAddressToString;
- begin
- GetProcedureAddress(_WSAAddressToString, ws2_32, 'WSAAddressToStringA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAAddressToString]
- end;
- end;
- {$ELSE}
- function WSAAddressToString; external ws2_32 name 'WSAAddressToStringA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAStringToAddressA: Pointer;
- function WSAStringToAddressA;
- begin
- GetProcedureAddress(_WSAStringToAddressA, ws2_32, 'WSAStringToAddressA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAStringToAddressA]
- end;
- end;
- {$ELSE}
- function WSAStringToAddressA; external ws2_32 name 'WSAStringToAddressA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAStringToAddressW: Pointer;
- function WSAStringToAddressW;
- begin
- GetProcedureAddress(_WSAStringToAddressW, ws2_32, 'WSAStringToAddressW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAStringToAddressW]
- end;
- end;
- {$ELSE}
- function WSAStringToAddressW; external ws2_32 name 'WSAStringToAddressW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAStringToAddress: Pointer;
- function WSAStringToAddress;
- begin
- GetProcedureAddress(_WSAStringToAddress, ws2_32, 'WSAStringToAddressW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAStringToAddress]
- end;
- end;
- {$ELSE}
- function WSAStringToAddress; external ws2_32 name 'WSAStringToAddressW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAStringToAddress: Pointer;
- function WSAStringToAddress;
- begin
- GetProcedureAddress(_WSAStringToAddress, ws2_32, 'WSAStringToAddressA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAStringToAddress]
- end;
- end;
- {$ELSE}
- function WSAStringToAddress; external ws2_32 name 'WSAStringToAddressA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceBeginA: Pointer;
- function WSALookupServiceBeginA;
- begin
- GetProcedureAddress(_WSALookupServiceBeginA, ws2_32, 'WSALookupServiceBeginA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceBeginA]
- end;
- end;
- {$ELSE}
- function WSALookupServiceBeginA; external ws2_32 name 'WSALookupServiceBeginA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceBeginW: Pointer;
- function WSALookupServiceBeginW;
- begin
- GetProcedureAddress(_WSALookupServiceBeginW, ws2_32, 'WSALookupServiceBeginW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceBeginW]
- end;
- end;
- {$ELSE}
- function WSALookupServiceBeginW; external ws2_32 name 'WSALookupServiceBeginW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceBegin: Pointer;
- function WSALookupServiceBegin;
- begin
- GetProcedureAddress(_WSALookupServiceBegin, ws2_32, 'WSALookupServiceBeginW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceBegin]
- end;
- end;
- {$ELSE}
- function WSALookupServiceBegin; external ws2_32 name 'WSALookupServiceBeginW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceBegin: Pointer;
- function WSALookupServiceBegin;
- begin
- GetProcedureAddress(_WSALookupServiceBegin, ws2_32, 'WSALookupServiceBeginA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceBegin]
- end;
- end;
- {$ELSE}
- function WSALookupServiceBegin; external ws2_32 name 'WSALookupServiceBeginA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceNextA: Pointer;
- function WSALookupServiceNextA;
- begin
- GetProcedureAddress(_WSALookupServiceNextA, ws2_32, 'WSALookupServiceNextA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceNextA]
- end;
- end;
- {$ELSE}
- function WSALookupServiceNextA; external ws2_32 name 'WSALookupServiceNextA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceNextW: Pointer;
- function WSALookupServiceNextW;
- begin
- GetProcedureAddress(_WSALookupServiceNextW, ws2_32, 'WSALookupServiceNextW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceNextW]
- end;
- end;
- {$ELSE}
- function WSALookupServiceNextW; external ws2_32 name 'WSALookupServiceNextW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceNext: Pointer;
- function WSALookupServiceNext;
- begin
- GetProcedureAddress(_WSALookupServiceNext, ws2_32, 'WSALookupServiceNextW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceNext]
- end;
- end;
- {$ELSE}
- function WSALookupServiceNext; external ws2_32 name 'WSALookupServiceNextW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceNext: Pointer;
- function WSALookupServiceNext;
- begin
- GetProcedureAddress(_WSALookupServiceNext, ws2_32, 'WSALookupServiceNextA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceNext]
- end;
- end;
- {$ELSE}
- function WSALookupServiceNext; external ws2_32 name 'WSALookupServiceNextA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSANSPIoctl: Pointer;
- function WSANSPIoctl;
- begin
- GetProcedureAddress(_WSANSPIoctl, ws2_32, 'WSANSPIoctl');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSANSPIoctl]
- end;
- end;
- {$ELSE}
- function WSANSPIoctl; external ws2_32 name 'WSANSPIoctl';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSALookupServiceEnd: Pointer;
- function WSALookupServiceEnd;
- begin
- GetProcedureAddress(_WSALookupServiceEnd, ws2_32, 'WSALookupServiceEnd');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSALookupServiceEnd]
- end;
- end;
- {$ELSE}
- function WSALookupServiceEnd; external ws2_32 name 'WSALookupServiceEnd';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAInstallServiceClassA: Pointer;
- function WSAInstallServiceClassA;
- begin
- GetProcedureAddress(_WSAInstallServiceClassA, ws2_32, 'WSAInstallServiceClassA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAInstallServiceClassA]
- end;
- end;
- {$ELSE}
- function WSAInstallServiceClassA; external ws2_32 name 'WSAInstallServiceClassA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAInstallServiceClassW: Pointer;
- function WSAInstallServiceClassW;
- begin
- GetProcedureAddress(_WSAInstallServiceClassW, ws2_32, 'WSAInstallServiceClassW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAInstallServiceClassW]
- end;
- end;
- {$ELSE}
- function WSAInstallServiceClassW; external ws2_32 name 'WSAInstallServiceClassW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAInstallServiceClass: Pointer;
- function WSAInstallServiceClass;
- begin
- GetProcedureAddress(_WSAInstallServiceClass, ws2_32, 'WSAInstallServiceClassW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAInstallServiceClass]
- end;
- end;
- {$ELSE}
- function WSAInstallServiceClass; external ws2_32 name 'WSAInstallServiceClassW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAInstallServiceClass: Pointer;
- function WSAInstallServiceClass;
- begin
- GetProcedureAddress(_WSAInstallServiceClass, ws2_32, 'WSAInstallServiceClassA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAInstallServiceClass]
- end;
- end;
- {$ELSE}
- function WSAInstallServiceClass; external ws2_32 name 'WSAInstallServiceClassA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSARemoveServiceClass: Pointer;
- function WSARemoveServiceClass;
- begin
- GetProcedureAddress(_WSARemoveServiceClass, ws2_32, 'WSARemoveServiceClass');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSARemoveServiceClass]
- end;
- end;
- {$ELSE}
- function WSARemoveServiceClass; external ws2_32 name 'WSARemoveServiceClass';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServiceClassInfoA: Pointer;
- function WSAGetServiceClassInfoA;
- begin
- GetProcedureAddress(_WSAGetServiceClassInfoA, ws2_32, 'WSAGetServiceClassInfoA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServiceClassInfoA]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassInfoA; external ws2_32 name 'WSAGetServiceClassInfoA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServiceClassInfoW: Pointer;
- function WSAGetServiceClassInfoW;
- begin
- GetProcedureAddress(_WSAGetServiceClassInfoW, ws2_32, 'WSAGetServiceClassInfoW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServiceClassInfoW]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassInfoW; external ws2_32 name 'WSAGetServiceClassInfoW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServiceClassInfo: Pointer;
- function WSAGetServiceClassInfo;
- begin
- GetProcedureAddress(_WSAGetServiceClassInfo, ws2_32, 'WSAGetServiceClassInfoW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServiceClassInfo]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassInfo; external ws2_32 name 'WSAGetServiceClassInfoW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServiceClassInfo: Pointer;
- function WSAGetServiceClassInfo;
- begin
- GetProcedureAddress(_WSAGetServiceClassInfo, ws2_32, 'WSAGetServiceClassInfoA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServiceClassInfo]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassInfo; external ws2_32 name 'WSAGetServiceClassInfoA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumNameSpaceProvidersA: Pointer;
- function WSAEnumNameSpaceProvidersA;
- begin
- GetProcedureAddress(_WSAEnumNameSpaceProvidersA, ws2_32, 'WSAEnumNameSpaceProvidersA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumNameSpaceProvidersA]
- end;
- end;
- {$ELSE}
- function WSAEnumNameSpaceProvidersA; external ws2_32 name 'WSAEnumNameSpaceProvidersA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumNameSpaceProvidersW: Pointer;
- function WSAEnumNameSpaceProvidersW;
- begin
- GetProcedureAddress(_WSAEnumNameSpaceProvidersW, ws2_32, 'WSAEnumNameSpaceProvidersW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumNameSpaceProvidersW]
- end;
- end;
- {$ELSE}
- function WSAEnumNameSpaceProvidersW; external ws2_32 name 'WSAEnumNameSpaceProvidersW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumNameSpaceProviders: Pointer;
- function WSAEnumNameSpaceProviders;
- begin
- GetProcedureAddress(_WSAEnumNameSpaceProviders, ws2_32, 'WSAEnumNameSpaceProvidersW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumNameSpaceProviders]
- end;
- end;
- {$ELSE}
- function WSAEnumNameSpaceProviders; external ws2_32 name 'WSAEnumNameSpaceProvidersW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAEnumNameSpaceProviders: Pointer;
- function WSAEnumNameSpaceProviders;
- begin
- GetProcedureAddress(_WSAEnumNameSpaceProviders, ws2_32, 'WSAEnumNameSpaceProvidersA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAEnumNameSpaceProviders]
- end;
- end;
- {$ELSE}
- function WSAEnumNameSpaceProviders; external ws2_32 name 'WSAEnumNameSpaceProvidersA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServClassNameByClassIdA: Pointer;
- function WSAGetServiceClassNameByClassIdA;
- begin
- GetProcedureAddress(_WSAGetServClassNameByClassIdA, ws2_32, 'WSAGetServiceClassNameByClassIdA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServClassNameByClassIdA]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassNameByClassIdA; external ws2_32 name 'WSAGetServiceClassNameByClassIdA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServClassNameByClassIdW: Pointer;
- function WSAGetServiceClassNameByClassIdW;
- begin
- GetProcedureAddress(_WSAGetServClassNameByClassIdW, ws2_32, 'WSAGetServiceClassNameByClassIdW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServClassNameByClassIdW]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassNameByClassIdW; external ws2_32 name 'WSAGetServiceClassNameByClassIdW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServClassNameByClassId: Pointer;
- function WSAGetServiceClassNameByClassId;
- begin
- GetProcedureAddress(_WSAGetServClassNameByClassId, ws2_32, 'WSAGetServiceClassNameByClassIdW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServClassNameByClassId]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassNameByClassId; external ws2_32 name 'WSAGetServiceClassNameByClassIdW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAGetServClassNameByClassId: Pointer;
- function WSAGetServiceClassNameByClassId;
- begin
- GetProcedureAddress(_WSAGetServClassNameByClassId, ws2_32, 'WSAGetServiceClassNameByClassIdA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAGetServClassNameByClassId]
- end;
- end;
- {$ELSE}
- function WSAGetServiceClassNameByClassId; external ws2_32 name 'WSAGetServiceClassNameByClassIdA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetServiceA: Pointer;
- function WSASetServiceA;
- begin
- GetProcedureAddress(_WSASetServiceA, ws2_32, 'WSASetServiceA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetServiceA]
- end;
- end;
- {$ELSE}
- function WSASetServiceA; external ws2_32 name 'WSASetServiceA';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetServiceW: Pointer;
- function WSASetServiceW;
- begin
- GetProcedureAddress(_WSASetServiceW, ws2_32, 'WSASetServiceW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetServiceW]
- end;
- end;
- {$ELSE}
- function WSASetServiceW; external ws2_32 name 'WSASetServiceW';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF UNICODE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetService: Pointer;
- function WSASetService;
- begin
- GetProcedureAddress(_WSASetService, ws2_32, 'WSASetServiceW');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetService]
- end;
- end;
- {$ELSE}
- function WSASetService; external ws2_32 name 'WSASetServiceW';
- {$ENDIF DYNAMIC_LINK}
- {$ELSE}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSASetService: Pointer;
- function WSASetService;
- begin
- GetProcedureAddress(_WSASetService, ws2_32, 'WSASetServiceA');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSASetService]
- end;
- end;
- {$ELSE}
- function WSASetService; external ws2_32 name 'WSASetServiceA';
- {$ENDIF DYNAMIC_LINK}
- {$ENDIF}
- {$IFDEF DYNAMIC_LINK}
- var
- _WSAProviderConfigChange: Pointer;
- function WSAProviderConfigChange;
- begin
- GetProcedureAddress(_WSAProviderConfigChange, ws2_32, 'WSAProviderConfigChange');
- asm
- mov esp, ebp
- pop ebp
- jmp [_WSAProviderConfigChange]
- end;
- end;
- {$ELSE}
- function WSAProviderConfigChange; external ws2_32 name 'WSAProviderConfigChange';
- {$ENDIF DYNAMIC_LINK}
- function WSAMAKEASYNCREPLY(buflen, error: WORD): DWORD;
- begin
- Result := MAKELONG(buflen, error);
- end;
- function WSAMAKESELECTREPLY(event, error: WORD): DWORD;
- begin
- Result := MAKELONG(event, error);
- end;
- function WSAGETASYNCBUFLEN(lParam: DWORD): WORD;
- begin
- Result := LOWORD(lParam);
- end;
- function WSAGETASYNCERROR(lParam: DWORD): WORD;
- begin
- Result := HIWORD(lParam);
- end;
- function WSAGETSELECTEVENT(lParam: DWORD): WORD;
- begin
- Result := LOWORD(lParam);
- end;
- function WSAGETSELECTERROR(lParam: DWORD): WORD;
- begin
- Result := HIWORD(lParam);
- end;
- end.