| Crates.io | winresult |
| lib.rs | winresult |
| version | 0.1.3 |
| created_at | 2022-02-21 21:10:44.809599+00 |
| updated_at | 2022-10-07 00:21:36.126979+00 |
| description | windows result codes |
| homepage | |
| repository | https://github.com/MaulingMonkey/winresult |
| max_upload_size | |
| id | 536965 |
| size | 4,303,562 |
Debug-friendly types for windows result codes.
u32 error codes are annoying to dbg!(...). winresult has awesome Debug impls.
u32 error codes are annoying to view in your debugger. winresult has awesome *.natvis files. Use natvis-pdbs!
typoing ERROR_WHATEVER in a match is a mere warning. ERROR::WHATEVER is a hard error.
(I'd still use #![deny(unreachable_patterns)] anyways.)
ERROR_INVALID_FUNCTION == S_FALSE (== 1.) Lame!
ERROR_FILE_NOT_FOUND (2) is a mess. A function or GetLastError might return:
| label | value | notes |
|---|---|---|
ERROR_FILE_NOT_FOUND |
0x00000002 |
Not an HRESULT (would be "successful") |
HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) |
0x80070002 |
hresult.info "incorrectly" labels ERROR_* as this |
D3D10_ERROR_FILE_NOT_FOUND |
0x88790002 |
Different facility, same code |
D3D11_ERROR_FILE_NOT_FOUND |
0x887C0002 |
Different facility, same code |
ERROR_* is a mixture of HRESULTs and non-HRESULTs. Can you keep them straight? No. No you cannot. Stop lying.
Licensed under either of
at your option.
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.