iphlpapi: Set ConnectionType in GetAdaptersAddresses.

This commit is contained in:
Juan Lang 2010-09-16 10:44:04 -07:00 committed by Alexandre Julliard
parent df9191ae2d
commit 0905dfc3e7
1 changed files with 11 additions and 0 deletions

View File

@ -608,6 +608,16 @@ static DWORD typeFromMibType(DWORD mib_type)
}
}
static DWORD connectionTypeFromMibType(DWORD mib_type)
{
switch (mib_type)
{
case MIB_IF_TYPE_PPP: return NET_IF_CONNECTION_DEMAND;
case MIB_IF_TYPE_SLIP: return NET_IF_CONNECTION_DEMAND;
default: return NET_IF_CONNECTION_DEDICATED;
}
}
static ULONG v4addressesFromIndex(DWORD index, DWORD **addrs, ULONG *num_addrs)
{
ULONG ret, i, j;
@ -814,6 +824,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, DWORD index, IP_ADAPTER_ADD
getInterfacePhysicalByIndex(index, &buflen, aa->PhysicalAddress, &type);
aa->PhysicalAddressLength = buflen;
aa->IfType = typeFromMibType(type);
aa->ConnectionType = connectionTypeFromMibType(type);
getInterfaceMtuByName(name, &aa->Mtu);