System.PlatformDetection.GetWindowsBuildNumber C# (CSharp) Method

GetWindowsBuildNumber() private static method

private static GetWindowsBuildNumber ( ) : int
return int
        private static int GetWindowsBuildNumber()
        {
            if (IsWindows)
            {
                RTL_OSVERSIONINFOEX osvi = new RTL_OSVERSIONINFOEX();
                osvi.dwOSVersionInfoSize = (uint)Marshal.SizeOf(osvi);
                Assert.Equal(0, RtlGetVersion(out osvi));
                return (int)osvi.dwBuildNumber;
            }

            return -1;
        }