From 6a6974a15deb6edf593736cdb8043bfb93064782 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 13 May 2022 13:50:50 -0500 Subject: Move infinite loop detection into the hosts. Tell the BA during Destroy whether it will be reloaded, and let the BA decide then whether it's module should be unloaded. Show error when infinite prereq loop detected. Only clip the exit code if they're Win32 errors. Set related bundle type to none to avoid downgrades during preqba. --- src/ext/Bal/test/examples/TestEngine/TestEngine.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/ext/Bal/test/examples/TestEngine/TestEngine.cpp') diff --git a/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp b/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp index 4c7ec1c3..5c6ed398 100644 --- a/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp +++ b/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp @@ -147,10 +147,18 @@ HRESULT TestEngine::SimulateQuit( return BAEngineQuit(&args, &results); } -void TestEngine::UnloadBA() +void TestEngine::UnloadBA( + __in BOOL fReload + ) { PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; - BOOL fDisableUnloading = m_pCreateResults && m_pCreateResults->fDisableUnloading; + BOOTSTRAPPER_DESTROY_ARGS args = { }; + BOOTSTRAPPER_DESTROY_RESULTS results = { }; + + args.cbSize = sizeof(args); + args.fReload = fReload; + + results.cbSize = sizeof(results); ReleaseNullMem(m_pCreateResults); @@ -158,12 +166,12 @@ void TestEngine::UnloadBA() if (pfnDestroy) { - pfnDestroy(); + pfnDestroy(&args, &results); } if (m_hBAModule) { - if (!fDisableUnloading) + if (!results.fDisableUnloading) { ::FreeLibrary(m_hBAModule); } -- cgit v1.2.3-55-g6feb