Sha256: 26492b2ef34f4a3ac35f41050a9088ee15603caf0a59c6e74fdf423bfcb96829
Contents?: true
Size: 653 Bytes
Versions: 19
Compression:
Stored size: 653 Bytes
Contents
use super::*; /// Attempts to load a function from a given library. /// /// This is a small wrapper around `LoadLibrary` and `GetProcAddress`. /// /// # Safety /// /// * Both the library and function names must be valid null-terminated strings. pub unsafe fn delay_load<T>(library: crate::PCSTR, function: crate::PCSTR) -> Option<T> { let library = LoadLibraryExA(library.0, 0, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if library == 0 { return None; } let address = GetProcAddress(library, function.0); if address.is_some() { return Some(std::mem::transmute_copy(&address)); } FreeLibrary(library); None }
Version data entries
19 entries across 19 versions & 1 rubygems