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

Download history 208/week @ 2024-07-29 214/week @ 2024-08-05 194/week @ 2024-08-12 184/week @ 2024-08-19 374/week @ 2024-08-26 199/week @ 2024-09-02 71/week @ 2024-09-09 67/week @ 2024-09-16 238/week @ 2024-09-23 273/week @ 2024-09-30 239/week @ 2024-10-07 234/week @ 2024-10-14 251/week @ 2024-10-21 283/week @ 2024-10-28 354/week @ 2024-11-04 322/week @ 2024-11-11

1,236 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