Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetOSVersion()

static unsafe OperatingSystem System.Environment.GetOSVersion ( )
inlinestaticprivate

Definition at line 856 of file Environment.cs.

857 {
858 if (Interop.NtDll.RtlGetVersionEx(out var osvi) != 0)
859 {
860 throw new InvalidOperationException(SR.InvalidOperation_GetVersion);
861 }
862 Version version = new Version((int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion, (int)osvi.dwBuildNumber, 0);
863 if (osvi.szCSDVersion[0] == '\0')
864 {
865 return new OperatingSystem(PlatformID.Win32NT, version);
866 }
867 return new OperatingSystem(PlatformID.Win32NT, version, new string(osvi.szCSDVersion));
868 }
static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi)
Definition Interop.cs:1681
static Version Version

References System.SR.InvalidOperation_GetVersion, Interop.NtDll.RtlGetVersionEx(), and System.Environment.Version.