cdylib-shim 0.1.1

A macro for creating dynamic library shims that can intercept and modify function calls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::PathBuf;

pub use libloading::{Error, Library, Symbol};

#[cfg(windows)]
pub fn system_dir() -> Option<PathBuf> {
    let system_root = std::env::var("SYSTEMROOT").ok()?;
    let path = PathBuf::from(format!("{}\\System32", system_root));
    Some(path)
}

#[cfg(not(windows))]
pub fn system_dir() -> Option<PathBuf> {
    None
}