From f793b1390f1e39a77c867c1110aeb6f5cb669409 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 4 Mar 2010 20:55:41 +0000 Subject: [PATCH] [IPHLPAPI_WINETEST] sync iphlpapi_winetest to wine 1.1.39 svn path=/trunk/; revision=45841 --- rostests/winetests/iphlpapi/iphlpapi.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/rostests/winetests/iphlpapi/iphlpapi.c b/rostests/winetests/iphlpapi/iphlpapi.c index cd2e45200a3..c03c56d2dee 100644 --- a/rostests/winetests/iphlpapi/iphlpapi.c +++ b/rostests/winetests/iphlpapi/iphlpapi.c @@ -775,11 +775,12 @@ GetBestRoute IpReleaseAddress IpRenewAddress */ -static void testWin98Functions(void) +static DWORD CALLBACK testWin98Functions(void *p) { testGetInterfaceInfo(); testGetAdaptersInfo(); testGetNetworkParams(); + return 0; } static void testGetPerAdapterInfo(void) @@ -839,6 +840,7 @@ static void test_GetAdaptersAddresses(void) ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret); + size = 0; ret = gGetAdaptersAddresses(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; @@ -849,16 +851,16 @@ static void test_GetAdaptersAddresses(void) while (!ret && winetest_debug > 1 && aa) { - trace("Length: %u\n", aa->Length); - trace("IfIndex: %u\n", aa->IfIndex); + trace("Length: %u\n", S(U(*aa)).Length); + trace("IfIndex: %u\n", S(U(*aa)).IfIndex); trace("Next: %p\n", aa->Next); trace("AdapterName: %s\n", aa->AdapterName); trace("FirstUnicastAddress: %p\n", aa->FirstUnicastAddress); ua = aa->FirstUnicastAddress; while (ua) { - trace("\tLength: %u\n", ua->Length); - trace("\tFlags: 0x%08x\n", ua->Flags); + trace("\tLength: %u\n", S(U(*ua)).Length); + trace("\tFlags: 0x%08x\n", S(U(*ua)).Flags); trace("\tNext: %p\n", ua->Next); trace("\tAddress.lpSockaddr: %p\n", ua->Address.lpSockaddr); trace("\tAddress.iSockaddrLength: %d\n", ua->Address.iSockaddrLength); @@ -894,9 +896,16 @@ START_TEST(iphlpapi) loadIPHlpApi(); if (hLibrary) { + HANDLE thread; + testWin98OnlyFunctions(); testWinNT4Functions(); - testWin98Functions(); + + /* run testGetXXXX in two threads at once to make sure we don't crash in that case */ + thread = CreateThread(NULL, 0, testWin98Functions, NULL, 0, NULL); + testWin98Functions(NULL); + WaitForSingleObject(thread, INFINITE); + testWin2KFunctions(); test_GetAdaptersAddresses(); freeIPHlpApi(); -- 2.17.1