示例#1
0
        public static bool?SocketsReuseUnicastPortSupport()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                RTL_OSVERSIONINFOW v = default(RTL_OSVERSIONINFOW);
                v.dwOSVersionInfoSize = (uint)Marshal.SizeOf <RTL_OSVERSIONINFOW>();
                RtlGetVersion(ref v);

                if (v.dwMajorVersion == 10)
                {
                    return(true);
                }
                else if (v.dwMajorVersion == 6 && (v.dwMinorVersion == 2 || v.dwMinorVersion == 3))
                {
                    // On Windows 8/Windows Server 2012 (major=6, minor=2) or Windows 8.1/Windows Server 2012 R2
                    // (major=6, minor=3), this feature is not present unless a servicing patch is installed.
                    // So, we return null to indicate that it is indeterminate whether the feature is active.
                    return(null);
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }
示例#2
0
        public static bool SocketsReuseUnicastPortSupport()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                RTL_OSVERSIONINFOW v = default(RTL_OSVERSIONINFOW);
                v.dwOSVersionInfoSize = (uint)Marshal.SizeOf <RTL_OSVERSIONINFOW>();
                RtlGetVersion(ref v);

                return(v.dwMajorVersion == 10);
            }

            return(false);
        }
示例#3
0
 private static extern int RtlGetVersion(ref RTL_OSVERSIONINFOW lpVersionInformation);
示例#4
0
 private static int RtlGetVersion(ref RTL_OSVERSIONINFOW lpVersionInformation) => throw new PlatformNotSupportedException();
示例#5
0
 private static extern int RtlGetVersion(ref RTL_OSVERSIONINFOW lpVersionInformation);
示例#6
0
 public static extern int RtlGetVersion([In, Out] ref RTL_OSVERSIONINFOW lpVersionInformation);