From 98080672cdbbde00ea40a96c1ce38e8a52f24fee Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 19 Oct 2022 15:44:40 -0500 Subject: Add queutil so Burn can manage its own queue of BA requested actions. Fixes 6349 --- src/burn/engine/core.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/burn/engine/core.cpp') diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index c443e0c8..8903b5b2 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp @@ -884,17 +884,16 @@ LExit: LogId(REPORT_STANDARD, MSG_LAUNCH_APPROVED_EXE_COMPLETE, hr, dwProcessId); - ApprovedExesUninitializeLaunch(pLaunchApprovedExe); - return hr; } -extern "C" HRESULT CoreQuit( - __in BURN_ENGINE_STATE* pEngineState, - __in int nExitCode +extern "C" void CoreQuit( + __in BOOTSTRAPPER_ENGINE_CONTEXT* pEngineContext, + __in DWORD dwExitCode ) { HRESULT hr = S_OK; + BURN_ENGINE_STATE* pEngineState = pEngineContext->pEngineState; // Save engine state if resume mode is unequal to "none". if (BURN_RESUME_MODE_NONE != pEngineState->resumeMode) @@ -907,13 +906,15 @@ extern "C" HRESULT CoreQuit( } } - LogId(REPORT_STANDARD, MSG_QUIT, nExitCode); + LogId(REPORT_STANDARD, MSG_QUIT, dwExitCode); - pEngineState->fQuit = TRUE; + pEngineState->userExperience.dwExitCode = dwExitCode; - ::PostQuitMessage(nExitCode); // go bye-bye. + ::EnterCriticalSection(&pEngineContext->csQueue); - return hr; + pEngineState->fQuit = TRUE; + + ::LeaveCriticalSection(&pEngineContext->csQueue); } extern "C" HRESULT CoreSaveEngineState( @@ -2071,6 +2072,18 @@ LExit: return hr; } +extern "C" void DAPI CoreBootstrapperEngineActionUninitialize( + __in BOOTSTRAPPER_ENGINE_ACTION* pAction + ) +{ + switch (pAction->dwMessage) + { + case WM_BURN_LAUNCH_APPROVED_EXE: + ApprovedExesUninitializeLaunch(&pAction->launchApprovedExe); + break; + } +} + // internal helper functions static HRESULT AppendEscapedArgumentToCommandLine( -- cgit v1.2.3-55-g6feb