From a97c339c4af5b9843b70e873f7a62c68fe644041 Mon Sep 17 00:00:00 2001 From: partouf Date: Fri, 15 Sep 2023 04:25:31 -0700 Subject: [PATCH] dont use startupinfo --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a8b5275..ac0f372 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,8 +59,9 @@ DWORD SpawnProcess(const cewrapper::Job &job, STARTUPINFOEX &si, HANDLE hUserTok else { cewrapper::CheckWin32(CreateProcessAsUserW(hUserToken, config.progid.c_str(), cmdline.data(), nullptr, nullptr, - false, NORMAL_PRIORITY_CLASS | CREATE_SUSPENDED, nullptr, nullptr, - &si.StartupInfo, &pi), + false, NORMAL_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT | CREATE_SUSPENDED, + nullptr, nullptr, + nullptr, &pi), L"CreateProcessAsUserW"); } @@ -128,8 +129,7 @@ DWORD execute_using_lower_rights(const cewrapper::Job &job) cewrapper::CheckWin32(SaferComputeTokenFromLevel(hAuthzLevel, NULL, &hToken, 0, NULL), L"SaferComputeTokenFromLevel"); - STARTUPINFOEX si; - ZeroMemory(&si, sizeof(STARTUPINFOEX)); + STARTUPINFOEX si = {}; si.StartupInfo.cb = sizeof(STARTUPINFOEX); DWORD app_exit_code = SpawnProcess(job, si, hToken);