iphlpapi/tests: Trace network prefixes in the test for GetAdaptersAddresses.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2016-03-22 14:36:33 +01:00 committed by Alexandre Julliard
parent f8d47a6637
commit e8ceab5344
1 changed files with 14 additions and 1 deletions

View File

@ -1379,13 +1379,14 @@ static void test_GetAdaptersAddresses(void)
size *= 2; size *= 2;
osize = size; osize = size;
ptr = HeapAlloc(GetProcessHeap(), 0, osize); ptr = HeapAlloc(GetProcessHeap(), 0, osize);
ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &osize); ret = pGetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, ptr, &osize);
ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); ok(!ret, "expected ERROR_SUCCESS got %u\n", ret);
ok(osize == size, "expected %d, got %d\n", size, osize); ok(osize == size, "expected %d, got %d\n", size, osize);
for (aa = ptr; !ret && aa; aa = aa->Next) for (aa = ptr; !ret && aa; aa = aa->Next)
{ {
char temp[128]; char temp[128];
IP_ADAPTER_PREFIX *prefix;
ok(S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_LH) || ok(S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_LH) ||
S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_XP), S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_XP),
@ -1452,6 +1453,18 @@ static void test_GetAdaptersAddresses(void)
sprintf(temp + strlen(temp), "%d ", aa->ZoneIndices[i]); sprintf(temp + strlen(temp), "%d ", aa->ZoneIndices[i]);
trace("ZoneIndices: %s\n", temp); trace("ZoneIndices: %s\n", temp);
trace("FirstPrefix: %p\n", aa->FirstPrefix); trace("FirstPrefix: %p\n", aa->FirstPrefix);
prefix = aa->FirstPrefix;
while (prefix)
{
trace("\tLength: %u\n", S(U(*prefix)).Length);
trace("\tFlags: 0x%08x\n", S(U(*prefix)).Flags);
trace("\tNext: %p\n", prefix->Next);
trace("\tAddress.lpSockaddr: %p\n", prefix->Address.lpSockaddr);
trace("\tAddress.iSockaddrLength: %d\n", prefix->Address.iSockaddrLength);
trace("\tPrefixLength: %u\n", prefix->PrefixLength);
trace("\n");
prefix = prefix->Next;
}
if (S(U(*aa)).Length < sizeof(IP_ADAPTER_ADDRESSES_LH)) continue; if (S(U(*aa)).Length < sizeof(IP_ADAPTER_ADDRESSES_LH)) continue;
trace("TransmitLinkSpeed: %s\n", debugstr_longlong(aa->TransmitLinkSpeed)); trace("TransmitLinkSpeed: %s\n", debugstr_longlong(aa->TransmitLinkSpeed));