Skip to content
New issue

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

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

Already on GitHub? # to your account

windows-bindgen now uses Ref and OutRef for COM interface traits #3386

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

kennykerr
Copy link
Collaborator

Earlier this year I was working on improving COM authoring support and came up with Ref and OutRef to simplify support for the complex memory layout and lifetime management required by COM interface parameters. #3025

This was only available as an opt-in for hand-written code and your own COM interfaces defined with the interface macro. In particular, the traits generated by the windows-bindgen crate did not use Ref and OutRef and instead continued to use Option in various ways.

With this update the two streams converge and windows-bindgen will now use Ref and OutRef as appropriate. This makes programming across custom and generated COM interfaces more consistent and easier to understand. It also avoids a few pitfalls that Ref and OutRef solve that would otherwise not be possible to rectify without it.

The Ref type now also has a few more convenience methods to directly support common COM programming scenarios.

This does not quite close #3233 but it does get us closer.

@kennykerr kennykerr merged commit fa2b63a into master Dec 13, 2024
75 checks passed
@kennykerr kennykerr deleted the uniform-ref-params branch December 13, 2024 12:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate Param/Ref/InterfaceRef etc
1 participant