winmmf-ffi

Crates.iowinmmf-ffi
lib.rswinmmf-ffi
version
sourcesrc
created_at2024-10-15 10:36:04.833977
updated_at2024-10-16 11:52:09.588098
descriptionA wrapper for WinMMF to make it usable as a cdylib.
homepagehttps://skaye.blog/winmmf/overview
repositoryhttps://github.com/RivenSkaye/WinMMF-rs
max_upload_size
id1409221
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Martin (RivenSkaye)

documentation

README

FFI wrapper for WinMMF

This is a wrapper for WinMMF designed to use it from other languages. The main idea is that the only extensively documented interface is the WinSDK one. There is an interface available in dotnet, but the documentation leaves a fair bit to be desired. It mentions use as IPC, but then only for sharing with child processes or not sharing at all. Other languages and runtimes don't seem to wrap and provide the API at all, or only through direct OS bindings. This crate would serve as an intermediary layer to provide a unified, well-defined, ergonomic API that can be made usable anywhere. No guarantees are made about bindgen outputs. I would expect it to provide well-formed output and possibly even the correct checks for the use of non-zero integer types, but it'd be best to still manually do some checking and cleanup.

[!NOTE] Please do not use this crate as a safe wrapper for use in C or C++. While it would probably work, you'll only hurt performance. WinMMF uses microseh (a thin C wrapper for Windows' very special exception model) so it should in most or all cases be faster to just use __try and __except and the MSVC toolchain. For most use cases, LLVM has you covered with their implementations of those error handling steps, behind -fms-compatibility. If you need Windows headers to build against, you might want to see where xwin gets them.

Wrappers for languages

Are you missing a language? Feel free to PR it in!

A brief summary of the language for which bindgen exists and an effort is being made to keep it officially supported. The bindgen output can be enabled through custom config flags that optionally let you set the output filename, but with sane defaults. Flags can be provided in the following forms:

  • --cfg gen<LANG> OR
  • --cfg gen<LANG>=outfile.name

Where <LANG> is the value listed behind the language name. The generated file(s) can be found in $OUT_DIR/../../generated/, e.g. ./target/debug/build/generated/

For ease of use, the table below includes the actual flag values.

Language Value Flag Bindgen
C# CS gencs csbindgen
Commit count: 158

cargo fmt