From fa68a3d9c379bd5848568511a8729371bd3a82ee Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Fri, 6 Jun 2008 21:34:32 +0200 Subject: [PATCH] iphlpapi/tests: Fix crash on Vista. --- dlls/iphlpapi/tests/iphlpapi.c | 42 ++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 04fd5729202..a857e99670b 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -153,14 +153,23 @@ static void testWin98OnlyFunctions(void) static void testGetNumberOfInterfaces(void) { if (gGetNumberOfInterfaces) { - DWORD apiReturn = gGetNumberOfInterfaces(NULL), numInterfaces; + DWORD apiReturn, numInterfaces; + + /* Crashes on Vista */ + if (0) { + apiReturn = gGetNumberOfInterfaces(NULL), numInterfaces; + if (apiReturn == ERROR_NOT_SUPPORTED) + return; + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetNumberOfInterfaces(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + } - if (apiReturn == ERROR_NOT_SUPPORTED) - return; - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetNumberOfInterfaces(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); apiReturn = gGetNumberOfInterfaces(&numInterfaces); + if (apiReturn == ERROR_NOT_SUPPORTED) { + skip("GetNumberOfInterfaces is not supported\n"); + return; + } ok(apiReturn == NO_ERROR, "GetNumberOfInterfaces returned %d, expected 0\n", apiReturn); } @@ -313,13 +322,22 @@ static void testGetIcmpStatistics(void) DWORD apiReturn; MIB_ICMP stats; - apiReturn = gGetIcmpStatistics(NULL); - if (apiReturn == ERROR_NOT_SUPPORTED) - return; - ok(apiReturn == ERROR_INVALID_PARAMETER, - "GetIcmpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", - apiReturn); + /* Crashes on Vista */ + if (0) { + apiReturn = gGetIcmpStatistics(NULL); + if (apiReturn == ERROR_NOT_SUPPORTED) + return; + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIcmpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", + apiReturn); + } + apiReturn = gGetIcmpStatistics(&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); }