123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185 |
- {******************************************************************************}
- { }
- { Internet Protocol Helper API interface Unit for Object Pascal }
- { }
- { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
- { Corporation. All Rights Reserved. }
- { }
- { The original file is: iphlpapi.h, released August 2000. The original Pascal }
- { code is: IpHlpApi.pas, released September 2000. The initial developer of the }
- { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
- { }
- { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
- { Marcel van Brakel. All Rights Reserved. }
- { }
- { Contributor(s): John C. Penman (jcp att craiglockhart dott com) }
- { Vladimir Vassiliev (voldemarv att hotpop dott com) }
- { }
- { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
- { }
- { You may retrieve the latest version of this file at the Project JEDI }
- { APILIB home page, located at http://jedi-apilib.sourceforge.net }
- { }
- { The contents of this file are used with permission, subject to the Mozilla }
- { Public License Version 1.1 (the "License"); you may not use this file except }
- { in compliance with the License. You may obtain a copy of the License at }
- { http://www.mozilla.org/MPL/MPL-1.1.html }
- { }
- { Software distributed under the License is distributed on an "AS IS" basis, }
- { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
- { the specific language governing rights and limitations under the License. }
- { }
- { Alternatively, the contents of this file may be used under the terms of the }
- { GNU Lesser General Public License (the "LGPL License"), in which case the }
- { provisions of the LGPL License are applicable instead of those above. }
- { If you wish to allow use of your version of this file only under the terms }
- { of the LGPL License and not to allow others to use your version of this file }
- { under the MPL, indicate your decision by deleting the provisions above and }
- { replace them with the notice and other provisions required by the LGPL }
- { License. If you do not delete the provisions above, a recipient may use }
- { your version of this file under either the MPL or the LGPL License. }
- { }
- { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
- { }
- {******************************************************************************}
- // $Id: JwaIpHlpApi.pas,v 1.9 2005/09/06 16:36:50 marquardt Exp $
- unit JwaIpHlpApi;
- {$WEAKPACKAGEUNIT}
- {$I jediapilib.inc}
- interface
- uses
- JwaIpExport, JwaIpRtrMib, JwaIpTypes, JwaWindows;
- {$HPPEMIT ''}
- {$HPPEMIT '#include "iphlpapi.h"'}
- {$HPPEMIT ''}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // IPRTRMIB.H has the definitions of the strcutures used to set and get //
- // information //
- // //
- //////////////////////////////////////////////////////////////////////////////
- // #include <iprtrmib.h>
- // #include <ipexport.h>
- // #include <iptypes.h>
- //////////////////////////////////////////////////////////////////////////////
- // //
- // The GetXXXTable APIs take a buffer and a size of buffer. If the buffer //
- // is not large enough, the APIs return ERROR_INSUFFICIENT_BUFFER and //
- // *pdwSize is the required buffer size //
- // The bOrder is a BOOLEAN, which if TRUE sorts the table according to //
- // MIB-II (RFC XXXX) //
- // //
- //////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Retrieves the number of interfaces in the system. These include LAN and //
- // WAN interfaces //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetNumberOfInterfaces(var pdwNumIf: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetNumberOfInterfaces}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the MIB-II ifEntry //
- // The dwIndex field of the MIB_IFROW should be set to the index of the //
- // interface being queried //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetIfEntry(pIfRow: PMIB_IFROW): DWORD; stdcall;
- {$EXTERNALSYM GetIfEntry}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the MIB-II IfTable //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetIfTable(pIfTable: PMIB_IFTABLE; var pdwSize: ULONG; bOrder: BOOL): DWORD; stdcall;
- {$EXTERNALSYM GetIfTable}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the Interface to IP Address mapping //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetIpAddrTable(pIpAddrTable: PMIB_IPADDRTABLE; var pdwSize: ULONG; bOrder: BOOL): DWORD; stdcall;
- {$EXTERNALSYM GetIpAddrTable}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the current IP Address to Physical Address (ARP) mapping //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetIpNetTable(pIpNetTable: PMIB_IPNETTABLE; var pdwSize: ULONG; bOrder: BOOL): DWORD; stdcall;
- {$EXTERNALSYM GetIpNetTable}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the IP Routing Table (RFX XXXX) //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetIpForwardTable(pIpForwardTable: PMIB_IPFORWARDTABLE; var pdwSize: ULONG;
- bOrder: BOOL): DWORD; stdcall;
- {$EXTERNALSYM GetIpForwardTable}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets TCP Connection/UDP Listener Table //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetTcpTable(pTcpTable: PMIB_TCPTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD; stdcall;
- {$EXTERNALSYM GetTcpTable}
- function GetUdpTable(pUdpTable: PMIB_UDPTABLE; var pdwSize: DWORD; bOrder: BOOL): DWORD; stdcall;
- {$EXTERNALSYM GetUdpTable}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets IP/ICMP/TCP/UDP Statistics //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetIpStatistics(var pStats: MIB_IPSTATS): DWORD; stdcall;
- {$EXTERNALSYM GetIpStatistics}
- function GetIpStatisticsEx(pStats: PMIB_IPSTATS; dwFamily: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetIpStatisticsEx}
- function GetIcmpStatistics(var pStats: MIB_ICMP): DWORD; stdcall;
- {$EXTERNALSYM GetIcmpStatistics}
- function GetIcmpStatisticsEx(pStats: PMIB_ICMP_EX; dwFamily: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetIcmpStatisticsEx}
- function GetTcpStatistics(var pStats: MIB_TCPSTATS): DWORD; stdcall;
- {$EXTERNALSYM GetTcpStatistics}
- function GetTcpStatisticsEx(pStats: PMIB_TCPSTATS; dwFamily: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetTcpStatisticsEx}
- function GetUdpStatistics(var pStats: MIB_UDPSTATS): DWORD; stdcall;
- {$EXTERNALSYM GetUdpStatistics}
- function GetUdpStatisticsEx(pStats: PMIB_UDPSTATS; dwFamily: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetUdpStatisticsEx}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to set the ifAdminStatus on an interface. The only fields of the //
- // MIB_IFROW that are relevant are the dwIndex (index of the interface //
- // whose status needs to be set) and the dwAdminStatus which can be either //
- // MIB_IF_ADMIN_STATUS_UP or MIB_IF_ADMIN_STATUS_DOWN //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function SetIfEntry(const pIfRow: MIB_IFROW): DWORD; stdcall;
- {$EXTERNALSYM SetIfEntry}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to create, modify or delete a route. In all cases the //
- // dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop and //
- // dwForwardPolicy MUST BE SPECIFIED. Currently dwForwardPolicy is unused //
- // and MUST BE 0. //
- // For a set, the complete MIB_IPFORWARDROW structure must be specified //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function CreateIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
- {$EXTERNALSYM CreateIpForwardEntry}
- function SetIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
- {$EXTERNALSYM SetIpForwardEntry}
- function DeleteIpForwardEntry(const pRoute: MIB_IPFORWARDROW): DWORD; stdcall;
- {$EXTERNALSYM DeleteIpForwardEntry}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to set the ipForwarding to ON or OFF (currently only ON->OFF is //
- // allowed) and to set the defaultTTL. If only one of the fields needs to //
- // be modified and the other needs to be the same as before the other field //
- // needs to be set to MIB_USE_CURRENT_TTL or MIB_USE_CURRENT_FORWARDING as //
- // the case may be //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function SetIpStatistics(const pIpStats: MIB_IPSTATS): DWORD; stdcall;
- {$EXTERNALSYM SetIpStatistics}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to set the defaultTTL. //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function SetIpTTL(nTTL: UINT): DWORD; stdcall;
- {$EXTERNALSYM SetIpTTL}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to create, modify or delete an ARP entry. In all cases the dwIndex //
- // dwAddr field MUST BE SPECIFIED. //
- // For a set, the complete MIB_IPNETROW structure must be specified //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function CreateIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
- {$EXTERNALSYM CreateIpNetEntry}
- function SetIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
- {$EXTERNALSYM SetIpNetEntry}
- function DeleteIpNetEntry(const pArpEntry: MIB_IPNETROW): DWORD; stdcall;
- {$EXTERNALSYM DeleteIpNetEntry}
- function FlushIpNetTable(dwIfIndex: DWORD): DWORD; stdcall;
- {$EXTERNALSYM FlushIpNetTable}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to create or delete a Proxy ARP entry. The dwIndex is the index of //
- // the interface on which to PARP for the dwAddress. If the interface is //
- // of a type that doesnt support ARP, e.g. PPP, then the call will fail //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function CreateProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD; stdcall;
- {$EXTERNALSYM CreateProxyArpEntry}
- function DeleteProxyArpEntry(dwAddress, dwMask, dwIfIndex: DWORD): DWORD; stdcall;
- {$EXTERNALSYM DeleteProxyArpEntry}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Used to set the state of a TCP Connection. The only state that it can be //
- // set to is MIB_TCP_STATE_DELETE_TCB. The complete MIB_TCPROW structure //
- // MUST BE SPECIFIED //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function SetTcpEntry(const pTcpRow: MIB_TCPROW): DWORD; stdcall;
- {$EXTERNALSYM SetTcpEntry}
- function GetInterfaceInfo(pIfTable: PIP_INTERFACE_INFO; var dwOutBufLen: ULONG): DWORD; stdcall;
- {$EXTERNALSYM GetInterfaceInfo}
- function GetUniDirectionalAdapterInfo(pIPIfInfo: PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;
- var dwOutBufLen: ULONG): DWORD; stdcall;
- {$EXTERNALSYM GetUniDirectionalAdapterInfo(OUT PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo}
- function NhpAllocateAndGetInterfaceInfoFromStack(out ppTable: PIP_INTERFACE_NAME_INFO;
- pdwCount: PDWORD; bOrder: BOOL; hHeap: HANDLE; dwFlags: DWORD): DWORD; stdcall;
- {$EXTERNALSYM NhpAllocateAndGetInterfaceInfoFromStack}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the "best" outgoing interface for the specified destination address //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetBestInterface(dwDestAddr: IPAddr; var pdwBestIfIndex: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetBestInterface}
- function GetBestInterfaceEx(pDestAddr: PSockAddr; var pdwBestIfIndex: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetBestInterfaceEx}
- //////////////////////////////////////////////////////////////////////////////
- // //
- // Gets the best (longest matching prefix) route for the given destination //
- // If the source address is also specified (i.e. is not 0x00000000), and //
- // there are multiple "best" routes to the given destination, the returned //
- // route will be one that goes out over the interface which has an address //
- // that matches the source address //
- // //
- //////////////////////////////////////////////////////////////////////////////
- function GetBestRoute(dwDestAddr, dwSourceAddr: DWORD; pBestRoute: PMIB_IPFORWARDROW): DWORD; stdcall;
- {$EXTERNALSYM GetBestRoute}
- function NotifyAddrChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD; stdcall;
- {$EXTERNALSYM NotifyAddrChange}
- function NotifyRouteChange(var Handle: THandle; overlapped: POVERLAPPED): DWORD; stdcall;
- {$EXTERNALSYM NotifyRouteChange}
- function CancelIPChangeNotify(notifyOverlapped: LPOVERLAPPED): BOOL; stdcall;
- {$EXTERNALSYM CancelIPChangeNotify}
- function GetAdapterIndex(AdapterName: LPWSTR; var IfIndex: ULONG): DWORD; stdcall;
- {$EXTERNALSYM GetAdapterIndex}
- function AddIPAddress(Address: IPAddr; IpMask: IPMask; IfIndex: DWORD;
- var NTEContext, NTEInstance: ULONG): DWORD; stdcall;
- {$EXTERNALSYM AddIPAddress}
- function DeleteIPAddress(NTEContext: ULONG): DWORD; stdcall;
- {$EXTERNALSYM DeleteIPAddress}
- function GetNetworkParams(pFixedInfo: PFIXED_INFO; var pOutBufLen: ULONG): DWORD; stdcall;
- {$EXTERNALSYM GetNetworkParams}
- function GetAdaptersInfo(pAdapterInfo: PIP_ADAPTER_INFO; var pOutBufLen: ULONG): DWORD; stdcall;
- {$EXTERNALSYM GetAdaptersInfo}
- function GetAdapterOrderMap: PIP_ADAPTER_ORDER_MAP; stdcall;
- {$EXTERNALSYM GetAdapterOrderMap}
- //
- // The following functions require Winsock2.
- //
- function GetAdaptersAddresses(Family: ULONG; Flags: DWORD; Reserved: PVOID;
- pAdapterAddresses: PIP_ADAPTER_ADDRESSES; pOutBufLen: PULONG): DWORD; stdcall;
- {$EXTERNALSYM GetAdaptersAddresses}
- function GetPerAdapterInfo(IfIndex: ULONG; pPerAdapterInfo: PIP_PER_ADAPTER_INFO;
- var pOutBufLen: ULONG): DWORD; stdcall;
- {$EXTERNALSYM GetPerAdapterInfo}
- function IpReleaseAddress(const AdapterInfo: IP_ADAPTER_INDEX_MAP): DWORD; stdcall;
- {$EXTERNALSYM IpReleaseAddress}
- function IpRenewAddress(const AdapterInfo: IP_ADAPTER_INDEX_MAP): DWORD; stdcall;
- {$EXTERNALSYM IpRenewAddress}
- function SendARP(const DestIP, SrcIP: IPAddr; pMacAddr: PULONG; var PhyAddrLen: ULONG): DWORD; stdcall;
- {$EXTERNALSYM SendARP}
- function GetRTTAndHopCount(DestIpAddress: IPAddr; var HopCount: ULONG;
- MaxHops: ULONG; var RTT: ULONG): BOOL; stdcall;
- {$EXTERNALSYM GetRTTAndHopCount}
- function GetFriendlyIfIndex(IfIndex: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetFriendlyIfIndex}
- function EnableRouter(var pHandle: THandle; pOverlapped: POVERLAPPED): DWORD; stdcall;
- {$EXTERNALSYM EnableRouter}
- function UnenableRouter(pOverlapped: POVERLAPPED; lpdwEnableCount: LPDWORD): DWORD; stdcall;
- {$EXTERNALSYM UnenableRouter}
- function DisableMediaSense(var pHandle: HANDLE; pOverLapped: POVERLAPPED): DWORD; stdcall;
- {$EXTERNALSYM DisableMediaSense}
- function RestoreMediaSense(pOverlapped: POVERLAPPED; lpdwEnableCount: LPDWORD): DWORD; stdcall;
- {$EXTERNALSYM RestoreMediaSense}
- function GetIpErrorString(ErrorCode: IP_STATUS; Buffer: PWCHAR; var Size: DWORD): DWORD; stdcall;
- {$EXTERNALSYM GetIpErrorString}
- implementation
- uses
- JwaWinDLLNames;
- {$IFDEF DYNAMIC_LINK}
- var
- _GetNumberOfInterfaces: Pointer;
- function GetNumberOfInterfaces;
- begin
- GetProcedureAddress(_GetNumberOfInterfaces, iphlpapilib, 'GetNumberOfInterfaces');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetNumberOfInterfaces]
- end;
- end;
- var
- _GetIfEntry: Pointer;
- function GetIfEntry;
- begin
- GetProcedureAddress(_GetIfEntry, iphlpapilib, 'GetIfEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIfEntry]
- end;
- end;
- var
- _GetIfTable: Pointer;
- function GetIfTable;
- begin
- GetProcedureAddress(_GetIfTable, iphlpapilib, 'GetIfTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIfTable]
- end;
- end;
- var
- _GetIpAddrTable: Pointer;
- function GetIpAddrTable;
- begin
- GetProcedureAddress(_GetIpAddrTable, iphlpapilib, 'GetIpAddrTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIpAddrTable]
- end;
- end;
- var
- _GetIpNetTable: Pointer;
- function GetIpNetTable;
- begin
- GetProcedureAddress(_GetIpNetTable, iphlpapilib, 'GetIpNetTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIpNetTable]
- end;
- end;
- var
- _GetIpForwardTable: Pointer;
- function GetIpForwardTable;
- begin
- GetProcedureAddress(_GetIpForwardTable, iphlpapilib, 'GetIpForwardTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIpForwardTable]
- end;
- end;
- var
- _GetTcpTable: Pointer;
- function GetTcpTable;
- begin
- GetProcedureAddress(_GetTcpTable, iphlpapilib, 'GetTcpTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetTcpTable]
- end;
- end;
- var
- _GetUdpTable: Pointer;
- function GetUdpTable;
- begin
- GetProcedureAddress(_GetUdpTable, iphlpapilib, 'GetUdpTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetUdpTable]
- end;
- end;
- var
- _GetIpStatistics: Pointer;
- function GetIpStatistics;
- begin
- GetProcedureAddress(_GetIpStatistics, iphlpapilib, 'GetIpStatistics');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIpStatistics]
- end;
- end;
- var
- _GetIpStatisticsEx: Pointer;
- function GetIpStatisticsEx;
- begin
- GetProcedureAddress(_GetIpStatisticsEx, iphlpapilib, 'GetIpStatisticsEx');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIpStatisticsEx]
- end;
- end;
- var
- _GetIcmpStatistics: Pointer;
- function GetIcmpStatistics;
- begin
- GetProcedureAddress(_GetIcmpStatistics, iphlpapilib, 'GetIcmpStatistics');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIcmpStatistics]
- end;
- end;
- var
- _GetIcmpStatisticsEx: Pointer;
- function GetIcmpStatisticsEx;
- begin
- GetProcedureAddress(_GetIcmpStatisticsEx, iphlpapilib, 'GetIcmpStatisticsEx');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIcmpStatisticsEx]
- end;
- end;
- var
- _GetTcpStatistics: Pointer;
- function GetTcpStatistics;
- begin
- GetProcedureAddress(_GetTcpStatistics, iphlpapilib, 'GetTcpStatistics');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetTcpStatistics]
- end;
- end;
- var
- _GetTcpStatisticsEx: Pointer;
- function GetTcpStatisticsEx;
- begin
- GetProcedureAddress(_GetTcpStatisticsEx, iphlpapilib, 'GetTcpStatisticsEx');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetTcpStatisticsEx]
- end;
- end;
- var
- _GetUdpStatistics: Pointer;
- function GetUdpStatistics;
- begin
- GetProcedureAddress(_GetUdpStatistics, iphlpapilib, 'GetUdpStatistics');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetUdpStatistics]
- end;
- end;
- var
- _GetUdpStatisticsEx: Pointer;
- function GetUdpStatisticsEx;
- begin
- GetProcedureAddress(_GetUdpStatisticsEx, iphlpapilib, 'GetUdpStatisticsEx');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetUdpStatisticsEx]
- end;
- end;
- var
- _SetIfEntry: Pointer;
- function SetIfEntry;
- begin
- GetProcedureAddress(_SetIfEntry, iphlpapilib, 'SetIfEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SetIfEntry]
- end;
- end;
- var
- _CreateIpForwardEntry: Pointer;
- function CreateIpForwardEntry;
- begin
- GetProcedureAddress(_CreateIpForwardEntry, iphlpapilib, 'CreateIpForwardEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_CreateIpForwardEntry]
- end;
- end;
- var
- _SetIpForwardEntry: Pointer;
- function SetIpForwardEntry;
- begin
- GetProcedureAddress(_SetIpForwardEntry, iphlpapilib, 'SetIpForwardEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SetIpForwardEntry]
- end;
- end;
- var
- _DeleteIpForwardEntry: Pointer;
- function DeleteIpForwardEntry;
- begin
- GetProcedureAddress(_DeleteIpForwardEntry, iphlpapilib, 'DeleteIpForwardEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_DeleteIpForwardEntry]
- end;
- end;
- var
- _SetIpStatistics: Pointer;
- function SetIpStatistics;
- begin
- GetProcedureAddress(_SetIpStatistics, iphlpapilib, 'SetIpStatistics');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SetIpStatistics]
- end;
- end;
- var
- _SetIpTTL: Pointer;
- function SetIpTTL;
- begin
- GetProcedureAddress(_SetIpTTL, iphlpapilib, 'SetIpTTL');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SetIpTTL]
- end;
- end;
- var
- _CreateIpNetEntry: Pointer;
- function CreateIpNetEntry;
- begin
- GetProcedureAddress(_CreateIpNetEntry, iphlpapilib, 'CreateIpNetEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_CreateIpNetEntry]
- end;
- end;
- var
- _SetIpNetEntry: Pointer;
- function SetIpNetEntry;
- begin
- GetProcedureAddress(_SetIpNetEntry, iphlpapilib, 'SetIpNetEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SetIpNetEntry]
- end;
- end;
- var
- _DeleteIpNetEntry: Pointer;
- function DeleteIpNetEntry;
- begin
- GetProcedureAddress(_DeleteIpNetEntry, iphlpapilib, 'DeleteIpNetEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_DeleteIpNetEntry]
- end;
- end;
- var
- _FlushIpNetTable: Pointer;
- function FlushIpNetTable;
- begin
- GetProcedureAddress(_FlushIpNetTable, iphlpapilib, 'FlushIpNetTable');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_FlushIpNetTable]
- end;
- end;
- var
- _CreateProxyArpEntry: Pointer;
- function CreateProxyArpEntry;
- begin
- GetProcedureAddress(_CreateProxyArpEntry, iphlpapilib, 'CreateProxyArpEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_CreateProxyArpEntry]
- end;
- end;
- var
- _DeleteProxyArpEntry: Pointer;
- function DeleteProxyArpEntry;
- begin
- GetProcedureAddress(_DeleteProxyArpEntry, iphlpapilib, 'DeleteProxyArpEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_DeleteProxyArpEntry]
- end;
- end;
- var
- _SetTcpEntry: Pointer;
- function SetTcpEntry;
- begin
- GetProcedureAddress(_SetTcpEntry, iphlpapilib, 'SetTcpEntry');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SetTcpEntry]
- end;
- end;
- var
- _GetInterfaceInfo: Pointer;
- function GetInterfaceInfo;
- begin
- GetProcedureAddress(_GetInterfaceInfo, iphlpapilib, 'GetInterfaceInfo');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetInterfaceInfo]
- end;
- end;
- var
- _GetUniDirectionalAdapterInfo: Pointer;
- function GetUniDirectionalAdapterInfo;
- begin
- GetProcedureAddress(_GetUniDirectionalAdapterInfo, iphlpapilib, 'GetUniDirectionalAdapterInfo');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetUniDirectionalAdapterInfo]
- end;
- end;
- var
- _NhpAllocateAndGetInterfaceInfoFromStack: Pointer;
- function NhpAllocateAndGetInterfaceInfoFromStack;
- begin
- GetProcedureAddress(_NhpAllocateAndGetInterfaceInfoFromStack, iphlpapilib, 'NhpAllocateAndGetInterfaceInfoFromStack');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_NhpAllocateAndGetInterfaceInfoFromStack]
- end;
- end;
- var
- _GetBestInterface: Pointer;
- function GetBestInterface;
- begin
- GetProcedureAddress(_GetBestInterface, iphlpapilib, 'GetBestInterface');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetBestInterface]
- end;
- end;
- var
- _GetBestInterfaceEx: Pointer;
- function GetBestInterfaceEx;
- begin
- GetProcedureAddress(_GetBestInterfaceEx, iphlpapilib, 'GetBestInterfaceEx');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetBestInterfaceEx]
- end;
- end;
- var
- _GetBestRoute: Pointer;
- function GetBestRoute;
- begin
- GetProcedureAddress(_GetBestRoute, iphlpapilib, 'GetBestRoute');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetBestRoute]
- end;
- end;
- var
- _NotifyAddrChange: Pointer;
- function NotifyAddrChange;
- begin
- GetProcedureAddress(_NotifyAddrChange, iphlpapilib, 'NotifyAddrChange');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_NotifyAddrChange]
- end;
- end;
- var
- _NotifyRouteChange: Pointer;
- function NotifyRouteChange;
- begin
- GetProcedureAddress(_NotifyRouteChange, iphlpapilib, 'NotifyRouteChange');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_NotifyRouteChange]
- end;
- end;
- var
- _CancelIPChangeNotify: Pointer;
- function CancelIPChangeNotify;
- begin
- GetProcedureAddress(_CancelIPChangeNotify, iphlpapilib, 'CancelIPChangeNotify');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_CancelIPChangeNotify]
- end;
- end;
- var
- _GetAdapterIndex: Pointer;
- function GetAdapterIndex;
- begin
- GetProcedureAddress(_GetAdapterIndex, iphlpapilib, 'GetAdapterIndex');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetAdapterIndex]
- end;
- end;
- var
- _AddIPAddress: Pointer;
- function AddIPAddress;
- begin
- GetProcedureAddress(_AddIPAddress, iphlpapilib, 'AddIPAddress');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_AddIPAddress]
- end;
- end;
- var
- _DeleteIPAddress: Pointer;
- function DeleteIPAddress;
- begin
- GetProcedureAddress(_DeleteIPAddress, iphlpapilib, 'DeleteIPAddress');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_DeleteIPAddress]
- end;
- end;
- var
- _GetNetworkParams: Pointer;
- function GetNetworkParams;
- begin
- GetProcedureAddress(_GetNetworkParams, iphlpapilib, 'GetNetworkParams');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetNetworkParams]
- end;
- end;
- var
- _GetAdaptersInfo: Pointer;
- function GetAdaptersInfo;
- begin
- GetProcedureAddress(_GetAdaptersInfo, iphlpapilib, 'GetAdaptersInfo');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetAdaptersInfo]
- end;
- end;
- var
- _GetAdapterOrderMap: Pointer;
- function GetAdapterOrderMap;
- begin
- GetProcedureAddress(_GetAdapterOrderMap, iphlpapilib, 'GetAdapterOrderMap');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetAdapterOrderMap]
- end;
- end;
- var
- _GetAdaptersAddresses: Pointer;
- function GetAdaptersAddresses;
- begin
- GetProcedureAddress(_GetAdaptersAddresses, iphlpapilib, 'GetAdaptersAddresses');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetAdaptersAddresses]
- end;
- end;
- var
- _GetPerAdapterInfo: Pointer;
- function GetPerAdapterInfo;
- begin
- GetProcedureAddress(_GetPerAdapterInfo, iphlpapilib, 'GetPerAdapterInfo');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetPerAdapterInfo]
- end;
- end;
- var
- _IpReleaseAddress: Pointer;
- function IpReleaseAddress;
- begin
- GetProcedureAddress(_IpReleaseAddress, iphlpapilib, 'IpReleaseAddress');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_IpReleaseAddress]
- end;
- end;
- var
- _IpRenewAddress: Pointer;
- function IpRenewAddress;
- begin
- GetProcedureAddress(_IpRenewAddress, iphlpapilib, 'IpRenewAddress');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_IpRenewAddress]
- end;
- end;
- var
- _SendARP: Pointer;
- function SendARP;
- begin
- GetProcedureAddress(_SendARP, iphlpapilib, 'SendARP');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_SendARP]
- end;
- end;
- var
- _GetRTTAndHopCount: Pointer;
- function GetRTTAndHopCount;
- begin
- GetProcedureAddress(_GetRTTAndHopCount, iphlpapilib, 'GetRTTAndHopCount');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetRTTAndHopCount]
- end;
- end;
- var
- _GetFriendlyIfIndex: Pointer;
- function GetFriendlyIfIndex;
- begin
- GetProcedureAddress(_GetFriendlyIfIndex, iphlpapilib, 'GetFriendlyIfIndex');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetFriendlyIfIndex]
- end;
- end;
- var
- _EnableRouter: Pointer;
- function EnableRouter;
- begin
- GetProcedureAddress(_EnableRouter, iphlpapilib, 'EnableRouter');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_EnableRouter]
- end;
- end;
- var
- _UnenableRouter: Pointer;
- function UnenableRouter;
- begin
- GetProcedureAddress(_UnenableRouter, iphlpapilib, 'UnenableRouter');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_UnenableRouter]
- end;
- end;
- var
- _DisableMediaSense: Pointer;
- function DisableMediaSense;
- begin
- GetProcedureAddress(_DisableMediaSense, iphlpapilib, 'DisableMediaSense');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_DisableMediaSense]
- end;
- end;
- var
- _RestoreMediaSense: Pointer;
- function RestoreMediaSense;
- begin
- GetProcedureAddress(_RestoreMediaSense, iphlpapilib, 'RestoreMediaSense');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_RestoreMediaSense]
- end;
- end;
- var
- _GetIpErrorString: Pointer;
- function GetIpErrorString;
- begin
- GetProcedureAddress(_GetIpErrorString, iphlpapilib, 'GetIpErrorString');
- asm
- MOV ESP, EBP
- POP EBP
- JMP [_GetIpErrorString]
- end;
- end;
- {$ELSE}
- function GetNumberOfInterfaces; external iphlpapilib name 'GetNumberOfInterfaces';
- function GetIfEntry; external iphlpapilib name 'GetIfEntry';
- function GetIfTable; external iphlpapilib name 'GetIfTable';
- function GetIpAddrTable; external iphlpapilib name 'GetIpAddrTable';
- function GetIpNetTable; external iphlpapilib name 'GetIpNetTable';
- function GetIpForwardTable; external iphlpapilib name 'GetIpForwardTable';
- function GetTcpTable; external iphlpapilib name 'GetTcpTable';
- function GetUdpTable; external iphlpapilib name 'GetUdpTable';
- function GetIpStatistics; external iphlpapilib name 'GetIpStatistics';
- function GetIpStatisticsEx; external iphlpapilib name 'GetIpStatisticsEx';
- function GetIcmpStatistics; external iphlpapilib name 'GetIcmpStatistics';
- function GetIcmpStatisticsEx; external iphlpapilib name 'GetIcmpStatisticsEx';
- function GetTcpStatistics; external iphlpapilib name 'GetTcpStatistics';
- function GetTcpStatisticsEx; external iphlpapilib name 'GetTcpStatisticsEx';
- function GetUdpStatistics; external iphlpapilib name 'GetUdpStatistics';
- function GetUdpStatisticsEx; external iphlpapilib name 'GetUdpStatisticsEx';
- function SetIfEntry; external iphlpapilib name 'SetIfEntry';
- function CreateIpForwardEntry; external iphlpapilib name 'CreateIpForwardEntry';
- function SetIpForwardEntry; external iphlpapilib name 'SetIpForwardEntry';
- function DeleteIpForwardEntry; external iphlpapilib name 'DeleteIpForwardEntry';
- function SetIpStatistics; external iphlpapilib name 'SetIpStatistics';
- function SetIpTTL; external iphlpapilib name 'SetIpTTL';
- function CreateIpNetEntry; external iphlpapilib name 'CreateIpNetEntry';
- function SetIpNetEntry; external iphlpapilib name 'SetIpNetEntry';
- function DeleteIpNetEntry; external iphlpapilib name 'DeleteIpNetEntry';
- function FlushIpNetTable; external iphlpapilib name 'FlushIpNetTable';
- function CreateProxyArpEntry; external iphlpapilib name 'CreateProxyArpEntry';
- function DeleteProxyArpEntry; external iphlpapilib name 'DeleteProxyArpEntry';
- function SetTcpEntry; external iphlpapilib name 'SetTcpEntry';
- function GetInterfaceInfo; external iphlpapilib name 'GetInterfaceInfo';
- function GetUniDirectionalAdapterInfo; external iphlpapilib name 'GetUniDirectionalAdapterInfo';
- function NhpAllocateAndGetInterfaceInfoFromStack; external iphlpapilib name 'NhpAllocateAndGetInterfaceInfoFromStack';
- function GetBestInterface; external iphlpapilib name 'GetBestInterface';
- function GetBestInterfaceEx; external iphlpapilib name 'GetBestInterfaceEx';
- function GetBestRoute; external iphlpapilib name 'GetBestRoute';
- function NotifyAddrChange; external iphlpapilib name 'NotifyAddrChange';
- function NotifyRouteChange; external iphlpapilib name 'NotifyRouteChange';
- function CancelIPChangeNotify; external iphlpapilib name 'CancelIPChangeNotify';
- function GetAdapterIndex; external iphlpapilib name 'GetAdapterIndex';
- function AddIPAddress; external iphlpapilib name 'AddIPAddress';
- function DeleteIPAddress; external iphlpapilib name 'DeleteIPAddress';
- function GetNetworkParams; external iphlpapilib name 'GetNetworkParams';
- function GetAdaptersInfo; external iphlpapilib name 'GetAdaptersInfo';
- function GetAdapterOrderMap; external iphlpapilib name 'GetAdapterOrderMap';
- function GetAdaptersAddresses; external iphlpapilib name 'GetAdaptersAddresses';
- function GetPerAdapterInfo; external iphlpapilib name 'GetPerAdapterInfo';
- function IpReleaseAddress; external iphlpapilib name 'IpReleaseAddress';
- function IpRenewAddress; external iphlpapilib name 'IpRenewAddress';
- function SendARP; external iphlpapilib name 'SendARP';
- function GetRTTAndHopCount; external iphlpapilib name 'GetRTTAndHopCount';
- function GetFriendlyIfIndex; external iphlpapilib name 'GetFriendlyIfIndex';
- function EnableRouter; external iphlpapilib name 'EnableRouter';
- function UnenableRouter; external iphlpapilib name 'UnenableRouter';
- function DisableMediaSense; external iphlpapilib name 'DisableMediaSense';
- function RestoreMediaSense; external iphlpapilib name 'RestoreMediaSense';
- function GetIpErrorString; external iphlpapilib name 'GetIpErrorString';
- {$ENDIF DYNAMIC_LINK}
- end.
|