Skip to content

Add safe variable-length audio formats - #141

Merged
leileizhang (lei9444) merged 16 commits into
mainfrom
feature/com-audio-format
Sep 7, 2026
Merged

leileizhang (lei9444) merged 16 commits into
mainfrom
feature/com-audio-format

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Summary

  • add DynComAudioFormat for validated variable-length WAVEFORMATEX/WAVEFORMATEXTENSIBLE storage and PCM construction
  • generate safe IAudioClient, IAudioClient2, and IAudioClient3 methods with exact shared/exclusive closest-format and CoTaskMem ownership contracts
  • move generated unsafe strategy coverage to a still-unsafe WinML interface and raise safe Classic COM coverage from 5,692 to 5,697 interfaces

Validation

  • cargo test -p dynwinrt -p dynwinrt-codegen
  • x64 and i686 core/JS compile validation
  • npm run test:generated-unsafe
  • npm run build and npm test (known WinUI timing test passed on isolated rerun)
  • Classic COM E2E: 17/17
  • capability census regenerated twice byte-identically

leileizhang (lei9444) and others added 15 commits September 4, 2026 17:51
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Model FORMATETC and STGMEDIUM as dedicated COM ABI values, generate a caller-owned IDataObject SetData projection, and validate real HGLOBAL cleanup paths.

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
Model WAVEFORMATEX and WAVEFORMATEXTENSIBLE as validated COM values, project IAudioClient format negotiation with exact conditional ownership, and retain generated unsafe coverage through a WinML fixture.

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
Use the official IWbemServices vtable through ExecMethodAsync and return ABI-correct IWbemClassObject and IWbemCallResult tear-offs with canonical identity and shared reference counting.

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
Pin IDataObject and inherited IOleCache SetData inputs to caller-retained ownership. Model canonical FORMATETC result validity in the COM plan, preserve semantic HRESULTs, and keep ordinary FORMATETC decoding strict.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Preserve the audio format contracts and WinML unsafe fixture while incorporating borrowed IOleCache SetData and canonical FORMATETC result rules. Regenerate the combined contract evidence census without changing safe coverage.

Remaining generator-dependent validation is blocked locally by Microsoft Defender quarantine of the debug codegen executable (OS error 225). Published with user approval; no antivirus settings or quarantined files were changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Pin IDataObject::GetDataHere to caller-owned, non-replacing HGLOBAL storage. Reject unproven STGMEDIUM InOut projections such as IWiaDataTransfer, preserve the existing runtime API, and update capability evidence and coverage baselines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Retain the audio-format contracts while requiring exact caller-allocation preservation evidence for STGMEDIUM InOut. Update the combined census to 5,696 safe interfaces and keep WIA file-transfer methods outside safe projection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Add exact nullable-input contracts for IMDSPDeviceControl and IWMDMDeviceControl Record. Preserve nullability through generated declarations, COM signatures and native pointer marshalling while keeping other audio-format inputs required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Preserve the storage-medium fixes after the squash merge of #139 and incorporate the upstream benchmark dependency lockfile update.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Keep the audio and nullable Record fixes intact while inheriting the merged stabilization history and latest main dependency update.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Base automatically changed from feature/com-stgmedium to main September 7, 2026 09:26
The main tree is identical to the storage-medium parent already contained in this branch. Reconcile squash ancestry while preserving the complete audio-format and nullable Record implementation unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 85.02% 80.09% 84.62% regions
Generated Python projections 70.48% n/a 21.71% branches
JavaScript aggregate 21.49% 20.64% 54.23% branches
JavaScript runtime 25.96% 14.28% 7.14% branches
Generated WinRT projections 25.8% 19.3% 54.74% branches
Generated Classic COM projections 14.83% 24.65% 54.38% branches

View workflow run and download full HTML/LCOV/XML reports

@lei9444
leileizhang (lei9444) merged commit 417ee1f into main Sep 7, 2026
24 checks passed
@lei9444
leileizhang (lei9444) deleted the feature/com-audio-format branch September 7, 2026 10:16
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