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

#127 in Operating systems

Download history 167/week @ 2024-01-17 183/week @ 2024-01-24 213/week @ 2024-01-31 238/week @ 2024-02-07 251/week @ 2024-02-14 305/week @ 2024-02-21 357/week @ 2024-02-28 536/week @ 2024-03-06 410/week @ 2024-03-13 389/week @ 2024-03-20 296/week @ 2024-03-27 238/week @ 2024-04-03 448/week @ 2024-04-10 366/week @ 2024-04-17 353/week @ 2024-04-24 201/week @ 2024-05-01

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