Repository navigation
Add metadata-driven native COM one-shot completion (PR2/4) - #145
Merged
leileizhang (lei9444) merged 3 commits intoSep 9, 2026
Merged
Conversation
Generate bounded audio activation promises with validated WinMD contracts, libffi export/result plans, a native-only FTM signal sink, and owner-local result collection. Preserve synchronous JS callback thread restrictions. Cover publication, HRESULTs, ownership, teardown, bounds, and WinRT regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Preserve the existing synchronous and asynchronous activation target sets and native contracts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
* Add guarded COM borrowed-copy transactions Add metadata-validated owned-copy plans for Audio, WIC BGRA8 and linear Media Foundation buffers. Observe real successful Audio initialization and GetService calls, retain canonical identity provenance across aliases, and finalize native borrows exactly once with thread and poison guards. Preserve WIC's existing complete surface, keep three copy-only facades out of complete-interface counts, require full regeneration, and add exact metadata evidence, native fixtures, live x64/i686 tests and regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Refactor COM borrowed copies into typed execution recipes Centralize reviewed ABI and lifecycle evidence in a shared contracts crate. Execute typed bindings, bounds, copies and finalizers through one plan-driven runtime while preserving public APIs and supported interfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Guard managed COM arguments before native dispatch Retain shared apartment and lifecycle contexts across interface aliases and supported containers. Recheck receivers and inputs after native coercion, preserve deferred WinRT lifetime behavior, and reject poisoned buffer inputs before IMFSample can retain them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Project ambiguous COM overloads as explicit slot-named methods (#147) Preserve existing arity/shape dispatch for distinguishable groups. Emit stable AtSlot names for previously unsupported ordinary overloads without guessing ABI behavior, retain each validated method plan, reject alias collisions, and update exact coverage evidence. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
leileizhang (lei9444)
added a commit
that referenced
this pull request
Sep 9, 2026
* Add safe COM projection and endpoint activation Provide non-consuming COM projectAs with registered safe descriptors, restricted in-process IMMDevice activation with native NULL parameters, and exact GetId ownership. Preserve the WinRT root and dynamic architecture; require complete COM regeneration with manifest v3. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Move endpoint activation targets into a cited contract registry Preserve the five existing target IIDs, in-process context, native NULL parameters and owned result contract. Validate named evidence records and lower dynamic-length IID lists without changing generated bindings or coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Add metadata-driven native COM one-shot completion (PR2/4) (#145) * Add metadata-driven native COM one-shot completion Generate bounded audio activation promises with validated WinMD contracts, libffi export/result plans, a native-only FTM signal sink, and owner-local result collection. Preserve synchronous JS callback thread restrictions. Cover publication, HRESULTs, ownership, teardown, bounds, and WinRT regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Add guarded COM borrowed-copy transactions for Audio, WIC and MF (#146) * Add guarded COM borrowed-copy transactions Add metadata-validated owned-copy plans for Audio, WIC BGRA8 and linear Media Foundation buffers. Observe real successful Audio initialization and GetService calls, retain canonical identity provenance across aliases, and finalize native borrows exactly once with thread and poison guards. Preserve WIC's existing complete surface, keep three copy-only facades out of complete-interface counts, require full regeneration, and add exact metadata evidence, native fixtures, live x64/i686 tests and regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Refactor COM borrowed copies into typed execution recipes Centralize reviewed ABI and lifecycle evidence in a shared contracts crate. Execute typed bindings, bounds, copies and finalizers through one plan-driven runtime while preserving public APIs and supported interfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Guard managed COM arguments before native dispatch Retain shared apartment and lifecycle contexts across interface aliases and supported containers. Recheck receivers and inputs after native coercion, preserve deferred WinRT lifetime behavior, and reject poisoned buffer inputs before IMFSample can retain them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Project ambiguous COM overloads as explicit slot-named methods (#147) Preserve existing arity/shape dispatch for distinguishable groups. Emit stable AtSlot names for previously unsupported ordinary overloads without guessing ABI behavior, retain each validated method plan, reject alias collisions, and update exact coverage evidence. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb * Make COM declaration tests independent of built JS artifacts Share the isolated COM runtime declaration fixture between overload and sink tests. Keep strict TypeScript and negative assertions while removing the coverage-time dependency on bindings/js/dist. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
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.
Stack
PR2/4, based on
feature/com-safe-entry/ #144, notmain. Preserves PR1's public COMprojectAsregistry and restricted synchronous endpoint activation. Do not merge ahead of PR1.Scope
activateAudioInterfaceAsync(deviceInterfacePath, GeneratedInterfaceClass): Promise<T>in the COM package, with completeIAudioClientandIAudioEndpointVolumedependencies.Validation
cargo test -p dynwinrt: 288 passed, 1 existing WinAppSDK-only test ignored.cargo test -p dynwinrt-codegen: 659 passed, including WinRT snapshots, exact WinMD, pure projection/rendering, and fail-closed drift coverage.cargo check -p jswinrt_rs --features test-hooks --target i686-pc-windows-msvc: passed.npm run test:native-completion: all 10 deterministic scenarios passed; fake five-argument export and full vtables, real FTM QI, legitimate MTA agile-reference marshaling, non-agile owner-created results, HRESULT cleanup, bounds, stale tokens, teardown, and liveness.npm run test:types, normalnpm run build, and production root tests (52): passed.cargo fmt --all --checkandgit diff --check: passed.The optional WinUI timing assertion hit its existing cold-start threshold on initial runs; final serial validation passed, as did direct PR1/current comparisons. No unrelated timing code was changed.
Deliberate bounds / environment note
Only the two documented result targets and native NULL activation parameters are supported. No loopback/custom PROPVARIANT blobs, arbitrary JS apartment scheduling, generic aggregation/server API, timeout, AbortSignal, or OS cancellation claim. Dropping a Promise is not cancellation. Initiation stays on the caller's apartment, including Windows UI/consent requirements. Pending work is bounded to 256 per environment.
The optional successful live-speaker smoke could not run here: generated
MediaDevice.getDefaultAudioRenderIdreturned no default render endpoint. A real export attempt did complete and correctly rejected withstage=activation, HRESULT0x80070057. Deterministic coverage is green; no recording or microphone calls were made. The opt-in smoke only reads speaker channel count.The complete-interface census is unchanged: this adds one bounded export consumer, not general flat-function or new complete-interface support.