Repository navigation
Preserve Win32 resources when result cleanup fails - #155
Merged
Merged
Conversation
Retain owned return and out-slot resources through result processing, expose retryable Win32 call errors in Rust and JavaScript, and preserve native owners through error transport and projection failures. Add failure, retry, alias, lease, GC, and compatibility coverage without changing WinRT or COM models. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Mixed-language test coverageWorkflow status: ✅ Passed
|
Restore the exact pre-PR152 root README without the flat Win32 introduction or project-wide experimental notice. Keep experimental guidance only in the dedicated flat Win32 architecture document. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Use null-prototype recovery descriptors and retain the original native carrier if AggregateError construction or decoration fails. Add projection-independent static recovery methods and regressions for prototype pollution, nested failures, and native owner lifetime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Shawn Yuan (shuaiyuanxx)
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep ownership of direct-return and independent out-slot resources when native cleanup fails, instead of losing the resource while consuming its result slot.
CallError, with the result target, original cleanup error, shared resource owner, and explicit retry.DynWin32CallErroron the Win32 subpaths. Its immutablecleanupFailuresrecords andretryCleanup()remain usable after failed retries or JavaScript projection errors.This is a focused follow-up to #152, not unsafe code generation or a COM/WinRT refactor.
README scope
Restore the root README to its exact content before #152, removing the project-wide experimental notice and the flat Win32 introduction. Keep the experimental notice only in the dedicated flat Win32 architecture document.
Compatibility
The Rust
win32::CallPlan::invoke()error type is nowwin32::CallError, rather than the shared WinRT error type.message()andsource_error()expose the original invocation error;cleanup_failures()andretry_cleanup()provide recovery. The successfulCallResultshape and Win32 contract schema are unchanged.JavaScript errors without failed cleanup retain their existing behavior. The eight WinRT/COM public JavaScript and declaration facade files remain byte-identical.
Validation