Fix pinvoked function name and marshaling of MIB stats.
authorAtsushi Eno <atsushi@ximian.com>
Wed, 11 Aug 2010 14:24:06 +0000 (23:24 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Wed, 11 Aug 2010 14:24:06 +0000 (23:24 +0900)
mcs/class/System/System.Net.NetworkInformation/IPGlobalProperties.cs
mcs/class/System/System.Net.NetworkInformation/IPGlobalStatistics.cs

index d3be931cbb03bcaa45d7fb5be6a47c17f8a1d0c1..fa94ef6a189a62e64b05645425c3aa6b0a68fea4 100644 (file)
@@ -479,7 +479,7 @@ namespace System.Net.NetworkInformation {
                        if (!Socket.SupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_IPSTATS stats;
-                       GetIPStatisticsEx (out stats, AF_INET);
+                       GetIpStatisticsEx (out stats, AF_INET);
                        return new Win32IPGlobalStatistics (stats);
                }
 
@@ -488,7 +488,7 @@ namespace System.Net.NetworkInformation {
                        if (!Socket.OSSupportsIPv6)
                                throw new NetworkInformationException ();
                        Win32_MIB_IPSTATS stats;
-                       GetIPStatisticsEx (out stats, AF_INET6);
+                       GetIpStatisticsEx (out stats, AF_INET6);
                        return new Win32IPGlobalStatistics (stats);
                }
 
@@ -575,7 +575,7 @@ namespace System.Net.NetworkInformation {
                static extern int GetIcmpStatisticsEx (out Win32_MIB_ICMP_EX pStats, int dwFamily);
 
                [DllImport ("Iphlpapi.dll")]
-               static extern int GetIPStatisticsEx (out Win32_MIB_IPSTATS pStats, int dwFamily);
+               static extern int GetIpStatisticsEx (out Win32_MIB_IPSTATS pStats, int dwFamily);
 
                // Win32 structures
 
index 2ba59ef1a52b6b7677bdf8b2b9d2a1cb31618f63..1745dd4b7b35d1ae6aad5effbdc477f6a3cea9aa 100644 (file)
@@ -29,6 +29,7 @@
 #if NET_2_0
 using System.Collections.Specialized;
 using System.Globalization;
+using System.Runtime.InteropServices;
 
 namespace System.Net.NetworkInformation {
        public abstract class IPGlobalStatistics {
@@ -219,6 +220,7 @@ namespace System.Net.NetworkInformation {
                }
        }
 
+       [StructLayout (LayoutKind.Sequential)]
        struct Win32_MIB_IPSTATS
        {
                public int Forwarding;