How can I call Windows API functions from a Linux binary inside Windows Subsystem for Linux (WSL)? I am pretty sure there is no documented way to do so, but nevertheless it might be interesting to try.
I am interested in calling Win32 functions, or if that is not possible, at least Windows NT native APIs (Nt*, Zw*). The native APIs should be at the very least available, as the component that runs Linux processes (lxss) depends on these APIs.
It might be neccessary to build a custom LoadLibrary-like function to load windows DLLs. Another idea would be to search the process memory for known pieces of kernel functions (that is, their user-mode entry points).
Has anybody experimented with this and would like to share a solution?