RtlGetVersion

[DllImport("ntdll.dll", SetLastError = true)]
public static extern int RtlGetVersion(
   ref OSVERSIONINFOEXW lpVersionInformation
);

Microsoft documentation: Link

Last updated