rustftechh 0.1.1

A blazingly fast, highly extensible, and feature-rich system information tool written in Rust with fastfetch parity and multi-distro logos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::ffi;
use crate::utils::clean;

pub fn detect_kernel() -> Option<String> {
    unsafe {
        let mut info = ffi::OSVERSIONINFOW::zeroed();
        if ffi::RtlGetVersion(&mut info) != 0 {
            return None;
        }
        Some(clean(&format!(
            "WIN32_NT {}.{}.{}",
            info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber
        )))
    }
}