本文主要是介绍游戏加速器LSP/DLL导致WSL.EXE无法打开问题修复!,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
解决办法:
https://github.com/microsoft/WSL/issues/4177#issuecomment-597736482
方法一:(管理员身份)
netsh winsock reset
方法二:
WSCSetApplicationCategory 函数设置LSP加载权限
bool NoLsp(const wchar_t* wszExePath) noexcept{if (NULL == wszExePath){return false;}DWORD dwExePathLength = wcslen(wszExePath);DWORD dwPrevCat = 0;DWORD dwPermittedLspCategories = 0x80000000;LPINT lpErrno = NULL;int nErr = WSCSetApplicationCategory(wszExePath, dwExePathLength, NULL, 0, dwPermittedLspCategories, &dwPrevCat, lpErrno);return nErr == ERROR_SUCCESS;}
方法三:
下载:https://www.proxifier.com/tmp/Test20200228/NoLsp.exe
执行:.\NoLsp.exe "C:\Windows\System32\wsl.exe"
这些程序都须被 NoLSP:
bool ok = false;char szExePath[1000 + 1];xxx::::string username = xxx::::win32::Win32Native::GetLoginUser();ok |= paper_airplane::NoLsp(LR"(C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.9.0_x64__8wekyb3d8bbwe\wsl.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Program Files\WSL\wsl.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Program Files\WSL\wslservice.exe)");snprintf(szExePath, sizeof(szExePath), R"(C:\Users\%s\AppData\Local\Microsoft\WindowsApps\wsl.exe)", username.data());ok |= paper_airplane::NoLsp(xxx::::text::Encoding::ascii_to_wstring(szExePath).data());snprintf(szExePath, sizeof(szExePath), R"(C:\Users\%s\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe\wsl.exe)", username.data());ok |= paper_airplane::NoLsp(xxx::::text::Encoding::ascii_to_wstring(szExePath).data());ok |= paper_airplane::NoLsp(LR"(C:\Windows\WinSxS\amd64_microsoft-windows-lxss-wsl_31bf3856ad364e35_10.0.22621.2506_none_62c8e9f54a7fa6e6\wsl.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Windows\WinSxS\amd64_microsoft-windows-lxss-wsl_31bf3856ad364e35_10.0.22621.2506_none_62c8e9f54a7fa6e6\f\wsl.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Windows\WinSxS\amd64_microsoft-windows-lxss-wsl_31bf3856ad364e35_10.0.22621.2506_none_62c8e9f54a7fa6e6\r\wsl.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Windows\System32\wsl.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Windows\System32\vmwp.exe)");ok |= paper_airplane::NoLsp(LR"(C:\Windows\System32\vmcompute.exe)");
注册表中查看添加上没有,路径在这里;
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog
这篇关于游戏加速器LSP/DLL导致WSL.EXE无法打开问题修复!的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!