Quote the path to sunshinesvc.exe when launching the termination helper (#2379)

This commit is contained in:
Cameron Gutman
2024-04-06 18:21:03 -05:00
committed by GitHub
parent 7f795f0e19
commit 93e622342c
+5 -2
View File
@@ -145,8 +145,11 @@ bool
RunTerminationHelper(HANDLE console_token, DWORD pid) { RunTerminationHelper(HANDLE console_token, DWORD pid) {
WCHAR module_path[MAX_PATH]; WCHAR module_path[MAX_PATH];
GetModuleFileNameW(NULL, module_path, _countof(module_path)); GetModuleFileNameW(NULL, module_path, _countof(module_path));
std::wstring command { module_path }; std::wstring command;
command += L'"';
command += module_path;
command += L'"';
command += L" --terminate " + std::to_wstring(pid); command += L" --terminate " + std::to_wstring(pid);
STARTUPINFOW startup_info = {}; STARTUPINFOW startup_info = {};
@@ -157,7 +160,7 @@ RunTerminationHelper(HANDLE console_token, DWORD pid) {
// This will allow us to attach to Sunshine's console and send it a Ctrl-C event. // This will allow us to attach to Sunshine's console and send it a Ctrl-C event.
PROCESS_INFORMATION process_info; PROCESS_INFORMATION process_info;
if (!CreateProcessAsUserW(console_token, if (!CreateProcessAsUserW(console_token,
NULL, module_path,
(LPWSTR) command.c_str(), (LPWSTR) command.c_str(),
NULL, NULL,
NULL, NULL,