Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/iphlpapi/ipstats.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index f09f042135..6ce322a8d1 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -2088,7 +2088,7 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE { char buf[512], *ptr; struct pid_map *map = NULL; - unsigned int dummy, num_entries = 0; + unsigned int num_entries = 0; int inode;
if (class >= TCP_TABLE_OWNER_PID_LISTENER) map = get_pid_map( &num_entries ); @@ -2097,9 +2097,9 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE ptr = fgets(buf, sizeof(buf), fp); while ((ptr = fgets(buf, sizeof(buf), fp))) { - if (sscanf( ptr, "%x: %x:%x %x:%x %x %*s %*s %*s %*s %*s %d", &dummy, + if (sscanf( ptr, "%*x: %x:%x %x:%x %x %*s %*s %*s %*s %*s %d", &row.dwLocalAddr, &row.dwLocalPort, &row.dwRemoteAddr, - &row.dwRemotePort, &row.dwState, &inode ) != 7) + &row.dwRemotePort, &row.dwState, &inode ) != 6) continue; row.dwLocalPort = htons( row.dwLocalPort ); row.dwRemotePort = htons( row.dwRemotePort ); @@ -2386,7 +2386,7 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE { char buf[512], *ptr; struct pid_map *map = NULL; - unsigned int dummy, num_entries = 0; + unsigned int num_entries = 0; int inode;
if (class >= UDP_TABLE_OWNER_PID) map = get_pid_map( &num_entries ); @@ -2395,8 +2395,8 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE ptr = fgets( buf, sizeof(buf), fp ); while ((ptr = fgets( buf, sizeof(buf), fp ))) { - if (sscanf( ptr, "%u: %x:%x %*s %*s %*s %*s %*s %*s %*s %d", &dummy, - &row.dwLocalAddr, &row.dwLocalPort, &inode ) != 4) + if (sscanf( ptr, "%*u: %x:%x %*s %*s %*s %*s %*s %*s %*s %d", + &row.dwLocalAddr, &row.dwLocalPort, &inode ) != 3) continue; row.dwLocalPort = htons( row.dwLocalPort );
@@ -2708,7 +2708,6 @@ DWORD build_udp6_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE unsigned int num_entries = 0; struct ipv6_addr_scope *addr_scopes; unsigned int addr_scopes_size = 0; - unsigned int dummy; int inode;
addr_scopes = get_ipv6_addr_scope_table(&addr_scopes_size); @@ -2721,9 +2720,9 @@ DWORD build_udp6_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE { DWORD *local_addr = (DWORD *)&row.ucLocalAddr;
- if (sscanf( ptr, "%u: %8x%8x%8x%8x:%x %*s %*s %*s %*s %*s %*s %*s %d", &dummy, + if (sscanf( ptr, "%*u: %8x%8x%8x%8x:%x %*s %*s %*s %*s %*s %*s %*s %d", &local_addr[0], &local_addr[1], &local_addr[2], &local_addr[3], - &row.dwLocalPort, &inode ) != 7) + &row.dwLocalPort, &inode ) != 6) continue; row.dwLocalScopeId = find_ipv6_addr_scope((const IN6_ADDR *)&row.ucLocalAddr, addr_scopes, addr_scopes_size); row.dwLocalPort = htons( row.dwLocalPort );
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- include/iphlpapi.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/iphlpapi.h b/include/iphlpapi.h index c618e733e7..da5819c842 100644 --- a/include/iphlpapi.h +++ b/include/iphlpapi.h @@ -79,6 +79,8 @@ DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS pStats, DWORD dwFamily);
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats);
+DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX pStats, DWORD dwFamily); + DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats);
DWORD WINAPI GetTcpStatisticsEx(PMIB_TCPSTATS pStats, DWORD dwFamily);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64874
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/iphlpapi/tests/iphlpapi.c | 55 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index a1fdf2716b..c41865f8c9 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -2233,36 +2233,39 @@ static void test_ConvertLengthToIpv4Mask(void)
static void test_GetUdp6Table(void) { - if (pGetUdp6Table) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetUdp6Table(NULL, &dwSize, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetUdp6Table is not supported\n"); - return; - } - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetUdp6Table(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", - apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_UDP6TABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + if (!pGetUdp6Table) { + win_skip("GetUdp6Table not available\n"); + return; + }
- apiReturn = pGetUdp6Table(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR, - "GetUdp6Table(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", - apiReturn); + apiReturn = pGetUdp6Table(NULL, &dwSize, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetUdp6Table is not supported\n"); + return; + } + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetUdp6Table(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_UDP6TABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
- if (apiReturn == NO_ERROR && winetest_debug > 1) - { - DWORD i; - trace( "UDP6 table: %u entries\n", buf->dwNumEntries ); - for (i = 0; i < buf->dwNumEntries; i++) - trace( "%u: %s%%%u:%u\n", - i, ntoa6(&buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalScopeId), ntohs(buf->table[i].dwLocalPort) ); - } - HeapFree(GetProcessHeap(), 0, buf); + apiReturn = pGetUdp6Table(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR, + "GetUdp6Table(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + apiReturn); + + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + DWORD i; + trace( "UDP6 table: %u entries\n", buf->dwNumEntries ); + for (i = 0; i < buf->dwNumEntries; i++) + trace( "%u: %s%%%u:%u\n", + i, ntoa6(&buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalScopeId), ntohs(buf->table[i].dwLocalPort) ); } + HeapFree(GetProcessHeap(), 0, buf); } }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64875
Your paranoid android.
=== wxppro (32 bit report) ===
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
=== w864 (64 bit report) ===
=== w1064v1507 (64 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/iphlpapi/tests/iphlpapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index c41865f8c9..af119e317c 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -2313,7 +2313,7 @@ static void test_ParseNetworkString(void)
if (!pParseNetworkString) { - skip("ParseNetworkString not available\n"); + win_skip("ParseNetworkString not available\n"); return; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64876
Your paranoid android.
=== wxppro (32 bit report) ===
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
=== w864 (64 bit report) ===
=== w1064v1507 (64 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- This patch is a lot more readable with `git show -w`.
Essentially, I just don't want to have to wade through all this crud when I extend the existing tests to cover more things. --- dlls/iphlpapi/tests/Makefile.in | 1 + dlls/iphlpapi/tests/iphlpapi.c | 1113 ++++++++++++++----------------- 2 files changed, 487 insertions(+), 627 deletions(-)
diff --git a/dlls/iphlpapi/tests/Makefile.in b/dlls/iphlpapi/tests/Makefile.in index 1aded198db..d813101354 100644 --- a/dlls/iphlpapi/tests/Makefile.in +++ b/dlls/iphlpapi/tests/Makefile.in @@ -1,4 +1,5 @@ TESTDLL = iphlpapi.dll +IMPORTS = iphlpapi
C_SRCS = \ iphlpapi.c diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index af119e317c..fe5eb3e166 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -41,6 +41,7 @@ #include "ws2tcpip.h" #include "windns.h" #include "iphlpapi.h" +#include "icmpapi.h" #include "iprtrmib.h" #include "netioapi.h" #include "wine/test.h" @@ -52,41 +53,14 @@ static HMODULE hLibrary = NULL;
static DWORD (WINAPI *pAllocateAndGetTcpExTableFromStack)(void**,BOOL,HANDLE,DWORD,DWORD); -static DWORD (WINAPI *pGetNumberOfInterfaces)(PDWORD); -static DWORD (WINAPI *pGetIpAddrTable)(PMIB_IPADDRTABLE,PULONG,BOOL); -static DWORD (WINAPI *pGetIfEntry)(PMIB_IFROW); static DWORD (WINAPI *pGetIfEntry2)(PMIB_IF_ROW2); -static DWORD (WINAPI *pGetFriendlyIfIndex)(DWORD); -static DWORD (WINAPI *pGetIfTable)(PMIB_IFTABLE,PULONG,BOOL); static DWORD (WINAPI *pGetIfTable2)(PMIB_IF_TABLE2*); static DWORD (WINAPI *pGetIfTable2Ex)(MIB_IF_TABLE_LEVEL,PMIB_IF_TABLE2*); -static DWORD (WINAPI *pGetIpForwardTable)(PMIB_IPFORWARDTABLE,PULONG,BOOL); -static DWORD (WINAPI *pGetIpNetTable)(PMIB_IPNETTABLE,PULONG,BOOL); -static DWORD (WINAPI *pGetInterfaceInfo)(PIP_INTERFACE_INFO,PULONG); -static DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG); -static DWORD (WINAPI *pGetNetworkParams)(PFIXED_INFO,PULONG); -static DWORD (WINAPI *pGetIcmpStatistics)(PMIB_ICMP); -static DWORD (WINAPI *pGetIpStatistics)(PMIB_IPSTATS); -static DWORD (WINAPI *pGetTcpStatistics)(PMIB_TCPSTATS); -static DWORD (WINAPI *pGetUdpStatistics)(PMIB_UDPSTATS); -static DWORD (WINAPI *pGetIcmpStatisticsEx)(PMIB_ICMP_EX,DWORD); -static DWORD (WINAPI *pGetIpStatisticsEx)(PMIB_IPSTATS,DWORD); -static DWORD (WINAPI *pGetTcpStatisticsEx)(PMIB_TCPSTATS,DWORD); -static DWORD (WINAPI *pGetUdpStatisticsEx)(PMIB_UDPSTATS,DWORD); -static DWORD (WINAPI *pGetTcpTable)(PMIB_TCPTABLE,PDWORD,BOOL); -static DWORD (WINAPI *pGetUdpTable)(PMIB_UDPTABLE,PDWORD,BOOL); static DWORD (WINAPI *pGetUdp6Table)(PMIB_UDP6TABLE,PDWORD,BOOL); -static DWORD (WINAPI *pGetPerAdapterInfo)(ULONG,PIP_PER_ADAPTER_INFO,PULONG); -static DWORD (WINAPI *pGetAdaptersAddresses)(ULONG,ULONG,PVOID,PIP_ADAPTER_ADDRESSES,PULONG); static DWORD (WINAPI *pGetUnicastIpAddressEntry)(MIB_UNICASTIPADDRESS_ROW*); static DWORD (WINAPI *pGetUnicastIpAddressTable)(ADDRESS_FAMILY,MIB_UNICASTIPADDRESS_TABLE**); -static DWORD (WINAPI *pNotifyAddrChange)(PHANDLE,LPOVERLAPPED); -static BOOL (WINAPI *pCancelIPChangeNotify)(LPOVERLAPPED); static DWORD (WINAPI *pGetExtendedTcpTable)(PVOID,PDWORD,BOOL,ULONG,TCP_TABLE_CLASS,ULONG); static DWORD (WINAPI *pGetExtendedUdpTable)(PVOID,PDWORD,BOOL,ULONG,UDP_TABLE_CLASS,ULONG); -static DWORD (WINAPI *pSetTcpEntry)(PMIB_TCPROW); -static HANDLE(WINAPI *pIcmpCreateFile)(VOID); -static DWORD (WINAPI *pIcmpSendEcho)(HANDLE,IPAddr,LPVOID,WORD,PIP_OPTION_INFORMATION,LPVOID,DWORD,DWORD); static DWORD (WINAPI *pCreateSortedAddressPairs)(const PSOCKADDR_IN6,ULONG,const PSOCKADDR_IN6,ULONG,ULONG, PSOCKADDR_IN6_PAIR*,ULONG*); static void (WINAPI *pFreeMibTable)(void*); @@ -109,41 +83,14 @@ static void loadIPHlpApi(void) hLibrary = LoadLibraryA("iphlpapi.dll"); if (hLibrary) { pAllocateAndGetTcpExTableFromStack = (void *)GetProcAddress(hLibrary, "AllocateAndGetTcpExTableFromStack"); - pGetNumberOfInterfaces = (void *)GetProcAddress(hLibrary, "GetNumberOfInterfaces"); - pGetIpAddrTable = (void *)GetProcAddress(hLibrary, "GetIpAddrTable"); - pGetIfEntry = (void *)GetProcAddress(hLibrary, "GetIfEntry"); pGetIfEntry2 = (void *)GetProcAddress(hLibrary, "GetIfEntry2"); - pGetFriendlyIfIndex = (void *)GetProcAddress(hLibrary, "GetFriendlyIfIndex"); - pGetIfTable = (void *)GetProcAddress(hLibrary, "GetIfTable"); pGetIfTable2 = (void *)GetProcAddress(hLibrary, "GetIfTable2"); pGetIfTable2Ex = (void *)GetProcAddress(hLibrary, "GetIfTable2Ex"); - pGetIpForwardTable = (void *)GetProcAddress(hLibrary, "GetIpForwardTable"); - pGetIpNetTable = (void *)GetProcAddress(hLibrary, "GetIpNetTable"); - pGetInterfaceInfo = (void *)GetProcAddress(hLibrary, "GetInterfaceInfo"); - pGetAdaptersInfo = (void *)GetProcAddress(hLibrary, "GetAdaptersInfo"); - pGetNetworkParams = (void *)GetProcAddress(hLibrary, "GetNetworkParams"); - pGetIcmpStatistics = (void *)GetProcAddress(hLibrary, "GetIcmpStatistics"); - pGetIpStatistics = (void *)GetProcAddress(hLibrary, "GetIpStatistics"); - pGetTcpStatistics = (void *)GetProcAddress(hLibrary, "GetTcpStatistics"); - pGetUdpStatistics = (void *)GetProcAddress(hLibrary, "GetUdpStatistics"); - pGetIcmpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetIcmpStatisticsEx"); - pGetIpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetIpStatisticsEx"); - pGetTcpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetTcpStatisticsEx"); - pGetUdpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetUdpStatisticsEx"); - pGetTcpTable = (void *)GetProcAddress(hLibrary, "GetTcpTable"); - pGetUdpTable = (void *)GetProcAddress(hLibrary, "GetUdpTable"); pGetUdp6Table = (void *)GetProcAddress(hLibrary, "GetUdp6Table"); - pGetPerAdapterInfo = (void *)GetProcAddress(hLibrary, "GetPerAdapterInfo"); - pGetAdaptersAddresses = (void *)GetProcAddress(hLibrary, "GetAdaptersAddresses"); pGetUnicastIpAddressEntry = (void *)GetProcAddress(hLibrary, "GetUnicastIpAddressEntry"); pGetUnicastIpAddressTable = (void *)GetProcAddress(hLibrary, "GetUnicastIpAddressTable"); - pNotifyAddrChange = (void *)GetProcAddress(hLibrary, "NotifyAddrChange"); - pCancelIPChangeNotify = (void *)GetProcAddress(hLibrary, "CancelIPChangeNotify"); pGetExtendedTcpTable = (void *)GetProcAddress(hLibrary, "GetExtendedTcpTable"); pGetExtendedUdpTable = (void *)GetProcAddress(hLibrary, "GetExtendedUdpTable"); - pSetTcpEntry = (void *)GetProcAddress(hLibrary, "SetTcpEntry"); - pIcmpCreateFile = (void *)GetProcAddress(hLibrary, "IcmpCreateFile"); - pIcmpSendEcho = (void *)GetProcAddress(hLibrary, "IcmpSendEcho"); pCreateSortedAddressPairs = (void *)GetProcAddress(hLibrary, "CreateSortedAddressPairs"); pFreeMibTable = (void *)GetProcAddress(hLibrary, "FreeMibTable"); pConvertInterfaceGuidToLuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceGuidToLuid"); @@ -200,37 +147,34 @@ static void testWin98OnlyFunctions(void)
static void testGetNumberOfInterfaces(void) { - if (pGetNumberOfInterfaces) { - DWORD apiReturn, numInterfaces; + DWORD apiReturn, numInterfaces;
- /* Crashes on Vista */ - if (0) { - apiReturn = pGetNumberOfInterfaces(NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) - return; - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetNumberOfInterfaces(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - } - - apiReturn = pGetNumberOfInterfaces(&numInterfaces); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetNumberOfInterfaces is not supported\n"); + /* Crashes on Vista */ + if (0) { + apiReturn = GetNumberOfInterfaces(NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) return; - } - ok(apiReturn == NO_ERROR, - "GetNumberOfInterfaces returned %d, expected 0\n", apiReturn); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetNumberOfInterfaces(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); } + + apiReturn = GetNumberOfInterfaces(&numInterfaces); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetNumberOfInterfaces is not supported\n"); + return; + } + ok(apiReturn == NO_ERROR, + "GetNumberOfInterfaces returned %d, expected 0\n", apiReturn); }
static void testGetIfEntry(DWORD index) { - if (pGetIfEntry) { DWORD apiReturn; MIB_IFROW row;
memset(&row, 0, sizeof(row)); - apiReturn = pGetIfEntry(NULL); + apiReturn = GetIfEntry(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIfEntry is not supported\n"); return; @@ -239,380 +183,363 @@ static void testGetIfEntry(DWORD index) "GetIfEntry(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); row.dwIndex = -1; /* hope that's always bogus! */ - apiReturn = pGetIfEntry(&row); + apiReturn = GetIfEntry(&row); ok(apiReturn == ERROR_INVALID_DATA || apiReturn == ERROR_FILE_NOT_FOUND /* Vista */, "GetIfEntry(bogus row) returned %d, expected ERROR_INVALID_DATA or ERROR_FILE_NOT_FOUND\n", apiReturn); row.dwIndex = index; - apiReturn = pGetIfEntry(&row); + apiReturn = GetIfEntry(&row); ok(apiReturn == NO_ERROR, "GetIfEntry returned %d, expected NO_ERROR\n", apiReturn); - } }
static void testGetIpAddrTable(void) { - if (pGetIpAddrTable) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetIpAddrTable(NULL, NULL, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetIpAddrTable is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpAddrTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetIpAddrTable(NULL, &dwSize, FALSE); - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIpAddrTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn = GetIpAddrTable(NULL, NULL, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetIpAddrTable is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpAddrTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetIpAddrTable(NULL, &dwSize, FALSE); + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetIpAddrTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_IPADDRTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + + apiReturn = GetIpAddrTable(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR, + "GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IPADDRTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - - apiReturn = pGetIpAddrTable(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR, - "GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", - apiReturn); - if (apiReturn == NO_ERROR && buf->dwNumEntries) + if (apiReturn == NO_ERROR && buf->dwNumEntries) + { + int i; + testGetIfEntry(buf->table[0].dwIndex); + for (i = 0; i < buf->dwNumEntries; i++) { - int i; - testGetIfEntry(buf->table[0].dwIndex); - for (i = 0; i < buf->dwNumEntries; i++) - { - ok (buf->table[i].wType != 0, "Test[%d]: expected wType > 0\n", i); - trace("Entry[%d]: addr %s, dwIndex %u, wType 0x%x\n", i, - ntoa(buf->table[i].dwAddr), buf->table[i].dwIndex, buf->table[i].wType); - } + ok (buf->table[i].wType != 0, "Test[%d]: expected wType > 0\n", i); + trace("Entry[%d]: addr %s, dwIndex %u, wType 0x%x\n", i, + ntoa(buf->table[i].dwAddr), buf->table[i].dwIndex, buf->table[i].wType); } - HeapFree(GetProcessHeap(), 0, buf); } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetIfTable(void) { - if (pGetIfTable) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetIfTable(NULL, NULL, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetIfTable is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIfTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetIfTable(NULL, &dwSize, FALSE); - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIfTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn = GetIfTable(NULL, NULL, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetIfTable is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIfTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetIfTable(NULL, &dwSize, FALSE); + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetIfTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_IFTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + + apiReturn = GetIfTable(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR, + "GetIfTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n\n", apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IFTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
- apiReturn = pGetIfTable(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR, - "GetIfTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n\n", - apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + DWORD i, j; + char name[MAX_INTERFACE_NAME_LEN];
- if (apiReturn == NO_ERROR && winetest_debug > 1) - { - DWORD i, j; - char name[MAX_INTERFACE_NAME_LEN]; - - trace( "interface table: %u entries\n", buf->dwNumEntries ); - for (i = 0; i < buf->dwNumEntries; i++) - { - MIB_IFROW *row = &buf->table[i]; - WideCharToMultiByte( CP_ACP, 0, row->wszName, -1, name, MAX_INTERFACE_NAME_LEN, NULL, NULL ); - trace( "%u: '%s' type %u mtu %u speed %u phys", - row->dwIndex, name, row->dwType, row->dwMtu, row->dwSpeed ); - for (j = 0; j < row->dwPhysAddrLen; j++) - printf( " %02x", row->bPhysAddr[j] ); - printf( "\n" ); - trace( " in: bytes %u upkts %u nupkts %u disc %u err %u unk %u\n", - row->dwInOctets, row->dwInUcastPkts, row->dwInNUcastPkts, - row->dwInDiscards, row->dwInErrors, row->dwInUnknownProtos ); - trace( " out: bytes %u upkts %u nupkts %u disc %u err %u\n", - row->dwOutOctets, row->dwOutUcastPkts, row->dwOutNUcastPkts, - row->dwOutDiscards, row->dwOutErrors ); - } - } - HeapFree(GetProcessHeap(), 0, buf); + trace( "interface table: %u entries\n", buf->dwNumEntries ); + for (i = 0; i < buf->dwNumEntries; i++) + { + MIB_IFROW *row = &buf->table[i]; + WideCharToMultiByte( CP_ACP, 0, row->wszName, -1, name, MAX_INTERFACE_NAME_LEN, NULL, NULL ); + trace( "%u: '%s' type %u mtu %u speed %u phys", + row->dwIndex, name, row->dwType, row->dwMtu, row->dwSpeed ); + for (j = 0; j < row->dwPhysAddrLen; j++) + printf( " %02x", row->bPhysAddr[j] ); + printf( "\n" ); + trace( " in: bytes %u upkts %u nupkts %u disc %u err %u unk %u\n", + row->dwInOctets, row->dwInUcastPkts, row->dwInNUcastPkts, + row->dwInDiscards, row->dwInErrors, row->dwInUnknownProtos ); + trace( " out: bytes %u upkts %u nupkts %u disc %u err %u\n", + row->dwOutOctets, row->dwOutUcastPkts, row->dwOutNUcastPkts, + row->dwOutDiscards, row->dwOutErrors ); + } } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetIpForwardTable(void) { - if (pGetIpForwardTable) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetIpForwardTable(NULL, NULL, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetIpForwardTable is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpForwardTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetIpForwardTable(NULL, &dwSize, FALSE); - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIpForwardTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", - apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IPFORWARDTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + apiReturn = GetIpForwardTable(NULL, NULL, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetIpForwardTable is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpForwardTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetIpForwardTable(NULL, &dwSize, FALSE); + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetIpForwardTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_IPFORWARDTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
- apiReturn = pGetIpForwardTable(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR, - "GetIpForwardTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", - apiReturn); + apiReturn = GetIpForwardTable(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR, + "GetIpForwardTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + apiReturn);
- if (apiReturn == NO_ERROR) - { - DWORD i; + if (apiReturn == NO_ERROR) + { + DWORD i;
- trace( "IP forward table: %u entries\n", buf->dwNumEntries ); - for (i = 0; i < buf->dwNumEntries; i++) - { - if (!U1(buf->table[i]).dwForwardDest) /* Default route */ - { + trace( "IP forward table: %u entries\n", buf->dwNumEntries ); + for (i = 0; i < buf->dwNumEntries; i++) + { + if (!U1(buf->table[i]).dwForwardDest) /* Default route */ + { todo_wine - ok (U1(buf->table[i]).dwForwardProto == MIB_IPPROTO_NETMGMT, - "Unexpected dwForwardProto %d\n", U1(buf->table[i]).dwForwardProto); - ok (U1(buf->table[i]).dwForwardType == MIB_IPROUTE_TYPE_INDIRECT, - "Unexpected dwForwardType %d\n", U1(buf->table[i]).dwForwardType); - } - else - { - /* In general we should get MIB_IPPROTO_LOCAL but does not work - * for Vista, 2008 and 7. */ - ok (U1(buf->table[i]).dwForwardProto == MIB_IPPROTO_LOCAL || - broken(U1(buf->table[i]).dwForwardProto == MIB_IPPROTO_NETMGMT), - "Unexpected dwForwardProto %d\n", U1(buf->table[i]).dwForwardProto); - /* The forward type varies depending on the address and gateway - * value so it is not worth testing in this case. */ - } - - trace( "%u: dest %s mask %s gw %s if %u type %u proto %u\n", i, - ntoa( buf->table[i].dwForwardDest ), ntoa( buf->table[i].dwForwardMask ), - ntoa( buf->table[i].dwForwardNextHop ), buf->table[i].dwForwardIfIndex, - U1(buf->table[i]).dwForwardType, U1(buf->table[i]).dwForwardProto ); - } - } - HeapFree(GetProcessHeap(), 0, buf); + ok (U1(buf->table[i]).dwForwardProto == MIB_IPPROTO_NETMGMT, + "Unexpected dwForwardProto %d\n", U1(buf->table[i]).dwForwardProto); + ok (U1(buf->table[i]).dwForwardType == MIB_IPROUTE_TYPE_INDIRECT, + "Unexpected dwForwardType %d\n", U1(buf->table[i]).dwForwardType); + } + else + { + /* In general we should get MIB_IPPROTO_LOCAL but does not work + * for Vista, 2008 and 7. */ + ok (U1(buf->table[i]).dwForwardProto == MIB_IPPROTO_LOCAL || + broken(U1(buf->table[i]).dwForwardProto == MIB_IPPROTO_NETMGMT), + "Unexpected dwForwardProto %d\n", U1(buf->table[i]).dwForwardProto); + /* The forward type varies depending on the address and gateway + * value so it is not worth testing in this case. */ + } + + trace( "%u: dest %s mask %s gw %s if %u type %u proto %u\n", i, + ntoa( buf->table[i].dwForwardDest ), ntoa( buf->table[i].dwForwardMask ), + ntoa( buf->table[i].dwForwardNextHop ), buf->table[i].dwForwardIfIndex, + U1(buf->table[i]).dwForwardType, U1(buf->table[i]).dwForwardProto ); + } } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetIpNetTable(void) { - if (pGetIpNetTable) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetIpNetTable(NULL, NULL, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetIpNetTable is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpNetTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetIpNetTable(NULL, &dwSize, FALSE); - ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetIpNetTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_NO_DATA or ERROR_INSUFFICIENT_BUFFER\n", + apiReturn = GetIpNetTable(NULL, NULL, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetIpNetTable is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpNetTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetIpNetTable(NULL, &dwSize, FALSE); + ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetIpNetTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_NO_DATA or ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_NO_DATA) + ; /* empty ARP table's okay */ + else if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_IPNETTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + + apiReturn = GetIpNetTable(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR || + apiReturn == ERROR_NO_DATA, /* empty ARP table's okay */ + "GetIpNetTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == ERROR_NO_DATA) - ; /* empty ARP table's okay */ - else if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IPNETTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - - apiReturn = pGetIpNetTable(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR || - apiReturn == ERROR_NO_DATA, /* empty ARP table's okay */ - "GetIpNetTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", - apiReturn); - - if (apiReturn == NO_ERROR && winetest_debug > 1) - { - DWORD i, j; - - trace( "IP net table: %u entries\n", buf->dwNumEntries ); - for (i = 0; i < buf->dwNumEntries; i++) - { - trace( "%u: idx %u type %u addr %s phys", - i, buf->table[i].dwIndex, U(buf->table[i]).dwType, ntoa( buf->table[i].dwAddr )); - for (j = 0; j < buf->table[i].dwPhysAddrLen; j++) - printf( " %02x", buf->table[i].bPhysAddr[j] ); - printf( "\n" ); - } - } - HeapFree(GetProcessHeap(), 0, buf); + + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + DWORD i, j; + + trace( "IP net table: %u entries\n", buf->dwNumEntries ); + for (i = 0; i < buf->dwNumEntries; i++) + { + trace( "%u: idx %u type %u addr %s phys", + i, buf->table[i].dwIndex, U(buf->table[i]).dwType, ntoa( buf->table[i].dwAddr )); + for (j = 0; j < buf->table[i].dwPhysAddrLen; j++) + printf( " %02x", buf->table[i].bPhysAddr[j] ); + printf( "\n" ); + } } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetIcmpStatistics(void) { - if (pGetIcmpStatistics) { - DWORD apiReturn; - MIB_ICMP stats; - - /* Crashes on Vista */ - if (0) { - apiReturn = pGetIcmpStatistics(NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) - return; - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIcmpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - } + DWORD apiReturn; + MIB_ICMP stats;
- apiReturn = pGetIcmpStatistics(&stats); + /* Crashes on Vista */ + if (0) { + apiReturn = GetIcmpStatistics(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) - { - skip("GetIcmpStatistics is not supported\n"); return; - } - ok(apiReturn == NO_ERROR, - "GetIcmpStatistics returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == NO_ERROR && winetest_debug > 1) - { - trace( "ICMP stats: %8s %8s\n", "in", "out" ); - trace( " dwMsgs: %8u %8u\n", stats.stats.icmpInStats.dwMsgs, stats.stats.icmpOutStats.dwMsgs ); - trace( " dwErrors: %8u %8u\n", stats.stats.icmpInStats.dwErrors, stats.stats.icmpOutStats.dwErrors ); - trace( " dwDestUnreachs: %8u %8u\n", stats.stats.icmpInStats.dwDestUnreachs, stats.stats.icmpOutStats.dwDestUnreachs ); - trace( " dwTimeExcds: %8u %8u\n", stats.stats.icmpInStats.dwTimeExcds, stats.stats.icmpOutStats.dwTimeExcds ); - trace( " dwParmProbs: %8u %8u\n", stats.stats.icmpInStats.dwParmProbs, stats.stats.icmpOutStats.dwParmProbs ); - trace( " dwSrcQuenchs: %8u %8u\n", stats.stats.icmpInStats.dwSrcQuenchs, stats.stats.icmpOutStats.dwSrcQuenchs ); - trace( " dwRedirects: %8u %8u\n", stats.stats.icmpInStats.dwRedirects, stats.stats.icmpOutStats.dwRedirects ); - trace( " dwEchos: %8u %8u\n", stats.stats.icmpInStats.dwEchos, stats.stats.icmpOutStats.dwEchos ); - trace( " dwEchoReps: %8u %8u\n", stats.stats.icmpInStats.dwEchoReps, stats.stats.icmpOutStats.dwEchoReps ); - trace( " dwTimestamps: %8u %8u\n", stats.stats.icmpInStats.dwTimestamps, stats.stats.icmpOutStats.dwTimestamps ); - trace( " dwTimestampReps: %8u %8u\n", stats.stats.icmpInStats.dwTimestampReps, stats.stats.icmpOutStats.dwTimestampReps ); - trace( " dwAddrMasks: %8u %8u\n", stats.stats.icmpInStats.dwAddrMasks, stats.stats.icmpOutStats.dwAddrMasks ); - trace( " dwAddrMaskReps: %8u %8u\n", stats.stats.icmpInStats.dwAddrMaskReps, stats.stats.icmpOutStats.dwAddrMaskReps ); - } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIcmpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + } + + apiReturn = GetIcmpStatistics(&stats); + if (apiReturn == ERROR_NOT_SUPPORTED) + { + skip("GetIcmpStatistics is not supported\n"); + return; + } + ok(apiReturn == NO_ERROR, + "GetIcmpStatistics returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "ICMP stats: %8s %8s\n", "in", "out" ); + trace( " dwMsgs: %8u %8u\n", stats.stats.icmpInStats.dwMsgs, stats.stats.icmpOutStats.dwMsgs ); + trace( " dwErrors: %8u %8u\n", stats.stats.icmpInStats.dwErrors, stats.stats.icmpOutStats.dwErrors ); + trace( " dwDestUnreachs: %8u %8u\n", stats.stats.icmpInStats.dwDestUnreachs, stats.stats.icmpOutStats.dwDestUnreachs ); + trace( " dwTimeExcds: %8u %8u\n", stats.stats.icmpInStats.dwTimeExcds, stats.stats.icmpOutStats.dwTimeExcds ); + trace( " dwParmProbs: %8u %8u\n", stats.stats.icmpInStats.dwParmProbs, stats.stats.icmpOutStats.dwParmProbs ); + trace( " dwSrcQuenchs: %8u %8u\n", stats.stats.icmpInStats.dwSrcQuenchs, stats.stats.icmpOutStats.dwSrcQuenchs ); + trace( " dwRedirects: %8u %8u\n", stats.stats.icmpInStats.dwRedirects, stats.stats.icmpOutStats.dwRedirects ); + trace( " dwEchos: %8u %8u\n", stats.stats.icmpInStats.dwEchos, stats.stats.icmpOutStats.dwEchos ); + trace( " dwEchoReps: %8u %8u\n", stats.stats.icmpInStats.dwEchoReps, stats.stats.icmpOutStats.dwEchoReps ); + trace( " dwTimestamps: %8u %8u\n", stats.stats.icmpInStats.dwTimestamps, stats.stats.icmpOutStats.dwTimestamps ); + trace( " dwTimestampReps: %8u %8u\n", stats.stats.icmpInStats.dwTimestampReps, stats.stats.icmpOutStats.dwTimestampReps ); + trace( " dwAddrMasks: %8u %8u\n", stats.stats.icmpInStats.dwAddrMasks, stats.stats.icmpOutStats.dwAddrMasks ); + trace( " dwAddrMaskReps: %8u %8u\n", stats.stats.icmpInStats.dwAddrMaskReps, stats.stats.icmpOutStats.dwAddrMaskReps ); } }
static void testGetIpStatistics(void) { - if (pGetIpStatistics) { - DWORD apiReturn; - MIB_IPSTATS stats; + DWORD apiReturn; + MIB_IPSTATS stats;
- apiReturn = pGetIpStatistics(NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetIpStatistics is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetIpStatistics(&stats); - ok(apiReturn == NO_ERROR, - "GetIpStatistics returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == NO_ERROR && winetest_debug > 1) - { - trace( "IP stats:\n" ); - trace( " dwForwarding: %u\n", U(stats).dwForwarding ); - trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); - trace( " dwInReceives: %u\n", stats.dwInReceives ); - trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); - trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); - trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); - trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); - trace( " dwInDiscards: %u\n", stats.dwInDiscards ); - trace( " dwInDelivers: %u\n", stats.dwInDelivers ); - trace( " dwOutRequests: %u\n", stats.dwOutRequests ); - trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); - trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); - trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); - trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); - trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); - trace( " dwReasmOks: %u\n", stats.dwReasmOks ); - trace( " dwReasmFails: %u\n", stats.dwReasmFails ); - trace( " dwFragOks: %u\n", stats.dwFragOks ); - trace( " dwFragFails: %u\n", stats.dwFragFails ); - trace( " dwFragCreates: %u\n", stats.dwFragCreates ); - trace( " dwNumIf: %u\n", stats.dwNumIf ); - trace( " dwNumAddr: %u\n", stats.dwNumAddr ); - trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); - } + apiReturn = GetIpStatistics(NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetIpStatistics is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetIpStatistics(&stats); + ok(apiReturn == NO_ERROR, + "GetIpStatistics returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "IP stats:\n" ); + trace( " dwForwarding: %u\n", U(stats).dwForwarding ); + trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); + trace( " dwInReceives: %u\n", stats.dwInReceives ); + trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); + trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); + trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); + trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); + trace( " dwInDiscards: %u\n", stats.dwInDiscards ); + trace( " dwInDelivers: %u\n", stats.dwInDelivers ); + trace( " dwOutRequests: %u\n", stats.dwOutRequests ); + trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); + trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); + trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); + trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); + trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); + trace( " dwReasmOks: %u\n", stats.dwReasmOks ); + trace( " dwReasmFails: %u\n", stats.dwReasmFails ); + trace( " dwFragOks: %u\n", stats.dwFragOks ); + trace( " dwFragFails: %u\n", stats.dwFragFails ); + trace( " dwFragCreates: %u\n", stats.dwFragCreates ); + trace( " dwNumIf: %u\n", stats.dwNumIf ); + trace( " dwNumAddr: %u\n", stats.dwNumAddr ); + trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); } }
static void testGetTcpStatistics(void) { - if (pGetTcpStatistics) { - DWORD apiReturn; - MIB_TCPSTATS stats; + DWORD apiReturn; + MIB_TCPSTATS stats;
- apiReturn = pGetTcpStatistics(NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetTcpStatistics is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetTcpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetTcpStatistics(&stats); - ok(apiReturn == NO_ERROR, - "GetTcpStatistics returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == NO_ERROR && winetest_debug > 1) - { - trace( "TCP stats:\n" ); - trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); - trace( " dwRtoMin: %u\n", stats.dwRtoMin ); - trace( " dwRtoMax: %u\n", stats.dwRtoMax ); - trace( " dwMaxConn: %u\n", stats.dwMaxConn ); - trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); - trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); - trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); - trace( " dwEstabResets: %u\n", stats.dwEstabResets ); - trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); - trace( " dwInSegs: %u\n", stats.dwInSegs ); - trace( " dwOutSegs: %u\n", stats.dwOutSegs ); - trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); - trace( " dwInErrs: %u\n", stats.dwInErrs ); - trace( " dwOutRsts: %u\n", stats.dwOutRsts ); - trace( " dwNumConns: %u\n", stats.dwNumConns ); - } + apiReturn = GetTcpStatistics(NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetTcpStatistics is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetTcpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetTcpStatistics(&stats); + ok(apiReturn == NO_ERROR, + "GetTcpStatistics returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "TCP stats:\n" ); + trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); + trace( " dwRtoMin: %u\n", stats.dwRtoMin ); + trace( " dwRtoMax: %u\n", stats.dwRtoMax ); + trace( " dwMaxConn: %u\n", stats.dwMaxConn ); + trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); + trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); + trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); + trace( " dwEstabResets: %u\n", stats.dwEstabResets ); + trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); + trace( " dwInSegs: %u\n", stats.dwInSegs ); + trace( " dwOutSegs: %u\n", stats.dwOutSegs ); + trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); + trace( " dwInErrs: %u\n", stats.dwInErrs ); + trace( " dwOutRsts: %u\n", stats.dwOutRsts ); + trace( " dwNumConns: %u\n", stats.dwNumConns ); } }
static void testGetUdpStatistics(void) { - if (pGetUdpStatistics) { - DWORD apiReturn; - MIB_UDPSTATS stats; + DWORD apiReturn; + MIB_UDPSTATS stats;
- apiReturn = pGetUdpStatistics(NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetUdpStatistics is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetUdpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetUdpStatistics(&stats); - ok(apiReturn == NO_ERROR, - "GetUdpStatistics returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == NO_ERROR && winetest_debug > 1) - { - trace( "UDP stats:\n" ); - trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); - trace( " dwNoPorts: %u\n", stats.dwNoPorts ); - trace( " dwInErrors: %u\n", stats.dwInErrors ); - trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); - trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); - } + apiReturn = GetUdpStatistics(NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetUdpStatistics is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetUdpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetUdpStatistics(&stats); + ok(apiReturn == NO_ERROR, + "GetUdpStatistics returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "UDP stats:\n" ); + trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); + trace( " dwNoPorts: %u\n", stats.dwNoPorts ); + trace( " dwInErrors: %u\n", stats.dwInErrors ); + trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); + trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); } }
@@ -621,24 +548,18 @@ static void testGetIcmpStatisticsEx(void) DWORD apiReturn; MIB_ICMP_EX stats;
- if (!pGetIcmpStatisticsEx) - { - win_skip( "GetIcmpStatisticsEx not available\n" ); - return; - } - /* Crashes on Vista */ if (1) { - apiReturn = pGetIcmpStatisticsEx(NULL, AF_INET); + apiReturn = GetIcmpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIcmpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); }
- apiReturn = pGetIcmpStatisticsEx(&stats, AF_BAN); + apiReturn = GetIcmpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIcmpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetIcmpStatisticsEx(&stats, AF_INET); + apiReturn = GetIcmpStatisticsEx(&stats, AF_INET); ok(apiReturn == NO_ERROR, "GetIcmpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { @@ -650,7 +571,7 @@ static void testGetIcmpStatisticsEx(void) trace( " rgdwTypeCount[%3i]: %8u %8u\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); }
- apiReturn = pGetIcmpStatisticsEx(&stats, AF_INET6); + apiReturn = GetIcmpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), "GetIcmpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) @@ -669,21 +590,15 @@ static void testGetIpStatisticsEx(void) DWORD apiReturn; MIB_IPSTATS stats;
- if (!pGetIpStatisticsEx) - { - win_skip( "GetIpStatisticsEx not available\n" ); - return; - } - - apiReturn = pGetIpStatisticsEx(NULL, AF_INET); + apiReturn = GetIpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetIpStatisticsEx(&stats, AF_BAN); + apiReturn = GetIpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetIpStatisticsEx(&stats, AF_INET); + apiReturn = GetIpStatisticsEx(&stats, AF_INET); ok(apiReturn == NO_ERROR, "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { @@ -713,7 +628,7 @@ static void testGetIpStatisticsEx(void) trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); }
- apiReturn = pGetIpStatisticsEx(&stats, AF_INET6); + apiReturn = GetIpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) @@ -750,21 +665,15 @@ static void testGetTcpStatisticsEx(void) DWORD apiReturn; MIB_TCPSTATS stats;
- if (!pGetTcpStatisticsEx) - { - win_skip( "GetTcpStatisticsEx not available\n" ); - return; - } - - apiReturn = pGetTcpStatisticsEx(NULL, AF_INET); + apiReturn = GetTcpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, "GetTcpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetTcpStatisticsEx(&stats, AF_BAN); + apiReturn = GetTcpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, "GetTcpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetTcpStatisticsEx(&stats, AF_INET); + apiReturn = GetTcpStatisticsEx(&stats, AF_INET); ok(apiReturn == NO_ERROR, "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { @@ -786,7 +695,7 @@ static void testGetTcpStatisticsEx(void) trace( " dwNumConns: %u\n", stats.dwNumConns ); }
- apiReturn = pGetTcpStatisticsEx(&stats, AF_INET6); + apiReturn = GetTcpStatisticsEx(&stats, AF_INET6); todo_wine ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) @@ -815,21 +724,15 @@ static void testGetUdpStatisticsEx(void) DWORD apiReturn; MIB_UDPSTATS stats;
- if (!pGetUdpStatisticsEx) - { - win_skip( "GetUdpStatisticsEx not available\n" ); - return; - } - - apiReturn = pGetUdpStatisticsEx(NULL, AF_INET); + apiReturn = GetUdpStatisticsEx(NULL, AF_INET); ok(apiReturn == ERROR_INVALID_PARAMETER, "GetUdpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetUdpStatisticsEx(&stats, AF_BAN); + apiReturn = GetUdpStatisticsEx(&stats, AF_BAN); ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, "GetUdpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn);
- apiReturn = pGetUdpStatisticsEx(&stats, AF_INET); + apiReturn = GetUdpStatisticsEx(&stats, AF_INET); ok(apiReturn == NO_ERROR, "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { @@ -841,7 +744,7 @@ static void testGetUdpStatisticsEx(void) trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); }
- apiReturn = pGetUdpStatisticsEx(&stats, AF_INET6); + apiReturn = GetUdpStatisticsEx(&stats, AF_INET6); ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) @@ -857,76 +760,71 @@ static void testGetUdpStatisticsEx(void)
static void testGetTcpTable(void) { - if (pGetTcpTable) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetTcpTable(NULL, &dwSize, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetTcpTable is not supported\n"); - return; - } - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER || - broken(apiReturn == ERROR_NO_DATA), /* win95 */ - "GetTcpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", - apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_TCPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + apiReturn = GetTcpTable(NULL, &dwSize, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetTcpTable is not supported\n"); + return; + } + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetTcpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_TCPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
- apiReturn = pGetTcpTable(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR, - "GetTcpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", - apiReturn); + apiReturn = GetTcpTable(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR, + "GetTcpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + apiReturn);
- if (apiReturn == NO_ERROR && winetest_debug > 1) - { - DWORD i; - trace( "TCP table: %u entries\n", buf->dwNumEntries ); - for (i = 0; i < buf->dwNumEntries; i++) - { - trace( "%u: local %s:%u remote %s:%u state %u\n", i, - ntoa(buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalPort), - ntoa(buf->table[i].dwRemoteAddr), ntohs(buf->table[i].dwRemotePort), - U(buf->table[i]).dwState ); - } - } - HeapFree(GetProcessHeap(), 0, buf); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + DWORD i; + trace( "TCP table: %u entries\n", buf->dwNumEntries ); + for (i = 0; i < buf->dwNumEntries; i++) + { + trace( "%u: local %s:%u remote %s:%u state %u\n", i, + ntoa(buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalPort), + ntoa(buf->table[i].dwRemoteAddr), ntohs(buf->table[i].dwRemotePort), + U(buf->table[i]).dwState ); + } } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetUdpTable(void) { - if (pGetUdpTable) { - DWORD apiReturn; - ULONG dwSize = 0; + DWORD apiReturn; + ULONG dwSize = 0;
- apiReturn = pGetUdpTable(NULL, &dwSize, FALSE); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetUdpTable is not supported\n"); - return; - } - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetUdpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", - apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_UDPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); + apiReturn = GetUdpTable(NULL, &dwSize, FALSE); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetUdpTable is not supported\n"); + return; + } + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetUdpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PMIB_UDPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize);
- apiReturn = pGetUdpTable(buf, &dwSize, FALSE); - ok(apiReturn == NO_ERROR, - "GetUdpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", - apiReturn); + apiReturn = GetUdpTable(buf, &dwSize, FALSE); + ok(apiReturn == NO_ERROR, + "GetUdpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", + apiReturn);
- if (apiReturn == NO_ERROR && winetest_debug > 1) - { - DWORD i; - trace( "UDP table: %u entries\n", buf->dwNumEntries ); - for (i = 0; i < buf->dwNumEntries; i++) - trace( "%u: %s:%u\n", - i, ntoa( buf->table[i].dwLocalAddr ), ntohs(buf->table[i].dwLocalPort) ); - } - HeapFree(GetProcessHeap(), 0, buf); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + DWORD i; + trace( "UDP table: %u entries\n", buf->dwNumEntries ); + for (i = 0; i < buf->dwNumEntries; i++) + trace( "%u: %s:%u\n", + i, ntoa( buf->table[i].dwLocalAddr ), ntohs(buf->table[i].dwLocalPort) ); } + HeapFree(GetProcessHeap(), 0, buf); } }
@@ -938,11 +836,11 @@ static void testSetTcpEntry(void) memset(&row, 0, sizeof(row)); if(0) /* This test crashes in OS >= VISTA */ { - ret = pSetTcpEntry(NULL); + ret = SetTcpEntry(NULL); ok( ret == ERROR_INVALID_PARAMETER, "got %u, expected %u\n", ret, ERROR_INVALID_PARAMETER); }
- ret = pSetTcpEntry(&row); + ret = SetTcpEntry(&row); if (ret == ERROR_NETWORK_ACCESS_DENIED) { win_skip("SetTcpEntry failed with access error. Skipping test.\n"); @@ -951,7 +849,7 @@ static void testSetTcpEntry(void) todo_wine ok( ret == ERROR_INVALID_PARAMETER, "got %u, expected %u\n", ret, ERROR_INVALID_PARAMETER);
U(row).dwState = MIB_TCP_STATE_DELETE_TCB; - ret = pSetTcpEntry(&row); + ret = SetTcpEntry(&row); todo_wine ok( ret == ERROR_MR_MID_NOT_FOUND || broken(ret == ERROR_INVALID_PARAMETER), "got %u, expected %u\n", ret, ERROR_MR_MID_NOT_FOUND); } @@ -965,23 +863,18 @@ static void testIcmpSendEcho(void) ICMP_ECHO_REPLY *reply; INT i;
- if (!pIcmpSendEcho || !pIcmpCreateFile) - { - win_skip( "IcmpSendEcho or IcmpCreateFile not available\n" ); - return; - } memset(senddata, 0, sizeof(senddata));
address = htonl(INADDR_LOOPBACK); SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(INVALID_HANDLE_VALUE, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(INVALID_HANDLE_VALUE, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER || broken(error == ERROR_INVALID_HANDLE) /* <= 2003 */, "expected 87, got %d\n", error);
- icmp = pIcmpCreateFile(); + icmp = IcmpCreateFile(); if (icmp == INVALID_HANDLE_VALUE) { error = GetLastError(); @@ -995,7 +888,7 @@ static void testIcmpSendEcho(void)
address = 0; SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_NETNAME @@ -1005,28 +898,28 @@ static void testIcmpSendEcho(void) address = htonl(INADDR_LOOPBACK); if (0) /* crashes in XP */ { - ret = pIcmpSendEcho(icmp, address, NULL, sizeof(senddata), NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, NULL, sizeof(senddata), NULL, replydata, replysz, 1000); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); }
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); error = GetLastError(); ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, NULL, 0, NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, NULL, 0, NULL, replydata, replysz, 1000); error = GetLastError(); ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error);
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, 0, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, 0, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER @@ -1034,7 +927,7 @@ static void testIcmpSendEcho(void) "expected 87, got %d\n", error);
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == ERROR_INVALID_PARAMETER @@ -1043,7 +936,7 @@ static void testIcmpSendEcho(void)
SetLastError(0xdeadbeef); replysz = sizeof(replydata) - 1; - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == IP_GENERAL_FAILURE @@ -1052,19 +945,19 @@ static void testIcmpSendEcho(void)
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY); - ret = pIcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); error = GetLastError(); ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN; - ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz, 1000); error = GetLastError(); ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef); replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN; - ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN + 1, NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, ICMP_MINLEN + 1, NULL, replydata, replysz, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == IP_GENERAL_FAILURE @@ -1072,7 +965,7 @@ static void testIcmpSendEcho(void) "expected 11050, got %d\n", error);
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz - 1, 1000); + ret = IcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz - 1, 1000); error = GetLastError(); ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); ok (error == IP_GENERAL_FAILURE @@ -1082,19 +975,19 @@ static void testIcmpSendEcho(void) /* in windows >= vista the timeout can't be invalid */ SetLastError(0xdeadbeef); replysz = sizeof(replydata); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 0); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 0); error = GetLastError(); if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error);
SetLastError(0xdeadbeef); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, -1); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, -1); error = GetLastError(); if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error);
/* real ping test */ SetLastError(0xdeadbeef); address = htonl(INADDR_LOOPBACK); - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); error = GetLastError(); if (ret) { @@ -1117,7 +1010,7 @@ static void testIcmpSendEcho(void) SetLastError(0xdeadbeef); address = htonl(INADDR_LOOPBACK); for (i = 0; i < ARRAY_SIZE(senddata); i++) senddata[i] = i & 0xff; - ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + ret = IcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); error = GetLastError(); reply = (ICMP_ECHO_REPLY *)replydata; ok(ret, "IcmpSendEcho failed unexpectedly\n"); @@ -1166,101 +1059,95 @@ static void testWinNT4Functions(void)
static void testGetInterfaceInfo(void) { - if (pGetInterfaceInfo) { - DWORD apiReturn; - ULONG len = 0; + DWORD apiReturn; + ULONG len = 0;
- apiReturn = pGetInterfaceInfo(NULL, NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetInterfaceInfo is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetInterfaceInfo returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetInterfaceInfo(NULL, &len); - ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, - "GetInterfaceInfo returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn = GetInterfaceInfo(NULL, NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetInterfaceInfo is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetInterfaceInfo returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetInterfaceInfo(NULL, &len); + ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, + "GetInterfaceInfo returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", + apiReturn); + if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { + PIP_INTERFACE_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); + + apiReturn = GetInterfaceInfo(buf, &len); + ok(apiReturn == NO_ERROR, + "GetInterfaceInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PIP_INTERFACE_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); - - apiReturn = pGetInterfaceInfo(buf, &len); - ok(apiReturn == NO_ERROR, - "GetInterfaceInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", - apiReturn); - HeapFree(GetProcessHeap(), 0, buf); - } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetAdaptersInfo(void) { - if (pGetAdaptersInfo) { - DWORD apiReturn; - ULONG len = 0; + DWORD apiReturn; + ULONG len = 0;
- apiReturn = pGetAdaptersInfo(NULL, NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetAdaptersInfo is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetAdaptersInfo returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetAdaptersInfo(NULL, &len); - ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_BUFFER_OVERFLOW, - "GetAdaptersInfo returned %d, expected ERROR_NO_DATA or ERROR_BUFFER_OVERFLOW\n", + apiReturn = GetAdaptersInfo(NULL, NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetAdaptersInfo is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetAdaptersInfo returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetAdaptersInfo(NULL, &len); + ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_BUFFER_OVERFLOW, + "GetAdaptersInfo returned %d, expected ERROR_NO_DATA or ERROR_BUFFER_OVERFLOW\n", + apiReturn); + if (apiReturn == ERROR_NO_DATA) + ; /* no adapter's, that's okay */ + else if (apiReturn == ERROR_BUFFER_OVERFLOW) { + PIP_ADAPTER_INFO ptr, buf = HeapAlloc(GetProcessHeap(), 0, len); + + apiReturn = GetAdaptersInfo(buf, &len); + ok(apiReturn == NO_ERROR, + "GetAdaptersInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == ERROR_NO_DATA) - ; /* no adapter's, that's okay */ - else if (apiReturn == ERROR_BUFFER_OVERFLOW) { - PIP_ADAPTER_INFO ptr, buf = HeapAlloc(GetProcessHeap(), 0, len); - - apiReturn = pGetAdaptersInfo(buf, &len); - ok(apiReturn == NO_ERROR, - "GetAdaptersInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", - apiReturn); - ptr = buf; - while (ptr) { - ok(ptr->IpAddressList.IpAddress.String[0], "A valid IP must be present\n"); - ok(ptr->IpAddressList.IpMask.String[0], "A valid mask must be present\n"); - trace("Adapter '%s', IP %s, Mask %s\n", ptr->AdapterName, - ptr->IpAddressList.IpAddress.String, ptr->IpAddressList.IpMask.String); - ptr = ptr->Next; - } - HeapFree(GetProcessHeap(), 0, buf); + ptr = buf; + while (ptr) { + ok(ptr->IpAddressList.IpAddress.String[0], "A valid IP must be present\n"); + ok(ptr->IpAddressList.IpMask.String[0], "A valid mask must be present\n"); + trace("Adapter '%s', IP %s, Mask %s\n", ptr->AdapterName, + ptr->IpAddressList.IpAddress.String, ptr->IpAddressList.IpMask.String); + ptr = ptr->Next; } + HeapFree(GetProcessHeap(), 0, buf); } }
static void testGetNetworkParams(void) { - if (pGetNetworkParams) { - DWORD apiReturn; - ULONG len = 0; + DWORD apiReturn; + ULONG len = 0;
- apiReturn = pGetNetworkParams(NULL, NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) { - skip("GetNetworkParams is not supported\n"); - return; - } - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetNetworkParams returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); - apiReturn = pGetNetworkParams(NULL, &len); - ok(apiReturn == ERROR_BUFFER_OVERFLOW, - "GetNetworkParams returned %d, expected ERROR_BUFFER_OVERFLOW\n", + apiReturn = GetNetworkParams(NULL, NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetNetworkParams is not supported\n"); + return; + } + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetNetworkParams returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + apiReturn = GetNetworkParams(NULL, &len); + ok(apiReturn == ERROR_BUFFER_OVERFLOW, + "GetNetworkParams returned %d, expected ERROR_BUFFER_OVERFLOW\n", + apiReturn); + if (apiReturn == ERROR_BUFFER_OVERFLOW) { + PFIXED_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); + + apiReturn = GetNetworkParams(buf, &len); + ok(apiReturn == NO_ERROR, + "GetNetworkParams(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); - if (apiReturn == ERROR_BUFFER_OVERFLOW) { - PFIXED_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); - - apiReturn = pGetNetworkParams(buf, &len); - ok(apiReturn == NO_ERROR, - "GetNetworkParams(buf, &dwSize) returned %d, expected NO_ERROR\n", - apiReturn); - HeapFree(GetProcessHeap(), 0, buf); - } + HeapFree(GetProcessHeap(), 0, buf); } }
@@ -1284,20 +1171,19 @@ static void testGetPerAdapterInfo(void) DWORD ret, needed; void *buffer;
- if (!pGetPerAdapterInfo) return; - ret = pGetPerAdapterInfo(1, NULL, NULL); + ret = GetPerAdapterInfo(1, NULL, NULL); if (ret == ERROR_NOT_SUPPORTED) { skip("GetPerAdapterInfo is not supported\n"); return; } ok( ret == ERROR_INVALID_PARAMETER, "got %u instead of ERROR_INVALID_PARAMETER\n", ret ); needed = 0xdeadbeef; - ret = pGetPerAdapterInfo(1, NULL, &needed); + ret = GetPerAdapterInfo(1, NULL, &needed); if (ret == ERROR_NO_DATA) return; /* no such adapter */ ok( ret == ERROR_BUFFER_OVERFLOW, "got %u instead of ERROR_BUFFER_OVERFLOW\n", ret ); ok( needed != 0xdeadbeef, "needed not set\n" ); buffer = HeapAlloc( GetProcessHeap(), 0, needed ); - ret = pGetPerAdapterInfo(1, buffer, &needed); + ret = GetPerAdapterInfo(1, buffer, &needed); ok( ret == NO_ERROR, "got %u instead of NO_ERROR\n", ret ); HeapFree( GetProcessHeap(), 0, buffer ); } @@ -1309,46 +1195,30 @@ static void testNotifyAddrChange(void) HANDLE handle; BOOL success;
- if (!pNotifyAddrChange) - { - win_skip("NotifyAddrChange not present\n"); - return; - } - if (!pCancelIPChangeNotify) - { - win_skip("CancelIPChangeNotify not present\n"); - return; - } - handle = NULL; ZeroMemory(&overlapped, sizeof(overlapped)); - ret = pNotifyAddrChange(&handle, &overlapped); - if (ret == ERROR_NOT_SUPPORTED) - { - win_skip("NotifyAddrChange is not supported\n"); - return; - } + ret = NotifyAddrChange(&handle, &overlapped); ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected ERROR_IO_PENDING\n", ret); ret = GetLastError(); todo_wine ok(ret == ERROR_IO_PENDING, "GetLastError returned %d, expected ERROR_IO_PENDING\n", ret); - success = pCancelIPChangeNotify(&overlapped); + success = CancelIPChangeNotify(&overlapped); todo_wine ok(success == TRUE, "CancelIPChangeNotify returned FALSE, expected TRUE\n");
ZeroMemory(&overlapped, sizeof(overlapped)); - success = pCancelIPChangeNotify(&overlapped); + success = CancelIPChangeNotify(&overlapped); ok(success == FALSE, "CancelIPChangeNotify returned TRUE, expected FALSE\n");
handle = NULL; ZeroMemory(&overlapped, sizeof(overlapped)); overlapped.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - ret = pNotifyAddrChange(&handle, &overlapped); + ret = NotifyAddrChange(&handle, &overlapped); ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected ERROR_IO_PENDING\n", ret); todo_wine ok(handle != INVALID_HANDLE_VALUE, "NotifyAddrChange returned invalid file handle\n"); success = GetOverlappedResult(handle, &overlapped, &bytes, FALSE); ok(success == FALSE, "GetOverlappedResult returned TRUE, expected FALSE\n"); ret = GetLastError(); ok(ret == ERROR_IO_INCOMPLETE, "GetLastError returned %d, expected ERROR_IO_INCOMPLETE\n", ret); - success = pCancelIPChangeNotify(&overlapped); + success = CancelIPChangeNotify(&overlapped); todo_wine ok(success == TRUE, "CancelIPChangeNotify returned FALSE, expected TRUE\n");
if (winetest_interactive) @@ -1358,7 +1228,7 @@ static void testNotifyAddrChange(void) overlapped.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); trace("Testing asynchronous ipv4 address change notification. Please " "change the ipv4 address of one of your network interfaces\n"); - ret = pNotifyAddrChange(&handle, &overlapped); + ret = NotifyAddrChange(&handle, &overlapped); ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected NO_ERROR\n", ret); success = GetOverlappedResult(handle, &overlapped, &bytes, TRUE); ok(success == TRUE, "GetOverlappedResult returned FALSE, expected TRUE\n"); @@ -1369,7 +1239,7 @@ static void testNotifyAddrChange(void) { trace("Testing synchronous ipv4 address change notification. Please " "change the ipv4 address of one of your network interfaces\n"); - ret = pNotifyAddrChange(NULL, NULL); + ret = NotifyAddrChange(NULL, NULL); todo_wine ok(ret == NO_ERROR, "NotifyAddrChange returned %d, expected NO_ERROR\n", ret); } } @@ -1399,23 +1269,17 @@ static void test_GetAdaptersAddresses(void) IP_ADAPTER_ADDRESSES *aa, *ptr; IP_ADAPTER_UNICAST_ADDRESS *ua;
- if (!pGetAdaptersAddresses) - { - win_skip("GetAdaptersAddresses not present\n"); - return; - } - - ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); + ret = GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret);
/* size should be ignored and overwritten if buffer is NULL */ size = 0x7fffffff; - ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size); + ret = GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size); ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); if (ret != ERROR_BUFFER_OVERFLOW) return;
ptr = HeapAlloc(GetProcessHeap(), 0, size); - ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &size); + ret = GetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &size); ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); HeapFree(GetProcessHeap(), 0, ptr);
@@ -1423,7 +1287,7 @@ static void test_GetAdaptersAddresses(void) size *= 2; osize = size; ptr = HeapAlloc(GetProcessHeap(), 0, osize); - ret = pGetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, ptr, &osize); + ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, ptr, &osize); ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); ok(osize == size, "expected %d, got %d\n", size, osize);
@@ -1733,11 +1597,11 @@ static DWORD get_interface_index(void) DWORD size = 0, ret = 0; IP_ADAPTER_ADDRESSES *buf, *aa;
- if (pGetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size ) != ERROR_BUFFER_OVERFLOW) + if (GetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size ) != ERROR_BUFFER_OVERFLOW) return 0;
buf = HeapAlloc( GetProcessHeap(), 0, size ); - pGetAdaptersAddresses( AF_UNSPEC, 0, NULL, buf, &size ); + GetAdaptersAddresses( AF_UNSPEC, 0, NULL, buf, &size ); for (aa = buf; aa; aa = aa->Next) { if (aa->IfType == IF_TYPE_ETHERNET_CSMACD) @@ -1958,27 +1822,22 @@ static void test_GetIfEntry2(void) MIB_IF_ROW2 row; NET_IFINDEX index;
- if (!pGetIfEntry2) - { - win_skip( "GetIfEntry2 not available\n" ); - return; - } if (!(index = get_interface_index())) { skip( "no suitable interface found\n" ); return; }
- ret = pGetIfEntry2( NULL ); + ret = GetIfEntry2( NULL ); ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret );
memset( &row, 0, sizeof(row) ); - ret = pGetIfEntry2( &row ); + ret = GetIfEntry2( &row ); ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret );
memset( &row, 0, sizeof(row) ); row.InterfaceIndex = index; - ret = pGetIfEntry2( &row ); + ret = GetIfEntry2( &row ); ok( ret == NO_ERROR, "got %u\n", ret ); ok( row.InterfaceIndex == index, "got %u\n", index ); } @@ -2084,12 +1943,12 @@ static void test_GetUnicastIpAddressEntry(void) ret = pGetUnicastIpAddressEntry( &row ); ok( ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret );
- ret = pGetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, NULL, &size); + ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, NULL, &size); ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); if (ret != ERROR_BUFFER_OVERFLOW) return;
ptr = HeapAlloc(GetProcessHeap(), 0, size); - ret = pGetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, ptr, &size); + ret = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, ptr, &size); ok(!ret, "expected ERROR_SUCCESS got %u\n", ret);
for (aa = ptr; !ret && aa; aa = aa->Next)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64877
Your paranoid android.
=== wxppro (32 bit report) ===
iphlpapi: iphlpapi: Timeout
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
=== w864 (64 bit report) ===
=== w1064v1507 (64 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: iphlpapi:iphlpapi has no test summary line (early exit of the main process?)
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64873
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===