Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/whatsys/src/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  windows.rs

  Sprache: Rust
 

use libc::{c_char, c_int};

extern "C" {
    fn get_os_release(outbuf: *const c_char, outlen: usize) -> c_int;
    fn get_build_number() -> c_int;
}

/// 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.
pub fn 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;
        let mut 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.
pub fn 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
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-18) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.