Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define WIN32_LEAN_AND_MEAN
- #define _ATL_NO_AUTOMATIC_NAMESPACE
- #include <windows.h>
- #include <atlbase.h>
- #include <wslapi.h>
- int main()
- {
- if (auto WslLaunchInteractivePtr = AtlGetProcAddressFn(LoadLibraryExW(L"wslapi", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32), WslLaunchInteractive))
- {
- ULONG exit_code;
- WslLaunchInteractivePtr(L"Legacy", L"/bin/echo WSL", FALSE, &exit_code);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement