Crates.io | minidl |
lib.rs | minidl |
version | 0.1.6 |
source | src |
created_at | 2020-01-14 21:12:24.448891 |
updated_at | 2023-12-08 23:20:47.000329 |
description | Extremely lean cross platform library for loading symbols |
homepage | |
repository | https://github.com/MaulingMonkey/minidl |
max_upload_size | |
id | 198422 |
size | 44,253 |
Extremely lean cross platform library for loading symbols.
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"),
})}
}
}
Licensed under either of
at your option.
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.