Commit 3e036997 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

iphlpapi: Return gateway address 0.0.0.0/255.255.255.255 from GetAdaptersInfo if it's not set.

parent 1e8cfc01
......@@ -742,6 +742,8 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
}
/* Find first router through this interface, which we'll assume
* is the default gateway for this adapter */
strcpy(ptr->GatewayList.IpAddress.String, "0.0.0.0");
strcpy(ptr->GatewayList.IpMask.String, "255.255.255.255");
for (i = 0; i < routeTable->dwNumEntries; i++)
if (routeTable->table[i].dwForwardIfIndex == ptr->Index
&& routeTable->table[i].u1.ForwardType ==
......
......@@ -1120,10 +1120,13 @@ static void testGetAdaptersInfo(void)
apiReturn);
ptr = buf;
while (ptr) {
ok(ptr->IpAddressList.IpAddress.String[0], "A valid IP must be present\n");
ok(ptr->IpAddressList.IpAddress.String[0], "A valid IP address 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);
ok(ptr->GatewayList.IpAddress.String[0], "A valid IP address must be present\n");
ok(ptr->GatewayList.IpMask.String[0], "A valid mask must be present\n");
trace("adapter '%s', address %s/%s gateway %s/%s\n", ptr->AdapterName,
ptr->IpAddressList.IpAddress.String, ptr->IpAddressList.IpMask.String,
ptr->GatewayList.IpAddress.String, ptr->GatewayList.IpMask.String);
ptr = ptr->Next;
}
HeapFree(GetProcessHeap(), 0, buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment