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

#197 in Operating systems

Download history 238/week @ 2024-11-17 354/week @ 2024-11-24 340/week @ 2024-12-01 333/week @ 2024-12-08 333/week @ 2024-12-15 150/week @ 2024-12-22 137/week @ 2024-12-29 194/week @ 2025-01-05 202/week @ 2025-01-12 396/week @ 2025-01-19 366/week @ 2025-01-26 301/week @ 2025-02-02 383/week @ 2025-02-09 444/week @ 2025-02-16 584/week @ 2025-02-23 203/week @ 2025-03-02

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