From 614e7d931d0c9f455d35fad569b63a8f16285b0a Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 23 Aug 2024 09:58:26 +0200 Subject: [PATCH] Re-generated linux headers and updated build.rs for latest bindgen --- .cargo/{config => config.toml} | 0 leechcore-sys/build.rs | 2 +- leechcore-sys/src/leechcore_linux.rs | 106 +++++++++++++++++++++++++-- 3 files changed, 99 insertions(+), 9 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/leechcore-sys/build.rs b/leechcore-sys/build.rs index b6d844f..1e609f8 100644 --- a/leechcore-sys/build.rs +++ b/leechcore-sys/build.rs @@ -1,7 +1,7 @@ extern crate cc; extern crate pkg_config; -#[cfg(bindgen)] +#[cfg(feature = "bindgen")] extern crate bindgen; use std::env; diff --git a/leechcore-sys/src/leechcore_linux.rs b/leechcore-sys/src/leechcore_linux.rs index 7788193..5e66128 100644 --- a/leechcore-sys/src/leechcore_linux.rs +++ b/leechcore-sys/src/leechcore_linux.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.1 */ +/* automatically generated by rust-bindgen 0.69.4 */ #[repr(C)] #[derive(Default)] @@ -33,7 +33,7 @@ impl ::std::fmt::Debug for __IncompleteArrayField { pub const _INTTYPES_H: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; +pub const __GLIBC_USE_ISOC23: u32 = 0; pub const __USE_ISOC11: u32 = 1; pub const __USE_ISOC99: u32 = 1; pub const __USE_ISOC95: u32 = 1; @@ -51,12 +51,13 @@ pub const __WORDSIZE: u32 = 64; pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; pub const __SYSCALL_WORDSIZE: u32 = 64; pub const __TIMESIZE: u32 = 64; +pub const __USE_TIME_BITS64: u32 = 1; pub const __USE_MISC: u32 = 1; pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const __GLIBC_USE_C2X_STRTOL: u32 = 0; +pub const __GLIBC_USE_C23_STRTOL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_60559_BFP__: u32 = 201404; @@ -65,7 +66,7 @@ pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; pub const __STDC_ISO_10646__: u32 = 201706; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 38; +pub const __GLIBC_MINOR__: u32 = 40; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; @@ -73,10 +74,10 @@ pub const __HAVE_GENERIC_SELECTION: u32 = 1; pub const _STDINT_H: u32 = 1; pub const __GLIBC_USE_LIB_EXT2: u32 = 0; pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT_C23: u32 = 0; pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C23: u32 = 0; pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; pub const _BITS_TYPES_H: u32 = 1; pub const _BITS_TYPESIZES_H: u32 = 1; @@ -90,6 +91,7 @@ pub const _BITS_TIME64_H: u32 = 1; pub const _BITS_WCHAR_H: u32 = 1; pub const _BITS_STDINT_INTN_H: u32 = 1; pub const _BITS_STDINT_UINTN_H: u32 = 1; +pub const _BITS_STDINT_LEAST_H: u32 = 1; pub const INT8_MIN: i32 = -128; pub const INT16_MIN: i32 = -32768; pub const INT32_MIN: i32 = -2147483648; @@ -462,6 +464,7 @@ pub const LC_STATISTICS_ID_GETOPTION: u32 = 5; pub const LC_STATISTICS_ID_SETOPTION: u32 = 6; pub const LC_STATISTICS_ID_COMMAND: u32 = 7; pub const LC_STATISTICS_ID_MAX: u32 = 7; +pub const LC_VMM_VERSION: u32 = 518979585; pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; pub type __u_int = ::std::os::raw::c_uint; @@ -2631,11 +2634,11 @@ pub type UCHAR = u8; pub type CHAR = ::std::os::raw::c_char; pub type PCHAR = *mut ::std::os::raw::c_char; pub type LPSTR = *mut ::std::os::raw::c_char; -pub type LPCSTR = *mut ::std::os::raw::c_char; +pub type LPCSTR = *const ::std::os::raw::c_char; pub type WCHAR = u16; pub type PWCHAR = *mut u16; pub type LPWSTR = *mut u16; -pub type LPCWSTR = *mut u16; +pub type LPCWSTR = *const u16; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct LC_CONFIG { @@ -3517,6 +3520,93 @@ pub type PLC_TLP_FUNCTION_CALLBACK = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct tdLC_VMM { + pub dwVersion: DWORD, + pub hVMM: HANDLE, + pub hVMMVM: HANDLE, + pub pfnVMMDLL_ConfigGet: PVOID, + pub pfnVMMDLL_VmMemReadScatter: PVOID, + pub pfnVMMDLL_VmMemWriteScatter: PVOID, +} +#[test] +fn bindgen_test_layout_tdLC_VMM() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(tdLC_VMM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_VMM)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dwVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_VMM), + "::", + stringify!(dwVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hVMM) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_VMM), + "::", + stringify!(hVMM) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hVMMVM) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tdLC_VMM), + "::", + stringify!(hVMMVM) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfnVMMDLL_ConfigGet) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tdLC_VMM), + "::", + stringify!(pfnVMMDLL_ConfigGet) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfnVMMDLL_VmMemReadScatter) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tdLC_VMM), + "::", + stringify!(pfnVMMDLL_VmMemReadScatter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pfnVMMDLL_VmMemWriteScatter) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(tdLC_VMM), + "::", + stringify!(pfnVMMDLL_VmMemWriteScatter) + ) + ); +} +pub type LC_VMM = tdLC_VMM; +pub type PLC_VMM = *mut tdLC_VMM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct tdLC_BAR { pub fValid: BOOL, pub fIO: BOOL,