4 ms·
I was curious how this worked: The previous iteration of this only worked for WinRT API, and this new crate seemed to also work by generating code from WinMD fi
by roblabla 6y ago
I was curious how this worked: The previous iteration of this only worked for WinRT API, and this new crate seemed to also work by generating code from WinMD files. But WinMD files only contained definitions for WinRT/COM APIs, so how could this possibly work?
Well turns out, microsoft started a project to also generate Win32 API information in WinMD file, to generate APIs from them automatically for all native languages! See win32metadata[0]. This could make interfacing with win32 APIs a lot more convenient!
https://github.com/microsoft/win32metadata https://github.com/microsoft/win32metadata
- Arnavion 6y agoSo does this generator need access to the .winmd files at build time to be able to generate the bindings? Are they available for non-Windows builders?
- roblabla 6y agoThe WinMD files are shipped with windows-rs. You can find them here[0]. For cross-compilation use-cases, the main blocker is [1]. [0] https://github.com/microsoft/windows-rs/tree/master/crates/winmd/default https://github.com/microsoft/windows-rs/tree/master/crates/w... [1] https://github.com/microsoft/windows-rs/issues/142 https://github.com/microsoft/windows-rs/issues/142
- ROARosen 6y agoDoes that meant it's compatible with any other language?
- roblabla 6y agoAny language that can call C ABI and support the necessary datastructures, yes. That's the point of win32metadata.