Microsoft has been trying to modernize Windows and its development platform for a decade now. With Windows 8’s Metro UI, Windows RT, Windows 10’s UWP, Project Reunion and Windows 10X, Microsoft are trying their best to convince users and developers to move to a modern platform, but it apparently doesn’t mean the end of Win32 as the company had just released a major capability to make it easier to consume Win32 APIs in programming languages other than C or C++.
According to the blog post, Win32 APIs used to be only available to C and C++ developers, and programs developed in other languages needed to go through an error-prone wrapping or binding process. This process used to be done by the developers and it would only benefit the single language that the developers target. Moreover, the huge number of Win32 APIs available also doesn’t make this process easier.
To make consuming Win32 APIs easier in languages other than C or C++, Microsoft released new tooling called win32metadata. As stated by Microsoft:
The goal of the win32metadata project is to provide a complete description of the Win32 API surface in metadata so that it can be projected to any language in an automated way, improving correctness and minimizing maintenance overhead. The output of this project is effectively an ECMA-335 compliant Windows metadata file (winmd) published to Nuget.org containing metadata describing the entire Win32 API surface.
According to Microsoft, developers can use win32metadata to generate wrappers to Win32 APIs making the process much easier and less error-prone than manually writing every single one of them. Following this effort, the C# wrapper library C#/Win32 by Andrew Arnott and Rust wrapper library windows-rs by Microsoft are utilizing win32metadata to make Win32 APIs available in these two languages.
Microsoft is hoping, with this tool, more languages will be able to make use of Win32 APIs. More information can be found on the project’s GitHub page.
Source: Windows Blog