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

#130 in Operating systems

Download history 138/week @ 2023-12-23 131/week @ 2023-12-30 160/week @ 2024-01-06 172/week @ 2024-01-13 176/week @ 2024-01-20 191/week @ 2024-01-27 248/week @ 2024-02-03 198/week @ 2024-02-10 286/week @ 2024-02-17 308/week @ 2024-02-24 568/week @ 2024-03-02 434/week @ 2024-03-09 347/week @ 2024-03-16 350/week @ 2024-03-23 328/week @ 2024-03-30 176/week @ 2024-04-06

1,262 downloads per month
Used in 10 crates (6 directly)

MIT/Apache

27KB
131 lines

minidl

Crates.io Docs unsafe: yes rust: stable License
GitHub Build Status Open issues dependency status

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

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.

No runtime deps