7 releases
0.1.6 | Dec 8, 2023 |
---|---|
0.1.5 | Dec 9, 2022 |
0.1.4 | Feb 7, 2022 |
0.1.3 | Jan 21, 2022 |
0.1.0 | Jan 14, 2020 |
#168 in Operating systems
1,236 downloads per month
Used in 10 crates
(6 directly)
27KB
131 lines
minidl
Extremely lean cross platform library for loading symbols.
- No dependencies (minimal build times)
- No macros (minimal build times)
- No safety (ABI mismatches would be unsound anyways)
Quick Start
use minidl::*;
use std::os::raw::*;
struct Example {
OutputDebugStringA: unsafe extern "system" fn (_: *const c_char),
Invalid_Optional: Option<unsafe extern "system" fn (_: *const c_char)>,
}
impl Example {
pub fn new() -> Result<Self> {
let lib = Library::load("kernel32.dll")?;
unsafe{Ok(Self{
OutputDebugStringA: lib.sym("OutputDebugStringA\0")?,
Invalid_Optional: lib.sym_opt("Invalid_Optional\0"),
})}
}
}
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.