Part of #611. Difficulty: very high. Audit baseline: master 3950416e (2026-09-12).
Current evidence
tests/codegen_regressions.rs already verifies final DLL/import-library/PDB names, consumer linking and failed replacement preservation. Its DLL uses /NOENTRY and the consumer is inspected as bytes; it does not load and call the DLL natively.
Scope
Extend the existing working companion-output support into native x64/ARM64 DLL interoperability. Cover exported C functions, import-library consumers, repeated loading/unloading and runtime initialization where used. Validate ownership with allocation/release performed by the owning module; do not promise that arbitrary static-CRT allocations can be freed by another module. Use existing language capabilities rather than adding export or callback syntax here.
Completion criteria
A native peer loads and calls a Wave DLL and a Wave consumer calls a native peer DLL with checked aggregate/scalar results. Supported static/dynamic runtime combinations have explicit ownership tests and repeated lifetime cycles. Missing DLL/export errors remain observable. Existing atomic companion publication tests continue passing. No libc FFI is added to std/sys to implement the test path; Windows loader APIs and test peers are acceptable.
Dependencies and boundaries
#498; #615, #616, #617, #613. Completed #536 is the publication foundation, not an open duplicate.
References: Microsoft guidance on CRT objects across DLL boundaries
Part of #611. Difficulty: very high. Audit baseline: master
3950416e(2026-09-12).Current evidence
tests/codegen_regressions.rs already verifies final DLL/import-library/PDB names, consumer linking and failed replacement preservation. Its DLL uses /NOENTRY and the consumer is inspected as bytes; it does not load and call the DLL natively.
Scope
Extend the existing working companion-output support into native x64/ARM64 DLL interoperability. Cover exported C functions, import-library consumers, repeated loading/unloading and runtime initialization where used. Validate ownership with allocation/release performed by the owning module; do not promise that arbitrary static-CRT allocations can be freed by another module. Use existing language capabilities rather than adding export or callback syntax here.
Completion criteria
A native peer loads and calls a Wave DLL and a Wave consumer calls a native peer DLL with checked aggregate/scalar results. Supported static/dynamic runtime combinations have explicit ownership tests and repeated lifetime cycles. Missing DLL/export errors remain observable. Existing atomic companion publication tests continue passing. No libc FFI is added to std/sys to implement the test path; Windows loader APIs and test peers are acceptable.
Dependencies and boundaries
#498; #615, #616, #617, #613. Completed #536 is the publication foundation, not an open duplicate.
References: Microsoft guidance on CRT objects across DLL boundaries