/// Get the version of the currently running kernel. /// /// **Note**: On Windows 8 and later this will report the Windows 8 OS version value `6.2`, /// unless the final application is build to explicitly target Windows 10. /// See [`GetVersionEx`] for details. /// /// [`GetVersionEx`]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa /// /// /// Returns `None` if an error occured. pubfn kernel_version() -> Option<String> { unsafe { // Windows 10 should report "10.0", which is 4 bytes, // "unknown" is 7 bytes. // We need to account for the null byte. let size = 8; letmut buf = vec![0; size]; let written = get_os_release(buf.as_mut_ptr() as _, size) as usize; match written { 0 => None,
_ => Some(String::from_utf8_lossy(&buf[0..written]).into_owned()),
}
}
}
/// Get the build number from Windows. /// /// **Note**: On Windows 8 and later this may report a Windows 8 build number, /// for example 9200, unless the final application is build to explicitly /// target Windows 10. /// See [`GetVersionEx`] for details. /// /// [`GetVersionEx`]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa /// /// /// Returns `None` if an error occured. pubfn windows_build_number() -> Option<i32> { unsafe { // Get windows build number let build_number = get_build_number(); match build_number { 0 => None,
_ => Some(build_number),
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.