Skip to content

Conversation

@kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Sep 30, 2025

The windows-result crate provides the essential source of Windows error handling and propagation and is the home of types like HRESULT and BOOL, but other types like those representing NT/Win32/RPC error codes have traditionally been left up to windows-bindgen or the windows crate to define. Increasingly as projects depend more on windows-bindgen rather than the monolithic windows crate, having these dedicated error types in one place makes life a lot easier and improves interopability while reducing everyone's dependence on the windows crate for such fundamental types.

So with this update, the following types move out of the windows crate and directly into the windows-result crate:

  • NTSTATUS
  • WIN32_ERROR
  • RPC_STATUS

The windows-result crate can now also provide richer conversions since the types are now known. As such, HRESULT's from_win32 and from_nt functions have been replaced with more natural From implementations as well as to_hresult alternatives for when you need const functions.

This does not affect raw or sys-style bindings.

This is also related to #3294 but does not yet change the default Result specialization as that is a much bigger change.

@kennykerr kennykerr merged commit 404397e into master Oct 9, 2025
29 checks passed
@kennykerr kennykerr deleted the more-result-types branch October 9, 2025 18:49
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