aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/engine.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-08-03 15:42:08 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-08-04 10:03:57 -0500
commit94b8260fc5c1abc199f8d6145f3db4e2de490463 (patch)
treef8aeebc5b8d3facdab8232f60098ed253b3019cf /src/burn/engine/engine.cpp
parent9ae1c04d5fa02ac020885cdad7c592f7bb43d83e (diff)
downloadwix-94b8260fc5c1abc199f8d6145f3db4e2de490463.tar.gz
wix-94b8260fc5c1abc199f8d6145f3db4e2de490463.tar.bz2
wix-94b8260fc5c1abc199f8d6145f3db4e2de490463.zip
Recreate the command line for the clean room process.
Persist /xlog when resuming from RunOnce. Fixes #6259
Diffstat (limited to 'src/burn/engine/engine.cpp')
-rw-r--r--src/burn/engine/engine.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp
index e65600b5..99471e0d 100644
--- a/src/burn/engine/engine.cpp
+++ b/src/burn/engine/engine.cpp
@@ -17,7 +17,6 @@ static void UninitializeEngineState(
17 __in BURN_ENGINE_STATE* pEngineState 17 __in BURN_ENGINE_STATE* pEngineState
18 ); 18 );
19static HRESULT RunUntrusted( 19static HRESULT RunUntrusted(
20 __in LPCWSTR wzCommandLine,
21 __in BURN_ENGINE_STATE* pEngineState 20 __in BURN_ENGINE_STATE* pEngineState
22 ); 21 );
23static HRESULT RunNormal( 22static HRESULT RunNormal(
@@ -195,7 +194,7 @@ extern "C" HRESULT EngineRun(
195 switch (engineState.internalCommand.mode) 194 switch (engineState.internalCommand.mode)
196 { 195 {
197 case BURN_MODE_UNTRUSTED: 196 case BURN_MODE_UNTRUSTED:
198 hr = RunUntrusted(wzCommandLine, &engineState); 197 hr = RunUntrusted(&engineState);
199 ExitOnFailure(hr, "Failed to run untrusted mode."); 198 ExitOnFailure(hr, "Failed to run untrusted mode.");
200 break; 199 break;
201 200
@@ -411,7 +410,6 @@ static void UninitializeEngineState(
411} 410}
412 411
413static HRESULT RunUntrusted( 412static HRESULT RunUntrusted(
414 __in LPCWSTR wzCommandLine,
415 __in BURN_ENGINE_STATE* pEngineState 413 __in BURN_ENGINE_STATE* pEngineState
416 ) 414 )
417{ 415{
@@ -450,24 +448,8 @@ static HRESULT RunUntrusted(
450 wzCleanRoomBundlePath = sczCachedCleanRoomBundlePath; 448 wzCleanRoomBundlePath = sczCachedCleanRoomBundlePath;
451 } 449 }
452 450
453 // The clean room switch must always be at the front of the command line so 451 hr = CoreCreateCleanRoomCommandLine(&sczParameters, pEngineState, wzCleanRoomBundlePath, sczCurrentProcessPath, &hFileAttached, &hFileSelf);
454 // the EngineInCleanRoom function will operate correctly. 452 ExitOnFailure(hr, "Failed to create clean room command-line.");
455 hr = StrAllocFormatted(&sczParameters, L"-%ls=\"%ls\"", BURN_COMMANDLINE_SWITCH_CLEAN_ROOM, sczCurrentProcessPath);
456 ExitOnFailure(hr, "Failed to allocate parameters for unelevated process.");
457
458 // Send a file handle for the child Burn process to access the attached container.
459 hr = CoreAppendFileHandleAttachedToCommandLine(pEngineState->section.hEngineFile, &hFileAttached, &sczParameters);
460 ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED);
461
462 // Grab a file handle for the child Burn process.
463 hr = CoreAppendFileHandleSelfToCommandLine(wzCleanRoomBundlePath, &hFileSelf, &sczParameters, NULL);
464 ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF);
465
466 hr = CoreAppendSplashScreenWindowToCommandLine(pEngineState->command.hwndSplashScreen, &sczParameters);
467 ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN);
468
469 hr = StrAllocConcatFormattedSecure(&sczParameters, L" %ls", wzCommandLine);
470 ExitOnFailure(hr, "Failed to append original command line.");
471 453
472#ifdef ENABLE_UNELEVATE 454#ifdef ENABLE_UNELEVATE
473 // TODO: Pass file handle to unelevated process if this ever gets reenabled. 455 // TODO: Pass file handle to unelevated process if this ever gets reenabled.