MaulingMonkey / firehazard

Unopinionated low level API bindings focused on soundness, safety, and stronger types over raw FFI.
Other
8 stars 0 forks source link

Type: limit access to `close_handle`? (Desktop handles cannot ever be closed using it) #33

Open MaulingMonkey opened 2 years ago

MaulingMonkey commented 2 years ago

Niche function, fairly harmless runtime bug if called (e.g. passing a desktop handle results in ERROR_INVALID_HANDLE.)

Some other generic HANDLE functions (e.g. get_handle_information) should still work on desktop handles. This might simply be a matter of preventing desktop::OwnedHandle => handle::Owned conversion, but still allowing conversion to handle::Borrowed?