-
-
Save 0xbadfca11/d31ba1d1543aac615f1945c6670382c7 to your computer and use it in GitHub Desktop.
WslLaunchInteractive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment