[TCPIP_DRVTEST]
[reactos.git] / rostests / drivers / tcpip / tcp_info.c
1 /*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Tests for IOCTL_TCP_QUERY_INFORMATION_EX
5 * PROGRAMMER: Jérôme Gardou <jerome.gardou@reactos.org>
6 */
7
8 #include <apitest.h>
9
10 #include <stdio.h>
11
12 #include <winioctl.h>
13 #include <tcpioctl.h>
14 #include <tdiinfo.h>
15 #include <iptypes.h>
16 #include <winsock.h>
17
18 /* Route info */
19 typedef struct IPRouteEntry {
20 unsigned long ire_dest;
21 unsigned long ire_index;
22 unsigned long ire_metric1;
23 unsigned long ire_metric2;
24 unsigned long ire_metric3;
25 unsigned long ire_metric4;
26 unsigned long ire_nexthop;
27 unsigned long ire_type;
28 unsigned long ire_proto;
29 unsigned long ire_age;
30 unsigned long ire_mask;
31 unsigned long ire_metric5;
32 unsigned long ire_context;
33 } IPRouteEntry;
34
35 /* Present in headers for Vista+, but there in WinXP/2k3 ntdll */
36 NTSYSAPI
37 PSTR
38 NTAPI
39 RtlIpv4AddressToStringA(
40 _In_ const struct in_addr *Addr,
41 _Out_writes_(16) PSTR S);
42
43
44 static HANDLE TcpFileHandle;
45
46 static ULONG IndentationLevel = 0;
47
48 static
49 char*
50 dbg_print_physaddr(const unsigned char* addr, unsigned long addr_len)
51 {
52 static char buffer[24];
53
54 char* dest = buffer;
55 *dest = '\0';
56
57 while (addr_len--)
58 {
59 dest += sprintf(dest, "%02x", *addr);
60 addr++;
61 if (addr_len)
62 *dest++ = ':';
63 }
64
65 return buffer;
66 }
67
68 static
69 int
70 __cdecl
71 indent_printf(const char* format, ...)
72 {
73 ULONG Indent = IndentationLevel;
74 int ret;
75 va_list args;
76
77 while(Indent--)
78 printf("\t");
79
80 va_start(args, format);
81 ret = vprintf(format, args);
82 va_end(args);
83
84 ret += IndentationLevel;
85
86 return ret;
87 }
88
89 static
90 void
91 test_IF_MIB_STATS(
92 TDIEntityID Id,
93 ULONG EntityType)
94 {
95 IFEntry* IfEntry;
96 TCP_REQUEST_QUERY_INFORMATION_EX Request;
97 ULONG BufferSize = sizeof(IFEntry) + MAX_ADAPTER_DESCRIPTION_LENGTH + 1;
98 BOOL Result;
99
100 /* Not valid for other entity types */
101 if (EntityType != IF_MIB)
102 return;
103
104 IfEntry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferSize);
105 ok(IfEntry != NULL, "\n");
106
107 ZeroMemory(&Request, sizeof(Request));
108 Request.ID.toi_entity = Id;
109 Request.ID.toi_class = INFO_CLASS_PROTOCOL;
110 Request.ID.toi_type = INFO_TYPE_PROVIDER;
111 Request.ID.toi_id = IF_MIB_STATS_ID;
112
113 Result = DeviceIoControl(
114 TcpFileHandle,
115 IOCTL_TCP_QUERY_INFORMATION_EX,
116 &Request,
117 sizeof(Request),
118 IfEntry,
119 BufferSize,
120 &BufferSize,
121 NULL);
122 ok(Result, "DeviceIoControl failed.\n");
123
124 /* Dump it */
125 indent_printf("IF_MIB Statistics:\n");
126 IndentationLevel++;
127 indent_printf("if_index: %lu\n", IfEntry->if_index);
128 indent_printf("if_type: %lu\n", IfEntry->if_type);
129 indent_printf("if_mtu: %lu\n", IfEntry->if_mtu);
130 indent_printf("if_speed: %lu\n", IfEntry->if_speed);
131 indent_printf("if_physaddr: %s\n", dbg_print_physaddr(IfEntry->if_physaddr, IfEntry->if_physaddrlen));
132 indent_printf("if_adminstatus: %lu\n", IfEntry->if_adminstatus);
133 indent_printf("if_operstatus: %lu\n", IfEntry->if_operstatus);
134 indent_printf("if_lastchange: %lu\n", IfEntry->if_lastchange);
135 indent_printf("if_inoctets: %lu\n", IfEntry->if_inoctets);
136 indent_printf("if_inucastpkts: %lu\n", IfEntry->if_inucastpkts);
137 indent_printf("if_innucastpkts: %lu\n", IfEntry->if_innucastpkts);
138 indent_printf("if_indiscards: %lu\n", IfEntry->if_indiscards);
139 indent_printf("if_inerrors: %lu\n", IfEntry->if_inerrors);
140 indent_printf("if_inunknownprotos: %lu\n", IfEntry->if_inunknownprotos);
141 indent_printf("if_outoctets: %lu\n", IfEntry->if_outoctets);
142 indent_printf("if_outucastpkts: %lu\n", IfEntry->if_outucastpkts);
143 indent_printf("if_outnucastpkts: %lu\n", IfEntry->if_outnucastpkts);
144 indent_printf("if_outdiscards: %lu\n", IfEntry->if_outdiscards);
145 indent_printf("if_outerrors: %lu\n", IfEntry->if_outerrors);
146 indent_printf("if_outqlen: %lu\n", IfEntry->if_outqlen);
147 indent_printf("if_descr: %*s\n", IfEntry->if_descrlen, IfEntry->if_descr);
148 IndentationLevel--;
149
150 HeapFree(GetProcessHeap(), 0, IfEntry);
151 }
152
153 static
154 void
155 test_IP_MIB_STATS(
156 TDIEntityID Id,
157 ULONG EntityType)
158 {
159 IPSNMPInfo IpSnmpInfo;
160 TCP_REQUEST_QUERY_INFORMATION_EX Request;
161 ULONG BufferSize = 0;
162 BOOL Result;
163
164 /* Not valid for other entity types */
165 if (EntityType != CL_NL_IP)
166 return;
167
168 ZeroMemory(&IpSnmpInfo, sizeof(IpSnmpInfo));
169
170 ZeroMemory(&Request, sizeof(Request));
171 Request.ID.toi_entity = Id;
172 Request.ID.toi_class = INFO_CLASS_PROTOCOL;
173 Request.ID.toi_type = INFO_TYPE_PROVIDER;
174 Request.ID.toi_id = IP_MIB_STATS_ID;
175
176 Result = DeviceIoControl(
177 TcpFileHandle,
178 IOCTL_TCP_QUERY_INFORMATION_EX,
179 &Request,
180 sizeof(Request),
181 &IpSnmpInfo,
182 sizeof(IpSnmpInfo),
183 &BufferSize,
184 NULL);
185 ok(Result, "DeviceIoControl failed.\n");
186
187 /* Dump it */
188 indent_printf("IP_MIB Statistics:\n");
189 IndentationLevel++;
190 indent_printf("ipsi_forwarding: %lu\n", IpSnmpInfo.ipsi_forwarding);
191 indent_printf("ipsi_defaultttl: %lu\n", IpSnmpInfo.ipsi_defaultttl);
192 indent_printf("ipsi_inreceives: %lu\n", IpSnmpInfo.ipsi_inreceives);
193 indent_printf("ipsi_inhdrerrors: %lu\n", IpSnmpInfo.ipsi_inhdrerrors);
194 indent_printf("ipsi_inaddrerrors: %lu\n", IpSnmpInfo.ipsi_inaddrerrors);
195 indent_printf("ipsi_forwdatagrams: %lu\n", IpSnmpInfo.ipsi_forwdatagrams);
196 indent_printf("ipsi_inunknownprotos: %lu\n", IpSnmpInfo.ipsi_inunknownprotos);
197 indent_printf("ipsi_indiscards: %lu\n", IpSnmpInfo.ipsi_indiscards);
198 indent_printf("ipsi_indelivers: %lu\n", IpSnmpInfo.ipsi_indelivers);
199 indent_printf("ipsi_outrequests: %lu\n", IpSnmpInfo.ipsi_outrequests);
200 indent_printf("ipsi_routingdiscards: %lu\n", IpSnmpInfo.ipsi_routingdiscards);
201 indent_printf("ipsi_outdiscards: %lu\n", IpSnmpInfo.ipsi_outdiscards);
202 indent_printf("ipsi_outnoroutes: %lu\n", IpSnmpInfo.ipsi_outnoroutes);
203 indent_printf("ipsi_reasmtimeout: %lu\n", IpSnmpInfo.ipsi_reasmtimeout);
204 indent_printf("ipsi_reasmreqds: %lu\n", IpSnmpInfo.ipsi_reasmreqds);
205 indent_printf("ipsi_reasmoks: %lu\n", IpSnmpInfo.ipsi_reasmoks);
206 indent_printf("ipsi_reasmfails: %lu\n", IpSnmpInfo.ipsi_reasmfails);
207 indent_printf("ipsi_fragoks: %lu\n", IpSnmpInfo.ipsi_fragoks);
208 indent_printf("ipsi_fragfails: %lu\n", IpSnmpInfo.ipsi_fragfails);
209 indent_printf("ipsi_fragcreates: %lu\n", IpSnmpInfo.ipsi_fragcreates);
210 indent_printf("ipsi_numif: %lu\n", IpSnmpInfo.ipsi_numif);
211 indent_printf("ipsi_numaddr: %lu\n", IpSnmpInfo.ipsi_numaddr);
212 indent_printf("ipsi_numroutes: %lu\n", IpSnmpInfo.ipsi_numroutes);
213
214 if (IpSnmpInfo.ipsi_numaddr != 0)
215 {
216 IPAddrEntry* AddrEntries;
217 ULONG i;
218
219 AddrEntries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, IpSnmpInfo.ipsi_numaddr * sizeof(AddrEntries[0]));
220 ok(AddrEntries != NULL, "\n");
221
222 ZeroMemory(&Request, sizeof(Request));
223 Request.ID.toi_entity = Id;
224 Request.ID.toi_class = INFO_CLASS_PROTOCOL;
225 Request.ID.toi_type = INFO_TYPE_PROVIDER;
226 Request.ID.toi_id = IP_MIB_ADDRTABLE_ENTRY_ID;
227
228 Result = DeviceIoControl(
229 TcpFileHandle,
230 IOCTL_TCP_QUERY_INFORMATION_EX,
231 &Request,
232 sizeof(Request),
233 AddrEntries,
234 IpSnmpInfo.ipsi_numaddr * sizeof(AddrEntries[0]),
235 &BufferSize,
236 NULL);
237 ok(Result, "DeviceIoControl failed.\n");
238 ok_long(BufferSize, IpSnmpInfo.ipsi_numaddr * sizeof(AddrEntries[0]));
239
240 for(i = 0; i < IpSnmpInfo.ipsi_numaddr; i++)
241 {
242 CHAR AddressString[16];
243 struct in_addr Addr;
244
245 Addr.S_un.S_addr = AddrEntries[i].iae_addr;
246 RtlIpv4AddressToStringA(&Addr, AddressString);
247
248 indent_printf("Address %lu: %s\n", i, AddressString);
249
250 IndentationLevel++;
251
252 indent_printf("iae_addr: %lx\n", AddrEntries[i].iae_addr);
253 indent_printf("iae_index: %lu\n", AddrEntries[i].iae_index);
254 Addr.S_un.S_addr = AddrEntries[i].iae_mask;
255 RtlIpv4AddressToStringA(&Addr, AddressString);
256 indent_printf("iae_mask: %lx (%s)\n", AddrEntries[i].iae_mask, AddressString);
257 indent_printf("iae_bcastaddr: %lu\n", AddrEntries[i].iae_bcastaddr);
258 indent_printf("iae_reasmsize: %lu\n", AddrEntries[i].iae_reasmsize);
259 indent_printf("iae_context: %u\n", AddrEntries[i].iae_context);
260
261 {
262 IPInterfaceInfo* InterfaceInfo;
263
264 /* Get the interface info */
265 BufferSize = sizeof(IPInterfaceInfo) + MAX_PHYSADDR_SIZE;
266 InterfaceInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferSize);
267 ok(InterfaceInfo != NULL, "\n");
268
269 Request.ID.toi_id = IP_INTFC_INFO_ID;
270 Request.Context[0] = AddrEntries[i].iae_addr;
271 Result = DeviceIoControl(
272 TcpFileHandle,
273 IOCTL_TCP_QUERY_INFORMATION_EX,
274 &Request,
275 sizeof(Request),
276 InterfaceInfo,
277 BufferSize,
278 &BufferSize,
279 NULL);
280 ok(Result, "DeviceIoControl failed.\n");
281
282 indent_printf("Interface info:\n");
283 IndentationLevel++;
284
285 indent_printf("iii_flags: %lu\n", InterfaceInfo->iii_flags);
286 indent_printf("iii_mtu : %lu\n", InterfaceInfo->iii_mtu);
287 indent_printf("iii_speed: %lu\n", InterfaceInfo->iii_speed);
288 indent_printf("iii_physaddr: %s\n", dbg_print_physaddr(InterfaceInfo->iii_addr, InterfaceInfo->iii_addrlength));
289
290 IndentationLevel--;
291 }
292
293 IndentationLevel--;
294 }
295
296 HeapFree(GetProcessHeap(), 0, AddrEntries);
297 }
298
299 /* See for the routes */
300 if (IpSnmpInfo.ipsi_numroutes)
301 {
302 IPRouteEntry* RouteEntries;
303 ULONG i;
304
305 RouteEntries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, IpSnmpInfo.ipsi_numroutes * sizeof(RouteEntries[0]));
306 ok(RouteEntries != NULL, "\n");
307
308 ZeroMemory(&Request, sizeof(Request));
309 Request.ID.toi_entity = Id;
310 Request.ID.toi_class = INFO_CLASS_PROTOCOL;
311 Request.ID.toi_type = INFO_TYPE_PROVIDER;
312 Request.ID.toi_id = IP_MIB_ARPTABLE_ENTRY_ID;
313
314 Result = DeviceIoControl(
315 TcpFileHandle,
316 IOCTL_TCP_QUERY_INFORMATION_EX,
317 &Request,
318 sizeof(Request),
319 RouteEntries,
320 IpSnmpInfo.ipsi_numroutes * sizeof(RouteEntries[0]),
321 &BufferSize,
322 NULL);
323 ok(Result, "DeviceIoControl failed.\n");
324 ok_long(BufferSize, IpSnmpInfo.ipsi_numroutes * sizeof(RouteEntries[0]));
325
326 for (i = 0; i < IpSnmpInfo.ipsi_numroutes; i++)
327 {
328 CHAR AddressString[16];
329 struct in_addr Addr;
330
331 Addr.S_un.S_addr = RouteEntries[i].ire_dest;
332 RtlIpv4AddressToStringA(&Addr, AddressString);
333
334 indent_printf("Route %lu:\n", i);
335
336 IndentationLevel++;
337
338 indent_printf("ire_dest: %s (%lx)\n", AddressString, RouteEntries[i].ire_dest);
339 indent_printf("ire_index: %lu\n", RouteEntries[i].ire_index);
340 indent_printf("ire_metric1: %#lx\n", RouteEntries[i].ire_metric1);
341 indent_printf("ire_metric2: %#lx\n", RouteEntries[i].ire_metric2);
342 indent_printf("ire_metric3: %#lx\n", RouteEntries[i].ire_metric3);
343 indent_printf("ire_metric4: %#lx\n", RouteEntries[i].ire_metric4);
344 Addr.S_un.S_addr = RouteEntries[i].ire_nexthop;
345 RtlIpv4AddressToStringA(&Addr, AddressString);
346 indent_printf("ire_nexthop: %s (%lx)\n", AddressString, RouteEntries[i].ire_nexthop);
347 indent_printf("ire_type: %lu\n", RouteEntries[i].ire_type);
348 indent_printf("ire_proto: %lu\n", RouteEntries[i].ire_proto);
349 indent_printf("ire_age: %lu\n", RouteEntries[i].ire_age);
350 Addr.S_un.S_addr = RouteEntries[i].ire_mask;
351 RtlIpv4AddressToStringA(&Addr, AddressString);
352 indent_printf("ire_mask: %s (%lx)\n", AddressString, RouteEntries[i].ire_mask);
353 indent_printf("ire_metric5: %lx\n", RouteEntries[i].ire_metric5);
354 indent_printf("ire_context: %lx\n", RouteEntries[i].ire_context);
355
356 IndentationLevel--;
357 }
358 }
359
360 IndentationLevel--;
361 }
362
363 typedef struct ARPInfo
364 {
365 unsigned long ai_numroutes;
366 unsigned long ai_unknown;
367 } ARPInfo;
368
369 typedef struct ARPEntry
370 {
371 unsigned long ae_index;
372 unsigned long ae_physaddrlen;
373 unsigned char ae_physaddr[MAX_PHYSADDR_SIZE];
374 unsigned long ae_address;
375 unsigned long ae_unknown;
376 } ARPEntry;
377
378 static
379 void
380 test_AT_ARP_STATS(
381 TDIEntityID Id,
382 ULONG EntityType)
383 {
384 ARPInfo ArpInfo;
385 TCP_REQUEST_QUERY_INFORMATION_EX Request;
386 ULONG BufferSize = 0;
387 BOOL Result;
388
389 /* Not valid for other entity types */
390 if (EntityType != AT_ARP)
391 return;
392
393 ZeroMemory(&Request, sizeof(Request));
394 Request.ID.toi_entity = Id;
395 Request.ID.toi_class = INFO_CLASS_PROTOCOL;
396 Request.ID.toi_type = INFO_TYPE_PROVIDER;
397 Request.ID.toi_id = AT_MIB_ADDRXLAT_INFO_ID;
398
399 Result = DeviceIoControl(
400 TcpFileHandle,
401 IOCTL_TCP_QUERY_INFORMATION_EX,
402 &Request,
403 sizeof(Request),
404 &ArpInfo,
405 sizeof(ArpInfo),
406 &BufferSize,
407 NULL);
408 ok(Result, "DeviceIoControl failed.\n");
409 ok_long(BufferSize, sizeof(ArpInfo));
410
411 indent_printf("ARP Info:\n");
412 IndentationLevel++;
413
414 indent_printf("ai_numroutes: %lu\n", ArpInfo.ai_numroutes);
415 indent_printf("ai_unknown: %lx\n", ArpInfo.ai_unknown);
416
417 if (ArpInfo.ai_numroutes)
418 {
419 ARPEntry* ArpEntries;
420 ULONG i;
421
422 Request.ID.toi_id = AT_MIB_ADDRXLAT_ENTRY_ID;
423
424 ArpEntries = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ArpInfo.ai_numroutes * sizeof(ArpEntries[0]));
425 ok(ArpEntries != NULL, "\n");
426
427 Result = DeviceIoControl(
428 TcpFileHandle,
429 IOCTL_TCP_QUERY_INFORMATION_EX,
430 &Request,
431 sizeof(Request),
432 ArpEntries,
433 ArpInfo.ai_numroutes * sizeof(ArpEntries[0]),
434 &BufferSize,
435 NULL);
436 ok(Result, "DeviceIoControl failed.\n");
437 ok_long(BufferSize, ArpInfo.ai_numroutes * sizeof(ArpEntries[0]));
438
439 for (i = 0; i < ArpInfo.ai_numroutes; i++)
440 {
441 CHAR AddressString[16];
442 struct in_addr Addr;
443
444 Addr.S_un.S_addr = ArpEntries[i].ae_address;
445 RtlIpv4AddressToStringA(&Addr, AddressString);
446
447 indent_printf("ARP Entry %lu:\n", i);
448
449 IndentationLevel++;
450
451 indent_printf("ae_index: %lu\n", ArpEntries[i].ae_index);
452 indent_printf("ae_physaddr: %s\n", dbg_print_physaddr(ArpEntries[i].ae_physaddr, ArpEntries[i].ae_physaddrlen));
453 indent_printf("ae_address: %lx (%s)\n", ArpEntries[i].ae_address, AddressString);
454 indent_printf("ae_unknown: %lu.\n", ArpEntries[i].ae_unknown);
455
456 IndentationLevel--;
457 }
458
459 HeapFree(GetProcessHeap(), 0, ArpEntries);
460 }
461
462 IndentationLevel--;
463 }
464
465 START_TEST(tcp_info)
466 {
467 TDIEntityID* Entities;
468 DWORD BufferSize;
469 BOOL Result;
470 ULONG i, EntityCount;
471 TCP_REQUEST_QUERY_INFORMATION_EX Request;
472
473 /* Open a control channel file for TCP */
474 TcpFileHandle = CreateFileW(
475 L"\\\\.\\Tcp",
476 FILE_READ_DATA | FILE_WRITE_DATA,
477 FILE_SHARE_READ | FILE_SHARE_WRITE,
478 NULL,
479 OPEN_EXISTING,
480 0,
481 NULL);
482 ok(TcpFileHandle != INVALID_HANDLE_VALUE, "CreateFile failed, GLE %lu\n", GetLastError());
483
484 /* Try the IOCTL */
485 BufferSize = 0;
486 Result = DeviceIoControl(
487 TcpFileHandle,
488 IOCTL_TCP_QUERY_INFORMATION_EX,
489 NULL,
490 0,
491 NULL,
492 0,
493 &BufferSize,
494 NULL);
495 ok(!Result, "DeviceIoControl succeeded.\n");
496 ok_long(GetLastError(), ERROR_INVALID_PARAMETER);
497 ok_long(BufferSize, 0);
498
499 ZeroMemory(&Request, sizeof(Request));
500 Request.ID.toi_entity.tei_entity = GENERIC_ENTITY;
501 Request.ID.toi_entity.tei_instance = 0;
502 Request.ID.toi_class = INFO_CLASS_GENERIC;
503 Request.ID.toi_type = INFO_TYPE_PROVIDER;
504 Request.ID.toi_id = ENTITY_LIST_ID;
505
506 BufferSize = 0;
507 Result = DeviceIoControl(
508 TcpFileHandle,
509 IOCTL_TCP_QUERY_INFORMATION_EX,
510 &Request,
511 sizeof(Request),
512 NULL,
513 0,
514 &BufferSize,
515 NULL);
516 ok(!Result, "DeviceIoControl succeeded.\n");
517 ok_long(GetLastError(), ERROR_INVALID_PARAMETER);
518 ok_long(BufferSize, 0);
519
520 BufferSize = 4 * sizeof(Entities[0]);
521 Entities = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferSize);
522 ok(Entities != NULL, "\n");
523
524 while (TRUE)
525 {
526 Result = DeviceIoControl(
527 TcpFileHandle,
528 IOCTL_TCP_QUERY_INFORMATION_EX,
529 &Request,
530 sizeof(Request),
531 Entities,
532 BufferSize,
533 &BufferSize,
534 NULL);
535
536 if (Result)
537 break;
538
539 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
540 break;
541
542 BufferSize *= 2;
543 Entities = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Entities, BufferSize);
544 ok(Entities != NULL, "\n");
545 }
546
547 ok(Result, "DeviceIoControl failed!\n");
548 EntityCount = BufferSize / sizeof(Entities[0]);
549 trace("Got %lu entities.\n", EntityCount);
550
551 for (i = 0; i < EntityCount; i++)
552 {
553 ULONG EntityType;
554
555 /* Get the type */
556 Request.ID.toi_entity = Entities[i];
557 Request.ID.toi_class = INFO_CLASS_GENERIC;
558 Request.ID.toi_type = INFO_TYPE_PROVIDER;
559 Request.ID.toi_id = ENTITY_TYPE_ID;
560
561 Result = DeviceIoControl(
562 TcpFileHandle,
563 IOCTL_TCP_QUERY_INFORMATION_EX,
564 &Request,
565 sizeof(Request),
566 &EntityType,
567 sizeof(EntityType),
568 &BufferSize,
569 NULL);
570 ok(Result, "DeviceIoControl failed.\n");
571
572 printf("Entity %lu: %#lx, %#lx, type %#lx\n", i, Entities[i].tei_entity, Entities[i].tei_instance, EntityType);
573 test_IF_MIB_STATS(Entities[i], EntityType);
574 test_IP_MIB_STATS(Entities[i], EntityType);
575 test_AT_ARP_STATS(Entities[i], EntityType);
576 }
577
578 HeapFree(GetProcessHeap(), 0, Entities);
579 CloseHandle(TcpFileHandle);
580 }