← Back to context

Comment by lowleveldesign

6 days ago

Interestingly, the Rust windows crate is generated from an MSIL assembly. And same metadata might be used to generate C# bindings thanks to cswin32 [1] project. The meta-assembly generation (Win32 metadata project) is based on clangsharp and it's fairly straightforward to generate interop code for native Windows libraries. Some time ago I described this process on my blog for the detours library [2]

[1] https://github.com/microsoft/CsWin32

[2] https://lowleveldesign.org/2023/11/23/generating-c-bindings-...

Yes, and this approach is an extension of the one taken with WinRT metadata which is also ".NET assembly" based.