The windows crate, which provides Rust bindings to the Windows API, is split into a few internal crates, one of them being the windows-targets. This create is also split in a few internal crates, and these are loaded according to the target platform.
These platform-dependent crates don't seem to do much: they simply pass cargo:rustc-link-search=native={LIB_DIR}
to the compiler.
Now looking at these LIB_DIR
directories, they contain an already-compiled static library, one for each platform. Example: windows.0.48.0.lib file.
I couldn't find any documentation regarding this, but I suppose these static libraries are compiled from the C source files found in the baseline
directory, which contain... a duplication of the Windows API function declarations in C. That's intriguing.
The Rust bindings themselves are written somewhere else, like here (GDI bindings).
Question: these compiled C static libraries seem to be a duplication of the API already available in Windows, so why are they necessary?