cfun 0.2.11

Tidy up common functions
Documentation
1
2
3
4
5
6
7
8
#[cfg(all(target_arch = "x86_64", target_os = "windows"))]
pub fn cpu_is_enable_virtual() -> bool {
    use std::arch::x86_64::__cpuid;
    let cpuid_result = unsafe { __cpuid(1) };
    // 检查 HyperVisor 是否存在(ECX 位 31)
    let hypervisor_present = (cpuid_result.ecx & (1 << 31)) != 0;
    hypervisor_present
}