Skip to content

windows-bindgen should generate more specific Result<T, E> types #3294

Open

Description

Rather than folding all error types into the windows_result::Error type, APIs can more specifically return Result<T, HRESULT>, Result<T, NTSTATUS>, and so on. This would avoid the overhead that necessitated #3126 and allow simple pattern matching for error handling. The reasoning around the Windows-specific Result<T, Error> is that it additionally carries any IErrorInfo that may have been associated with the calling thread. This turns out to be used by very few APIs but can still be supported as needed through conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions