iphlpapi: Update the buffer size only if required in GetAdaptersAddresses.

This commit is contained in:
Bruno Jesus 2015-04-16 01:23:50 -03:00 committed by Alexandre Julliard
parent a49668e8bc
commit 708ab4ca12
2 changed files with 3 additions and 2 deletions

View File

@ -1382,8 +1382,10 @@ ULONG WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG family, ULONG flags, P
ret = ERROR_SUCCESS;
}
else
{
ret = ERROR_BUFFER_OVERFLOW;
*buflen = total_size;
*buflen = total_size;
}
TRACE("num adapters %u\n", table->numIndexes);
HeapFree(GetProcessHeap(), 0, table);

View File

@ -1338,7 +1338,6 @@ static void test_GetAdaptersAddresses(void)
ptr = HeapAlloc(GetProcessHeap(), 0, osize);
ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &osize);
ok(!ret, "expected ERROR_SUCCESS got %u\n", ret);
todo_wine
ok(osize == size, "expected %d, got %d\n", size, osize);
for (aa = ptr; !ret && aa; aa = aa->Next)