#![allow(unsafe_code)]
#[cfg(feature = "registry")]
#[allow(
clippy::upper_case_acronyms,
reason = "matches the Win32 `HKEY` typedef name verbatim"
)]
pub(crate) type HKEY = *mut core::ffi::c_void;
#[cfg(feature = "registry")]
pub(crate) const HKEY_LOCAL_MACHINE: HKEY =
0x8000_0002_u32 as i32 as isize as *mut core::ffi::c_void;
#[cfg(feature = "registry")]
pub(crate) const KEY_READ: u32 = 0x2_0019;
#[cfg(feature = "registry")]
pub(crate) const RRF_RT_REG_QWORD: u32 = 0x0000_0040;
#[cfg(feature = "registry")]
pub(crate) const ERROR_SUCCESS: u32 = 0;
#[link(name = "kernel32")]
unsafe extern "system" {
pub(crate) safe fn IsProcessorFeaturePresent(ProcessorFeature: u32) -> i32;
}
#[cfg(feature = "registry")]
#[link(name = "advapi32")]
unsafe extern "system" {
pub(crate) fn RegOpenKeyExW(
hKey: HKEY,
lpSubKey: *const u16,
ulOptions: u32,
samDesired: u32,
phkResult: *mut HKEY,
) -> u32;
pub(crate) fn RegGetValueW(
hkey: HKEY,
lpSubKey: *const u16,
lpValue: *const u16,
dwFlags: u32,
pdwType: *mut u32,
pvData: *mut core::ffi::c_void,
pcbData: *mut u32,
) -> u32;
pub(crate) fn RegCloseKey(hKey: HKEY) -> u32;
}