Skip to content

Complete native MSVC DLL loading, C exports and allocator-ownership interoperability #619

Description

@LunaStev

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues related to building the project or compiling errors.enhancementA request for a new feature or improvement.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions