From 75d645c6aec0df0e02bd3aaf2fe2571d83316d4c Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 3 Aug 2021 15:43:30 -0500 Subject: Remove unelevation code since clean room changes made it unreachable. --- src/burn/engine/engine.cpp | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'src/burn/engine/engine.cpp') diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index 8b4a296b..0ce2de6d 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp @@ -462,31 +462,19 @@ static HRESULT RunUntrusted( hr = CoreCreateCleanRoomCommandLine(&sczParameters, pEngineState, wzCleanRoomBundlePath, sczCurrentProcessPath, &hFileAttached, &hFileSelf); ExitOnFailure(hr, "Failed to create clean room command-line."); -#ifdef ENABLE_UNELEVATE - // TODO: Pass file handle to unelevated process if this ever gets reenabled. - if (!pEngineState->internalCommand.fDisableUnelevate) - { - // Try to launch unelevated and if that fails for any reason, we'll launch our process normally (even though that may make it elevated). - hr = ProcExecuteAsInteractiveUser(wzCleanRoomBundlePath, sczParameters, &hProcess); - } -#endif + hr = StrAllocFormattedSecure(&sczFullCommandLine, L"\"%ls\" %ls", wzCleanRoomBundlePath, sczParameters); + ExitOnFailure(hr, "Failed to allocate full command-line."); - if (!hProcess) + si.cb = sizeof(si); + si.wShowWindow = static_cast(pEngineState->command.nCmdShow); + if (!::CreateProcessW(wzCleanRoomBundlePath, sczFullCommandLine, NULL, NULL, TRUE, 0, 0, NULL, &si, &pi)) { - hr = StrAllocFormattedSecure(&sczFullCommandLine, L"\"%ls\" %ls", wzCleanRoomBundlePath, sczParameters); - ExitOnFailure(hr, "Failed to allocate full command-line."); - - si.cb = sizeof(si); - si.wShowWindow = static_cast(pEngineState->command.nCmdShow); - if (!::CreateProcessW(wzCleanRoomBundlePath, sczFullCommandLine, NULL, NULL, TRUE, 0, 0, NULL, &si, &pi)) - { - ExitWithLastError(hr, "Failed to launch clean room process: %ls", sczFullCommandLine); - } - - hProcess = pi.hProcess; - pi.hProcess = NULL; + ExitWithLastError(hr, "Failed to launch clean room process: %ls", sczFullCommandLine); } + hProcess = pi.hProcess; + pi.hProcess = NULL; + hr = ProcWaitForCompletion(hProcess, INFINITE, &pEngineState->userExperience.dwExitCode); ExitOnFailure(hr, "Failed to wait for clean room process: %ls", wzCleanRoomBundlePath); -- cgit v1.2.3-55-g6feb