Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor usability improvements for NTSTATUS #997

Merged
merged 2 commits into from
Jul 23, 2021
Merged

Minor usability improvements for NTSTATUS #997

merged 2 commits into from
Jul 23, 2021

Conversation

kennykerr
Copy link
Collaborator

Based on feedback here #994

@kennykerr kennykerr merged commit de73343 into master Jul 23, 2021
@kennykerr kennykerr deleted the ntstatus2 branch July 23, 2021 20:17
@tim-weis
Copy link
Contributor

This looks better, and addresses all concerns that were raised. It supports convenient .ok()? error propagation, makes it possible to preserve non-zero success codes, and provides a way to translate from NTSTATUS codes to corresponding HRESULT values for easy comparison.

It's better than what we currently have, and I would be happy to try how well this works out in practice.

Honestly, though, I'm growing increasingly skeptical, that solving this entirely outside the core library is the correct solution. The binary protocol for HRESULT expressly includes representation of NTSTATUS values, where Windows' HRESULT implementation only covers part of it. It would feel natural to have an implementation that covers the entire binary protocol, especially with HRESULT being the pivot point of Windows' error representation.

Maybe this will need to be re-evaluated at some point. Not at this time, I'm more than happy with what this change delivers as it stands. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants