This commit is contained in:
2023-09-04 06:26:35 -04:00
commit a5fe71ebb3
26 changed files with 1186 additions and 0 deletions

15
tests/test_lazy_import.rs Normal file
View File

@@ -0,0 +1,15 @@
use x::IntoUsize;
x::lazy_import! { "kernel32.dll"
pub fn LoadLibraryA(module_name: *const i8) -> &'static x::win32::ImageBase;
pub fn GetModuleHandleA(module_name: *const i8) -> &'static x::win32::ImageBase;
pub fn GetLastError() -> usize;
}
#[test]
#[cfg(feature = "win32")]
pub fn test_exports() {
let a = LoadLibraryA(x::cstr!("user32.dll"));
println!("{} -> {}",a.into_usize(), unsafe { a.nt_header().optional_header.size_of_image });
}