This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
EvilWorks.Api.IpHlpApi.pas
500 lines (424 loc) · 14.2 KB
/
EvilWorks.Api.IpHlpApi.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
unit EvilWorks.Api.IpHlpApi;
interface
uses
WinApi.Windows,
WinApi.Winsock2,
WinApi.IpHlpApi,
WinApi.IpRtrMib,
WinApi.IpExport,
System.SysUtils,
EvilWorks.Api.TcpEStats;
const
{ TCPIP_OWNING_MODULE_SIZE }
TCPIP_OWNING_MODULE_SIZE = 16;
{$EXTERNALSYM TCPIP_OWNING_MODULE_SIZE}
type
TMacAddr = array [0 .. MAXLEN_PHYSADDR - 1] of byte;
PMacAddr = ^TMacAddr;
{ MIB_TCP_STATE }
MIB_TCP_STATE = (
MIB_TCP_STATE_CLOSED = 1,
MIB_TCP_STATE_LISTEN = 2,
MIB_TCP_STATE_SYN_SENT = 3,
MIB_TCP_STATE_SYN_RCVD = 4,
MIB_TCP_STATE_ESTAB = 5,
MIB_TCP_STATE_FIN_WAIT1 = 6,
MIB_TCP_STATE_FIN_WAIT2 = 7,
MIB_TCP_STATE_CLOSE_WAIT = 8,
MIB_TCP_STATE_CLOSING = 9,
MIB_TCP_STATE_LAST_ACK = 10,
MIB_TCP_STATE_TIME_WAIT = 11,
MIB_TCP_STATE_DELETE_TCB = 12
);
{$EXTERNALSYM MIB_TCP_STATE}
{ TCP_TABLE_CLASS }
TCP_TABLE_CLASS = (
TCP_TABLE_BASIC_LISTENER,
TCP_TABLE_BASIC_CONNECTIONS,
TCP_TABLE_BASIC_ALL,
TCP_TABLE_OWNER_PID_LISTENER,
TCP_TABLE_OWNER_PID_CONNECTIONS,
TCP_TABLE_OWNER_PID_ALL,
TCP_TABLE_OWNER_MODULE_LISTENER,
TCP_TABLE_OWNER_MODULE_CONNECTIONS,
TCP_TABLE_OWNER_MODULE_ALL
);
{$EXTERNALSYM TCP_TABLE_CLASS}
TTcpTableClass = TCP_TABLE_CLASS;
PTCP_TABLE_CLASS = ^TCP_TABLE_CLASS;
{ UDP_TABLE_CLASS }
UDP_TABLE_CLASS = (
UDP_TABLE_BASIC,
UDP_TABLE_OWNER_PID,
UDP_TABLE_OWNER_MODULE
);
{$EXTERNALSYM UDP_TABLE_CLASS}
TUdpTableClass = UDP_TABLE_CLASS;
PDUDP_TABLE_CLASS = ^UDP_TABLE_CLASS;
{ MIB_TCPROW }
MIB_TCPROW = record
State: MIB_TCP_STATE;
dwLocalAddr: DWORD;
dwLocalPort: DWORD;
dwRemoteAddr: DWORD;
dwRemotePort: DWORD;
end;
{$EXTERNALSYM PMIB_TCPROW}
PMIB_TCPROW = ^MIB_TCPROW;
{$EXTERNALSYM MIB_TCPROW}
TMibTcpRow = MIB_TCPROW;
{ MIB_TCPTABLE }
MIB_TCPTABLE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_TCPROW;
end;
{$EXTERNALSYM MIB_TCPTABLE}
PMIB_TCPTABLE = ^MIB_TCPTABLE;
{$EXTERNALSYM MIB_TCPTABLE}
TMibTcpTable = MIB_TCPTABLE;
{ MIB_TCPROW_OWNER_PID }
MIB_TCPROW_OWNER_PID = record
dwState: DWORD;
dwLocalAddr: DWORD;
dwLocalPort: DWORD;
dwRemoteAddr: DWORD;
dwRemotePort: DWORD;
dwOwningPid: DWORD;
end;
{$EXTERNALSYM MIB_TCPROW_OWNER_PID}
PMIB_TCPROW_OWNER_PID = ^MIB_TCPROW_OWNER_PID;
{$EXTERNALSYM MIB_TCPROW_OWNER_PID}
TMibTcpRowOwnerPid = MIB_TCPROW_OWNER_PID;
{ MIB_TCPTABLE_OWNER_PID }
MIB_TCPTABLE_OWNER_PID = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_TCPROW_OWNER_PID;
end;
{$EXTERNALSYM MIB_TCPTABLE_OWNER_PID}
PMIB_TCPTABLE_OWNER_PID = ^MIB_TCPTABLE_OWNER_PID;
{$EXTERNALSYM MIB_TCPTABLE_OWNER_PID}
TMibTcpTableOwnerPid = MIB_TCPTABLE_OWNER_PID;
{ MIB_TCPROW_OWNER_MODULE }
MIB_TCPROW_OWNER_MODULE = record
dwState: DWORD;
dwLocalAddr: DWORD;
dwLocalPort: DWORD;
dwRemoteAddr: DWORD;
dwRemotePort: DWORD;
dwOwningPid: DWORD;
liCreateTimestamp: LARGE_INTEGER;
OwningModuleInfo: array [0 .. TCPIP_OWNING_MODULE_SIZE - 1] of ULONGLONG;
end;
{$EXTERNALSYM MIB_TCPROW_OWNER_MODULE}
PMIB_TCPROW_OWNER_MODULE = ^MIB_TCPROW_OWNER_MODULE;
{$EXTERNALSYM MIB_TCPROW_OWNER_MODULE}
TMibTcpRowOwnerModule = MIB_TCPROW_OWNER_MODULE;
{ MIB_TCPTABLE_OWNER_MODULE }
MIB_TCPTABLE_OWNER_MODULE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_TCPROW_OWNER_MODULE;
end;
{$EXTERNALSYM MIB_TCPTABLE_OWNER_MODULE}
PMIB_TCPTABLE_OWNER_MODULE = ^MIB_TCPTABLE_OWNER_MODULE;
{$EXTERNALSYM MIB_TCPTABLE_OWNER_MODULE}
TMibTcpTableOwnerModule = MIB_TCPTABLE_OWNER_MODULE;
{ MIB_TCP6ROW }
MIB_TCP6ROW = record
State: MIB_TCP_STATE;
LocalAddr: IN6_ADDR;
dwLocalScopeId: DWORD;
dwLocalPort: DWORD;
RemoteAddr: IN6_ADDR;
dwRemoteScopeId: DWORD;
dwRemotePort: DWORD;
end;
{$EXTERNALSYM MIB_TCP6ROW}
PMIB_TCP6ROW = ^MIB_TCP6ROW;
{$EXTERNALSYM MIB_TCP6ROW}
TMibTcp6Row = MIB_TCP6ROW;
{ MIB_TCP6TABLE }
MIB_TCP6TABLE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_TCP6ROW;
end;
{$EXTERNALSYM MIB_TCP6TABLE}
PMIB_TCP6TABLE = ^MIB_TCP6TABLE;
{$EXTERNALSYM MIB_TCP6TABLE}
TMibTcp6Table = MIB_TCP6TABLE;
{ MIB_TCP6ROW_OWNER_PID }
MIB_TCP6ROW_OWNER_PID = record
ucLocalAddr: array [0 .. 15] of UCHAR;
dwLocalScopeId: DWORD;
dwLocalPort: DWORD;
ucRemoteAddr: array [0 .. 15] of UCHAR;
dwRemoteScopeId: DWORD;
dwRemotePort: DWORD;
dwState: DWORD;
dwOwningPid: DWORD;
end;
{$EXTERNALSYM MIB_TCP6ROW_OWNER_PID}
PMIB_TCP6ROW_OWNER_PID = ^MIB_TCP6ROW_OWNER_PID;
{$EXTERNALSYM MIB_TCP6ROW_OWNER_PID}
TMibTcp6RowOwnerPid = MIB_TCP6ROW_OWNER_PID;
{ MIB_TCP6TABLE_OWNER_PID }
MIB_TCP6TABLE_OWNER_PID = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_TCP6ROW_OWNER_PID;
end;
{$EXTERNALSYM MIB_TCP6TABLE_OWNER_PID}
PMIB_TCP6TABLE_OWNER_PID = ^MIB_TCP6TABLE_OWNER_PID;
{$EXTERNALSYM MIB_TCP6ROW_OWNER_PID}
TMibTcp6TableOwnerPid = MIB_TCP6TABLE_OWNER_PID;
{ MIB_TCP6ROW_OWNER_MODULE }
MIB_TCP6ROW_OWNER_MODULE = record
ucLocalAddr: array [0 .. 15] of UCHAR;
dwLocalScopeId: DWORD;
dwLocalPort: DWORD;
ucRemoteAddr: array [0 .. 15] of UCHAR;
dwRemoteScopeId: DWORD;
dwRemotePort: DWORD;
dwState: DWORD;
dwOwningPid: DWORD;
liCreateTimestamp: LARGE_INTEGER;
OwningModuleInfo: array [0 .. TCPIP_OWNING_MODULE_SIZE - 1] of ULONGLONG;
end;
{$EXTERNALSYM MIB_TCP6ROW_OWNER_MODULE}
PMIB_TCP6ROW_OWNER_MODULE = ^MIB_TCP6ROW_OWNER_MODULE;
{$EXTERNALSYM MIB_TCP6ROW_OWNER_MODULE}
TMibTcp6RowOwnerModule = MIB_TCP6ROW_OWNER_MODULE;
{ MIB_TCP6TABLE_OWNER_MODULE }
MIB_TCP6TABLE_OWNER_MODULE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_TCP6ROW_OWNER_MODULE;
end;
{$EXTERNALSYM MIB_TCP6TABLE_OWNER_MODULE}
PMIB_TCP6TABLE_OWNER_MODULE = ^MIB_TCP6TABLE_OWNER_MODULE;
{$EXTERNALSYM MIB_TCP6TABLE_OWNER_MODULE}
TMibTcp6TableOwnerModule = MIB_TCP6TABLE_OWNER_MODULE;
{ MIB_UDPROW }
MIB_UDPROW = record
dwLocalAddr: DWORD;
dwLocalPort: DWORD;
end;
{$EXTERNALSYM MIB_UDPROW}
TMibUdpRow = MIB_UDPROW;
PMIB_UDPROW = ^MIB_UDPROW;
{ MIB_UDPTABLE }
MIB_UDPTABLE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_UDPROW;
end;
{$EXTERNALSYM MIB_UDPTABLE}
TMibUdpTable = MIB_UDPTABLE;
PMIB_UDPTABLE = ^MIB_UDPTABLE;
{ MIB_UDPROW_OWNER_PID }
MIB_UDPROW_OWNER_PID = record
dwLocalAddr: DWORD;
dwLocalPort: DWORD;
dwOwningPid: DWORD;
end;
{$EXTERNALSYM MIB_UDPROW_OWNER_PID}
TMibUdpRowOwnerPid = MIB_UDPROW_OWNER_PID;
PMIB_UDPROW_OWNER_PID = ^MIB_UDPROW_OWNER_PID;
{ MIB_UDPTABLE_OWNER_PID }
MIB_UDPTABLE_OWNER_PID = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_UDPROW_OWNER_PID;
end;
{$EXTERNALSYM MIB_UDPTABLE_OWNER_PID}
TMibUdpTableOwnerPid = MIB_UDPTABLE_OWNER_PID;
PMIB_UDPTABLE_OWNER_PID = ^MIB_UDPTABLE_OWNER_PID;
{ MIB_UDPROW_OWNER_MODULE }
MIB_UDPROW_OWNER_MODULE = record
dwLocalAddr: DWORD;
dwLocalPort: DWORD;
dwOwningPid: DWORD;
liCreateTimestamp: LARGE_INTEGER;
dwFlags: integer;
OwningModuleInfo: array [0 .. TCPIP_OWNING_MODULE_SIZE - 1] of ULONGLONG;
end;
{$EXTERNALSYM MIB_UDPROW_OWNER_MODULE}
TMibUdpRowOwnerModule = MIB_UDPROW_OWNER_MODULE;
PMIB_UDPROW_OWNER_MODULE = ^MIB_UDPROW_OWNER_MODULE;
{ MIB_UDPTABLE_OWNER_MODULE }
MIB_UDPTABLE_OWNER_MODULE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_UDPROW_OWNER_MODULE;
end;
{$EXTERNALSYM MIB_UDPTABLE_OWNER_MODULE}
TMibUdpTableOwnerModule = MIB_UDPTABLE_OWNER_MODULE;
PMIB_UDPTABLE_OWNER_MODULE = ^MIB_UDPTABLE_OWNER_MODULE;
{ MIB_UDP6ROW }
MIB_UDP6ROW = record
dwLocalAddr: IN6_ADDR;
dwLocalScopeId: DWORD;
dwLocalPort: DWORD;
end;
{$EXTERNALSYM MIB_UDP6ROW}
TMibUdp6Row = MIB_UDP6ROW;
PMIB_UDP6ROW = ^MIB_UDP6ROW;
{ MIB_UDP6TABLE }
MIB_UDP6TABLE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_UDP6ROW;
end;
{$EXTERNALSYM MIB_UDP6TABLE}
TMibUdp6Table = MIB_UDP6TABLE;
PMIB_UDP6TABLE = ^MIB_UDP6TABLE;
{ MIB_UDPROW_OWNER_PID }
MIB_UDP6ROW_OWNER_PID = record
ucLocalAddr: array [0 .. 15] of UCHAR;
dwLocalScopeId: DWORD;
dwLocalPort: DWORD;
dwOwningPid: DWORD;
end;
{$EXTERNALSYM MIB_UDP6ROW_OWNER_PID}
TMibUdp6RowOwnerPid = MIB_UDP6ROW_OWNER_PID;
PMIB_UDP6ROW_OWNER_PID = ^MIB_UDP6ROW_OWNER_PID;
{ MIB_UDP6TABLE_OWNER_PID }
MIB_UDP6TABLE_OWNER_PID = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_UDP6ROW_OWNER_PID;
end;
{$EXTERNALSYM MIB_UDP6TABLE_OWNER_PID}
TMibUdp6TableOwnerPid = MIB_UDP6TABLE_OWNER_PID;
PMIB_UDP6TABLE_OWNER_PID = ^MIB_UDP6TABLE_OWNER_PID;
{ MIB_UDP6ROW_OWNER_MODULE }
MIB_UDP6ROW_OWNER_MODULE = record
ucLocalAddr: array [0 .. 15] of UCHAR;
dwLocalScopeId: DWORD;
dwLocalPort: DWORD;
dwOwningPid: DWORD;
liCreateTimestamp: LARGE_INTEGER;
dwFlags: integer;
OwningModuleInfo: array [0 .. TCPIP_OWNING_MODULE_SIZE - 1] of ULONGLONG;
end;
{$EXTERNALSYM MIB_UDP6ROW_OWNER_MODULE}
TMibUdp6RowOwnerModule = MIB_UDP6ROW_OWNER_MODULE;
PMIB_UDP6ROW_OWNER_MODULE = ^MIB_UDP6ROW_OWNER_MODULE;
{ MIB_UDP6TABLE_OWNER_MODULE }
MIB_UDP6TABLE_OWNER_MODULE = record
dwNumEntries: DWORD;
table: array [0 .. 0] of MIB_UDP6ROW_OWNER_MODULE;
end;
{$EXTERNALSYM MIB_UDP6TABLE_OWNER_MODULE}
TMibUdp6TableOwnerModule = MIB_UDP6TABLE_OWNER_MODULE;
PMIB_UDP6TABLE_OWNER_MODULE = ^MIB_UDP6TABLE_OWNER_MODULE;
TGetPerTcpConnectionEStats = function(Row: PMIB_TCPROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Ros: PUCHAR; RosVersion: ULONG;
RosSize: ULONG; Rod: PUCHAR; RodVersion: ULONG; RodSize: ULONG): ULONG; stdcall;
TSetPerTcpConnectionEStats = function(Row: PMIB_TCPROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Offset: ULONG): ULONG; stdcall;
TGetPerTcp6ConnectionEStats = function(Row: PMIB_TCP6ROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Ros: PUCHAR; RosVersion: ULONG;
RosSize: ULONG; Rod: PUCHAR; RodVersion: ULONG; RodSize: ULONG): ULONG; stdcall;
TSetPerTcp6ConnectionEStats = function(Row: PMIB_TCP6ROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Offset: ULONG): ULONG; stdcall;
function GetExtendedTcpTable(
pTcpTable: pointer; var dwSize: DWORD; bOrder: BOOL; ulAf: ULONG;
TableClass: TCP_TABLE_CLASS; Reserved: ULONG): DWORD; stdcall;
{$EXTERNALSYM GetExtendedTcpTable}
function GetExtendedUdpTable(
pUdpTable: pointer; var dwSize: DWORD; bOrder: BOOL; ulAf: ULONG;
TableClass: UDP_TABLE_CLASS; Reserved: ULONG): DWORD; stdcall;
{$EXTERNALSYM GetExtendedUdpTable}
function GetPerTcpConnectionEStats(Row: PMIB_TCPROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Ros: PUCHAR; RosVersion: ULONG;
RosSize: ULONG; Rod: PUCHAR; RodVersion: ULONG; RodSize: ULONG): ULONG; stdcall;
{$EXTERNALSYM GetPerTcpConnectionEStats}
function SetPerTcpConnectionEStats(Row: PMIB_TCPROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Offset: ULONG): ULONG; stdcall;
{$EXTERNALSYM SetPerTcpConnectionEStats}
function GetPerTcp6ConnectionEStats(Row: PMIB_TCP6ROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Ros: PUCHAR; RosVersion: ULONG;
RosSize: ULONG; Rod: PUCHAR; RodVersion: ULONG; RodSize: ULONG): ULONG; stdcall;
{$EXTERNALSYM GetPerTcp6ConnectionEStats}
function SetPerTcp6ConnectionEStats(Row: PMIB_TCP6ROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Offset: ULONG): ULONG; stdcall;
{$EXTERNALSYM SetPerTcp6ConnectionEStats}
function MacAddr2Str(const aMacAddr: TMacAddr; aSize: integer): string;
implementation
const
iphlpapilib = 'iphlpapi.dll';
var
hIpHlpApi : THandle;
_GetPerTcpConnectionEStats : TGetPerTcpConnectionEStats;
_SetPerTcpConnectionEStats : TSetPerTcpConnectionEStats;
_GetPerTcp6ConnectionEStats: TGetPerTcp6ConnectionEStats;
_SetPerTcp6ConnectionEStats: TSetPerTcp6ConnectionEStats;
function CheckStubsLoaded: boolean;
begin
if (hIpHlpApi = 0) then
begin
hIpHlpApi := LoadLibrary(iphlpapilib);
if (hIpHlpApi < 32) then
begin
hIpHlpApi := 0;
Result := False;
Exit;
end;
@_GetPerTcpConnectionEStats := GetProcAddress(hIpHlpApi, 'GetPerTcpConnectionEStats');
@_SetPerTcpConnectionEStats := GetProcAddress(hIpHlpApi, 'SetPerTcpConnectionEStats');
@_GetPerTcp6ConnectionEStats := GetProcAddress(hIpHlpApi, 'GetPerTcp6ConnectionEStats');
@_SetPerTcp6ConnectionEStats := GetProcAddress(hIpHlpApi, 'SetPerTcp6ConnectionEStats');
end;
Result := True;
end;
{ converts numerical MAC-address to ww-xx-yy-zz string }
function MacAddr2Str(const aMacAddr: TMacAddr; aSize: integer): string;
var
i: integer;
begin
if (aSize = 0) then
begin
Result := '00-00-00-00-00-00';
Exit;
end
else
Result := '';
for i := 1 to aSize do
begin
Result := Result + IntToHex(aMacAddr[i], 2);
if (i <> aSize) then
Result := Result + '-';
end;
end;
function GetExtendedTcpTable; external iphlpapilib name 'GetExtendedTcpTable';
function GetExtendedUdpTable; external iphlpapilib name 'GetExtendedUdpTable';
function GetPerTcpConnectionEStats(Row: PMIB_TCPROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Ros: PUCHAR; RosVersion: ULONG;
RosSize: ULONG; Rod: PUCHAR; RodVersion: ULONG; RodSize: ULONG): ULONG;
begin
if (CheckStubsLoaded) then
Result := _GetPerTcpConnectionEStats(Row, EstatsType, Rw, RwVersion, RwSize, Ros,
RosVersion, RosSize, Rod, RodVersion, RodSize)
else
Result := 0;
end;
function SetPerTcpConnectionEStats(Row: PMIB_TCPROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Offset: ULONG): ULONG;
begin
if (CheckStubsLoaded) then
Result := _SetPerTcpConnectionEStats(Row, EstatsType, Rw, RwVersion, RwSize, Offset)
else
Result := 0;
end;
function GetPerTcp6ConnectionEStats(Row: PMIB_TCP6ROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Ros: PUCHAR; RosVersion: ULONG;
RosSize: ULONG; Rod: PUCHAR; RodVersion: ULONG; RodSize: ULONG): ULONG;
begin
if (CheckStubsLoaded) then
Result := _GetPerTcp6ConnectionEStats(Row, EstatsType, Rw, RwVersion, RwSize, Ros,
RosVersion, RosSize, Rod, RodVersion, RodSize)
else
Result := 0;
end;
function SetPerTcp6ConnectionEStats(Row: PMIB_TCP6ROW; EstatsType: TCP_ESTATS_TYPE;
Rw: PUCHAR; RwVersion: ULONG; RwSize: ULONG; Offset: ULONG): ULONG;
begin
if (CheckStubsLoaded) then
Result := _SetPerTcp6ConnectionEStats(Row, EstatsType, Rw, RwVersion, RwSize, Offset)
else
Result := 0;
end;
end.