4 * Copyright (C) 2003 Juan Lang
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 * Some observations that an automated test can't produce:
23 * An adapter index is a key for an adapter. That is, if an index is returned
24 * from one API, that same index may be used successfully in another API, as
25 * long as the adapter remains present.
26 * If the adapter is removed and reinserted, however, the index may change (and
27 * indeed it does change on Win2K).
29 * The Name field of the IP_ADAPTER_INDEX_MAP entries returned by
30 * GetInterfaceInfo is declared as a wide string, but the bytes are actually
31 * an ASCII string on some versions of the IP helper API under Win9x. This was
32 * apparently an MS bug, it's corrected in later versions.
34 * The DomainName field of FIXED_INFO isn't NULL-terminated on Win98.
42 #include "wine/test.h"
46 static HMODULE hLibrary = NULL;
48 typedef DWORD (WINAPI *GetNumberOfInterfacesFunc)(PDWORD);
49 typedef DWORD (WINAPI *GetIpAddrTableFunc)(PMIB_IPADDRTABLE,PULONG,BOOL);
50 typedef DWORD (WINAPI *GetIfEntryFunc)(PMIB_IFROW);
51 typedef DWORD (WINAPI *GetFriendlyIfIndexFunc)(DWORD);
52 typedef DWORD (WINAPI *GetIfTableFunc)(PMIB_IFTABLE,PULONG,BOOL);
53 typedef DWORD (WINAPI *GetIpForwardTableFunc)(PMIB_IPFORWARDTABLE,PULONG,BOOL);
54 typedef DWORD (WINAPI *GetIpNetTableFunc)(PMIB_IPNETTABLE,PULONG,BOOL);
55 typedef DWORD (WINAPI *GetInterfaceInfoFunc)(PIP_INTERFACE_INFO,PULONG);
56 typedef DWORD (WINAPI *GetAdaptersInfoFunc)(PIP_ADAPTER_INFO,PULONG);
57 typedef DWORD (WINAPI *GetNetworkParamsFunc)(PFIXED_INFO,PULONG);
58 typedef DWORD (WINAPI *GetIcmpStatisticsFunc)(PMIB_ICMP);
59 typedef DWORD (WINAPI *GetIpStatisticsFunc)(PMIB_IPSTATS);
60 typedef DWORD (WINAPI *GetTcpStatisticsFunc)(PMIB_TCPSTATS);
61 typedef DWORD (WINAPI *GetUdpStatisticsFunc)(PMIB_UDPSTATS);
62 typedef DWORD (WINAPI *GetTcpTableFunc)(PMIB_TCPTABLE,PDWORD,BOOL);
63 typedef DWORD (WINAPI *GetUdpTableFunc)(PMIB_UDPTABLE,PDWORD,BOOL);
64 typedef DWORD (WINAPI *GetPerAdapterInfoFunc)(ULONG,PIP_PER_ADAPTER_INFO,PULONG);
66 static GetNumberOfInterfacesFunc gGetNumberOfInterfaces = NULL;
67 static GetIpAddrTableFunc gGetIpAddrTable = NULL;
68 static GetIfEntryFunc gGetIfEntry = NULL;
69 static GetFriendlyIfIndexFunc gGetFriendlyIfIndex = NULL;
70 static GetIfTableFunc gGetIfTable = NULL;
71 static GetIpForwardTableFunc gGetIpForwardTable = NULL;
72 static GetIpNetTableFunc gGetIpNetTable = NULL;
73 static GetInterfaceInfoFunc gGetInterfaceInfo = NULL;
74 static GetAdaptersInfoFunc gGetAdaptersInfo = NULL;
75 static GetNetworkParamsFunc gGetNetworkParams = NULL;
76 static GetIcmpStatisticsFunc gGetIcmpStatistics = NULL;
77 static GetIpStatisticsFunc gGetIpStatistics = NULL;
78 static GetTcpStatisticsFunc gGetTcpStatistics = NULL;
79 static GetUdpStatisticsFunc gGetUdpStatistics = NULL;
80 static GetTcpTableFunc gGetTcpTable = NULL;
81 static GetUdpTableFunc gGetUdpTable = NULL;
82 static GetPerAdapterInfoFunc gGetPerAdapterInfo = NULL;
84 static void loadIPHlpApi(void)
86 hLibrary = LoadLibraryA("iphlpapi.dll");
88 gGetNumberOfInterfaces = (GetNumberOfInterfacesFunc)GetProcAddress(
89 hLibrary, "GetNumberOfInterfaces");
90 gGetIpAddrTable = (GetIpAddrTableFunc)GetProcAddress(
91 hLibrary, "GetIpAddrTable");
92 gGetIfEntry = (GetIfEntryFunc)GetProcAddress(
93 hLibrary, "GetIfEntry");
94 gGetFriendlyIfIndex = (GetFriendlyIfIndexFunc)GetProcAddress(
95 hLibrary, "GetFriendlyIfIndex");
96 gGetIfTable = (GetIfTableFunc)GetProcAddress(
97 hLibrary, "GetIfTable");
98 gGetIpForwardTable = (GetIpForwardTableFunc)GetProcAddress(
99 hLibrary, "GetIpForwardTable");
100 gGetIpNetTable = (GetIpNetTableFunc)GetProcAddress(
101 hLibrary, "GetIpNetTable");
102 gGetInterfaceInfo = (GetInterfaceInfoFunc)GetProcAddress(
103 hLibrary, "GetInterfaceInfo");
104 gGetAdaptersInfo = (GetAdaptersInfoFunc)GetProcAddress(
105 hLibrary, "GetAdaptersInfo");
106 gGetNetworkParams = (GetNetworkParamsFunc)GetProcAddress(
107 hLibrary, "GetNetworkParams");
108 gGetIcmpStatistics = (GetIcmpStatisticsFunc)GetProcAddress(
109 hLibrary, "GetIcmpStatistics");
110 gGetIpStatistics = (GetIpStatisticsFunc)GetProcAddress(
111 hLibrary, "GetIpStatistics");
112 gGetTcpStatistics = (GetTcpStatisticsFunc)GetProcAddress(
113 hLibrary, "GetTcpStatistics");
114 gGetUdpStatistics = (GetUdpStatisticsFunc)GetProcAddress(
115 hLibrary, "GetUdpStatistics");
116 gGetTcpTable = (GetTcpTableFunc)GetProcAddress(
117 hLibrary, "GetTcpTable");
118 gGetUdpTable = (GetUdpTableFunc)GetProcAddress(
119 hLibrary, "GetUdpTable");
120 gGetPerAdapterInfo = (GetPerAdapterInfoFunc)GetProcAddress(hLibrary, "GetPerAdapterInfo");
124 static void freeIPHlpApi(void)
127 gGetNumberOfInterfaces = NULL;
128 gGetIpAddrTable = NULL;
130 gGetFriendlyIfIndex = NULL;
132 gGetIpForwardTable = NULL;
133 gGetIpNetTable = NULL;
134 gGetInterfaceInfo = NULL;
135 gGetAdaptersInfo = NULL;
136 gGetNetworkParams = NULL;
137 gGetIcmpStatistics = NULL;
138 gGetIpStatistics = NULL;
139 gGetTcpStatistics = NULL;
140 gGetUdpStatistics = NULL;
143 FreeLibrary(hLibrary);
149 still-to-be-tested 98-only functions:
150 GetUniDirectionalAdapterInfo
152 static void testWin98OnlyFunctions(void)
156 static void testGetNumberOfInterfaces(void)
158 if (gGetNumberOfInterfaces) {
159 DWORD apiReturn, numInterfaces;
161 /* Crashes on Vista */
163 apiReturn = gGetNumberOfInterfaces(NULL), numInterfaces;
164 if (apiReturn == ERROR_NOT_SUPPORTED)
166 ok(apiReturn == ERROR_INVALID_PARAMETER,
167 "GetNumberOfInterfaces(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n",
171 apiReturn = gGetNumberOfInterfaces(&numInterfaces);
172 if (apiReturn == ERROR_NOT_SUPPORTED) {
173 skip("GetNumberOfInterfaces is not supported\n");
176 ok(apiReturn == NO_ERROR,
177 "GetNumberOfInterfaces returned %d, expected 0\n", apiReturn);
181 static void testGetIfEntry(DWORD index)
187 memset(&row, 0, sizeof(row));
188 apiReturn = gGetIfEntry(NULL);
189 if (apiReturn == ERROR_NOT_SUPPORTED) {
190 skip("GetIfEntry is not supported\n");
193 ok(apiReturn == ERROR_INVALID_PARAMETER,
194 "GetIfEntry(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n",
196 row.dwIndex = -1; /* hope that's always bogus! */
197 apiReturn = gGetIfEntry(&row);
198 ok(apiReturn == ERROR_INVALID_DATA ||
199 apiReturn == ERROR_FILE_NOT_FOUND /* Vista */,
200 "GetIfEntry(bogus row) returned %d, expected ERROR_INVALID_DATA or ERROR_FILE_NOT_FOUND\n",
203 apiReturn = gGetIfEntry(&row);
204 ok(apiReturn == NO_ERROR,
205 "GetIfEntry returned %d, expected NO_ERROR\n", apiReturn);
209 static void testGetIpAddrTable(void)
211 if (gGetIpAddrTable) {
215 apiReturn = gGetIpAddrTable(NULL, NULL, FALSE);
216 if (apiReturn == ERROR_NOT_SUPPORTED) {
217 skip("GetIpAddrTable is not supported\n");
220 ok(apiReturn == ERROR_INVALID_PARAMETER,
221 "GetIpAddrTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n",
223 apiReturn = gGetIpAddrTable(NULL, &dwSize, FALSE);
224 ok(apiReturn == ERROR_INSUFFICIENT_BUFFER,
225 "GetIpAddrTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n",
227 if (apiReturn == ERROR_INSUFFICIENT_BUFFER) {
228 PMIB_IPADDRTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
230 apiReturn = gGetIpAddrTable(buf, &dwSize, FALSE);
231 ok(apiReturn == NO_ERROR,
232 "GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n",
234 if (apiReturn == NO_ERROR && buf->dwNumEntries)
235 testGetIfEntry(buf->table[0].dwIndex);
236 HeapFree(GetProcessHeap(), 0, buf);
241 static void testGetIfTable(void)
247 apiReturn = gGetIfTable(NULL, NULL, FALSE);
248 if (apiReturn == ERROR_NOT_SUPPORTED) {
249 skip("GetIfTable is not supported\n");
252 ok(apiReturn == ERROR_INVALID_PARAMETER,
253 "GetIfTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n",
255 apiReturn = gGetIfTable(NULL, &dwSize, FALSE);
256 ok(apiReturn == ERROR_INSUFFICIENT_BUFFER,
257 "GetIfTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n",
259 if (apiReturn == ERROR_INSUFFICIENT_BUFFER) {
260 PMIB_IFTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
262 apiReturn = gGetIfTable(buf, &dwSize, FALSE);
263 ok(apiReturn == NO_ERROR,
264 "GetIfTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n\n",
266 HeapFree(GetProcessHeap(), 0, buf);
271 static void testGetIpForwardTable(void)
273 if (gGetIpForwardTable) {
277 apiReturn = gGetIpForwardTable(NULL, NULL, FALSE);
278 if (apiReturn == ERROR_NOT_SUPPORTED) {
279 skip("GetIpForwardTable is not supported\n");
282 ok(apiReturn == ERROR_INVALID_PARAMETER,
283 "GetIpForwardTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n",
285 apiReturn = gGetIpForwardTable(NULL, &dwSize, FALSE);
286 ok(apiReturn == ERROR_INSUFFICIENT_BUFFER,
287 "GetIpForwardTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n",
289 if (apiReturn == ERROR_INSUFFICIENT_BUFFER) {
290 PMIB_IPFORWARDTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
292 apiReturn = gGetIpForwardTable(buf, &dwSize, FALSE);
293 ok(apiReturn == NO_ERROR,
294 "GetIpForwardTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n",
296 HeapFree(GetProcessHeap(), 0, buf);
301 static void testGetIpNetTable(void)
303 if (gGetIpNetTable) {
307 apiReturn = gGetIpNetTable(NULL, NULL, FALSE);
308 if (apiReturn == ERROR_NOT_SUPPORTED) {
309 skip("GetIpNetTable is not supported\n");
312 ok(apiReturn == ERROR_INVALID_PARAMETER,
313 "GetIpNetTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n",
315 apiReturn = gGetIpNetTable(NULL, &dwSize, FALSE);
316 ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_INSUFFICIENT_BUFFER,
317 "GetIpNetTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_NO_DATA or ERROR_INSUFFICIENT_BUFFER\n",
319 if (apiReturn == ERROR_NO_DATA)
320 ; /* empty ARP table's okay */
321 else if (apiReturn == ERROR_INSUFFICIENT_BUFFER) {
322 PMIB_IPNETTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
324 apiReturn = gGetIpNetTable(buf, &dwSize, FALSE);
325 ok(apiReturn == NO_ERROR ||
326 apiReturn == ERROR_NO_DATA, /* empty ARP table's okay */
327 "GetIpNetTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n",
329 HeapFree(GetProcessHeap(), 0, buf);
334 static void testGetIcmpStatistics(void)
336 if (gGetIcmpStatistics) {
340 /* Crashes on Vista */
342 apiReturn = gGetIcmpStatistics(NULL);
343 if (apiReturn == ERROR_NOT_SUPPORTED)
345 ok(apiReturn == ERROR_INVALID_PARAMETER,
346 "GetIcmpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n",
350 apiReturn = gGetIcmpStatistics(&stats);
351 if (apiReturn == ERROR_NOT_SUPPORTED)
353 skip("GetIcmpStatistics is not supported\n");
356 ok(apiReturn == NO_ERROR,
357 "GetIcmpStatistics returned %d, expected NO_ERROR\n", apiReturn);
361 static void testGetIpStatistics(void)
363 if (gGetIpStatistics) {
367 apiReturn = gGetIpStatistics(NULL);
368 if (apiReturn == ERROR_NOT_SUPPORTED) {
369 skip("GetIpStatistics is not supported\n");
372 ok(apiReturn == ERROR_INVALID_PARAMETER,
373 "GetIpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n",
375 apiReturn = gGetIpStatistics(&stats);
376 ok(apiReturn == NO_ERROR,
377 "GetIpStatistics returned %d, expected NO_ERROR\n", apiReturn);
381 static void testGetTcpStatistics(void)
383 if (gGetTcpStatistics) {
387 apiReturn = gGetTcpStatistics(NULL);
388 if (apiReturn == ERROR_NOT_SUPPORTED) {
389 skip("GetTcpStatistics is not supported\n");
392 ok(apiReturn == ERROR_INVALID_PARAMETER,
393 "GetTcpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n",
395 apiReturn = gGetTcpStatistics(&stats);
396 ok(apiReturn == NO_ERROR,
397 "GetTcpStatistics returned %d, expected NO_ERROR\n", apiReturn);
401 static void testGetUdpStatistics(void)
403 if (gGetUdpStatistics) {
407 apiReturn = gGetUdpStatistics(NULL);
408 if (apiReturn == ERROR_NOT_SUPPORTED) {
409 skip("GetUdpStatistics is not supported\n");
412 ok(apiReturn == ERROR_INVALID_PARAMETER,
413 "GetUdpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n",
415 apiReturn = gGetUdpStatistics(&stats);
416 ok(apiReturn == NO_ERROR,
417 "GetUdpStatistics returned %d, expected NO_ERROR\n", apiReturn);
421 static void testGetTcpTable(void)
427 apiReturn = gGetTcpTable(NULL, NULL, FALSE);
428 if (apiReturn == ERROR_NOT_SUPPORTED) {
429 skip("GetTcpTable is not supported\n");
432 ok(apiReturn == ERROR_INVALID_PARAMETER,
433 "GetTcpTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n",
435 apiReturn = gGetTcpTable(NULL, &dwSize, FALSE);
436 ok(apiReturn == ERROR_INSUFFICIENT_BUFFER ||
437 broken(apiReturn == ERROR_NO_DATA), /* win95 */
438 "GetTcpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n",
440 if (apiReturn == ERROR_INSUFFICIENT_BUFFER) {
441 PMIB_TCPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
443 apiReturn = gGetTcpTable(buf, &dwSize, FALSE);
444 ok(apiReturn == NO_ERROR,
445 "GetTcpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n",
447 HeapFree(GetProcessHeap(), 0, buf);
452 static void testGetUdpTable(void)
458 apiReturn = gGetUdpTable(NULL, NULL, FALSE);
459 if (apiReturn == ERROR_NOT_SUPPORTED) {
460 skip("GetUdpTable is not supported\n");
463 ok(apiReturn == ERROR_INVALID_PARAMETER,
464 "GetUdpTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n",
466 apiReturn = gGetUdpTable(NULL, &dwSize, FALSE);
467 ok(apiReturn == ERROR_INSUFFICIENT_BUFFER,
468 "GetUdpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n",
470 if (apiReturn != ERROR_INSUFFICIENT_BUFFER) {
471 PMIB_UDPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
473 apiReturn = gGetUdpTable(buf, &dwSize, FALSE);
474 ok(apiReturn == NO_ERROR,
475 "GetUdpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n",
477 HeapFree(GetProcessHeap(), 0, buf);
483 still-to-be-tested NT4-onward functions:
497 static void testWinNT4Functions(void)
499 testGetNumberOfInterfaces();
500 testGetIpAddrTable();
502 testGetIpForwardTable();
504 testGetIcmpStatistics();
505 testGetIpStatistics();
506 testGetTcpStatistics();
507 testGetUdpStatistics();
512 static void testGetInterfaceInfo(void)
514 if (gGetInterfaceInfo) {
518 apiReturn = gGetInterfaceInfo(NULL, NULL);
519 if (apiReturn == ERROR_NOT_SUPPORTED) {
520 skip("GetInterfaceInfo is not supported\n");
523 ok(apiReturn == ERROR_INVALID_PARAMETER,
524 "GetInterfaceInfo returned %d, expected ERROR_INVALID_PARAMETER\n",
526 apiReturn = gGetInterfaceInfo(NULL, &len);
527 ok(apiReturn == ERROR_INSUFFICIENT_BUFFER,
528 "GetInterfaceInfo returned %d, expected ERROR_INSUFFICIENT_BUFFER\n",
530 if (apiReturn == ERROR_INSUFFICIENT_BUFFER) {
531 PIP_INTERFACE_INFO buf = HeapAlloc(GetProcessHeap(), 0, len);
533 apiReturn = gGetInterfaceInfo(buf, &len);
534 ok(apiReturn == NO_ERROR,
535 "GetInterfaceInfo(buf, &dwSize) returned %d, expected NO_ERROR\n",
537 HeapFree(GetProcessHeap(), 0, buf);
542 static void testGetAdaptersInfo(void)
544 if (gGetAdaptersInfo) {
548 apiReturn = gGetAdaptersInfo(NULL, NULL);
549 if (apiReturn == ERROR_NOT_SUPPORTED) {
550 skip("GetAdaptersInfo is not supported\n");
553 ok(apiReturn == ERROR_INVALID_PARAMETER,
554 "GetAdaptersInfo returned %d, expected ERROR_INVALID_PARAMETER\n",
556 apiReturn = gGetAdaptersInfo(NULL, &len);
557 ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_BUFFER_OVERFLOW,
558 "GetAdaptersInfo returned %d, expected ERROR_NO_DATA or ERROR_BUFFER_OVERFLOW\n",
560 if (apiReturn == ERROR_NO_DATA)
561 ; /* no adapter's, that's okay */
562 else if (apiReturn == ERROR_BUFFER_OVERFLOW) {
563 PIP_ADAPTER_INFO buf = HeapAlloc(GetProcessHeap(), 0, len);
565 apiReturn = gGetAdaptersInfo(buf, &len);
566 ok(apiReturn == NO_ERROR,
567 "GetAdaptersInfo(buf, &dwSize) returned %d, expected NO_ERROR\n",
569 HeapFree(GetProcessHeap(), 0, buf);
574 static void testGetNetworkParams(void)
576 if (gGetNetworkParams) {
580 apiReturn = gGetNetworkParams(NULL, NULL);
581 if (apiReturn == ERROR_NOT_SUPPORTED) {
582 skip("GetNetworkParams is not supported\n");
585 ok(apiReturn == ERROR_INVALID_PARAMETER,
586 "GetNetworkParams returned %d, expected ERROR_INVALID_PARAMETER\n",
588 apiReturn = gGetNetworkParams(NULL, &len);
589 ok(apiReturn == ERROR_BUFFER_OVERFLOW,
590 "GetNetworkParams returned %d, expected ERROR_BUFFER_OVERFLOW\n",
592 if (apiReturn == ERROR_BUFFER_OVERFLOW) {
593 PFIXED_INFO buf = HeapAlloc(GetProcessHeap(), 0, len);
595 apiReturn = gGetNetworkParams(buf, &len);
596 ok(apiReturn == NO_ERROR,
597 "GetNetworkParams(buf, &dwSize) returned %d, expected NO_ERROR\n",
599 HeapFree(GetProcessHeap(), 0, buf);
605 still-to-be-tested 98-onward functions:
611 static void testWin98Functions(void)
613 testGetInterfaceInfo();
614 testGetAdaptersInfo();
615 testGetNetworkParams();
618 static void testGetPerAdapterInfo(void)
623 if (!gGetPerAdapterInfo) return;
624 ret = gGetPerAdapterInfo(1, NULL, NULL);
625 if (ret == ERROR_NOT_SUPPORTED) {
626 skip("GetPerAdapterInfo is not supported\n");
629 ok( ret == ERROR_INVALID_PARAMETER, "got %u instead of ERROR_INVALID_PARAMETER\n", ret );
631 ret = gGetPerAdapterInfo(1, NULL, &needed);
632 if (ret == ERROR_NO_DATA) return; /* no such adapter */
633 ok( ret == ERROR_BUFFER_OVERFLOW, "got %u instead of ERROR_BUFFER_OVERFLOW\n", ret );
634 ok( needed != 0xdeadbeef, "needed not set\n" );
635 buffer = HeapAlloc( GetProcessHeap(), 0, needed );
636 ret = gGetPerAdapterInfo(1, buffer, &needed);
637 ok( ret == NO_ERROR, "got %u instead of NO_ERROR\n", ret );
638 HeapFree( GetProcessHeap(), 0, buffer );
642 still-to-be-tested 2K-onward functions:
655 static void testWin2KFunctions(void)
657 testGetPerAdapterInfo();
665 testWin98OnlyFunctions();
666 testWinNT4Functions();
667 testWin98Functions();
668 testWin2KFunctions();