iphlpapi: Set ConnectionType in GetAdaptersAddresses.
authorJuan Lang <juan.lang@gmail.com>
Thu, 16 Sep 2010 17:44:04 +0000 (10:44 -0700)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 24 Sep 2010 09:34:16 +0000 (11:34 +0200)
dlls/iphlpapi/iphlpapi_main.c

index d06b44c1eb69ca41a3ce05e018edfa048abc8d8a..6ec06e818f2f6520ce217232a6ecf60c2cbf6c96 100644 (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);