#api-bindings #windows

no-std fenestroj

Easier wrappers for Win32 API stuff, safe when possible

13 releases

0.0.11 Feb 22, 2020
0.0.10 Feb 22, 2020
0.0.9 Jan 31, 2020
0.0.3 Aug 18, 2019
0.0.2 Jul 22, 2019

#97 in Windows APIs

Download history 6/week @ 2023-10-21 28/week @ 2023-10-28 7/week @ 2023-11-04 6/week @ 2023-11-11 7/week @ 2023-11-18 46/week @ 2023-11-25 41/week @ 2023-12-02 18/week @ 2023-12-09 8/week @ 2023-12-16 30/week @ 2023-12-23 15/week @ 2023-12-30 4/week @ 2024-01-06 8/week @ 2024-01-13 27/week @ 2024-01-20 42/week @ 2024-01-27 16/week @ 2024-02-03

94 downloads per month
Used in vanadium

Zlib license

89KB
2K SLoC

License:Zlib Minimum Rust Version travis.ci AppVeyor crates.io docs.rs

fenestroj

Easier to use wrappers for winapi stuff.

All wrappers are kept in feature gated modules the same as how winapi works.

Conventions

  • Names:
    • Snake case function names: GetLastError becomes get_last_error
    • If there's an A and W variant of a winapi function, the W variant is used without "_w" on the end: GetMessageW becomes get_message
    • Some functions are new utilities to this crate, they just have names that don't conflict with any winapi name.
  • Arguments:
    • Enums are used when possible.
    • If there's some "obvious" default for the user to calculate then Option is sometimes used and it will do the calculation for you.
    • Functions with a large number of arguments are converted to take a single struct with a field for each argument so you don't have to remember the ordering perfectly.
  • Return Values:
    • Usage of bool, Option, or Result is done whenever possible.
    • Numeric codes are given newtype wrappers as often as possible: u32 error values become wrapped in pub struct ErrorCode(pub u32) for example.
  • Safety:
    • Things are all still left as unsafe until a careful investigation of the safety involved can be done.
    • The investigation process is generally "ask WinBun and hope they're not too busy to answer".

Dependencies

~235KB