diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-05-13 13:50:50 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-05-14 11:12:31 -0500 |
commit | 6a6974a15deb6edf593736cdb8043bfb93064782 (patch) | |
tree | 0ae2afffcd02967ba3fe0f0a5d3e9273811f1e6f /src/ext/Bal/test/examples/TestEngine | |
parent | 7d56566b7c51c49ded526466dfae6af9e1709040 (diff) | |
download | wix-6a6974a15deb6edf593736cdb8043bfb93064782.tar.gz wix-6a6974a15deb6edf593736cdb8043bfb93064782.tar.bz2 wix-6a6974a15deb6edf593736cdb8043bfb93064782.zip |
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.
Diffstat (limited to 'src/ext/Bal/test/examples/TestEngine')
5 files changed, 20 insertions, 10 deletions
diff --git a/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp b/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp index 46fd9afa..3f290b86 100644 --- a/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp +++ b/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp | |||
@@ -31,7 +31,7 @@ HRESULT RunReloadEngine( | |||
31 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); | 31 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); |
32 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); | 32 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); |
33 | 33 | ||
34 | pTestEngine->UnloadBA(); | 34 | pTestEngine->UnloadBA(TRUE); |
35 | 35 | ||
36 | hr = pTestEngine->LoadBA(wzBAFilePath); | 36 | hr = pTestEngine->LoadBA(wzBAFilePath); |
37 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA."); | 37 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA."); |
@@ -48,7 +48,7 @@ HRESULT RunReloadEngine( | |||
48 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RESTART); | 48 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RESTART); |
49 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); | 49 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); |
50 | 50 | ||
51 | pTestEngine->UnloadBA(); | 51 | pTestEngine->UnloadBA(FALSE); |
52 | 52 | ||
53 | LExit: | 53 | LExit: |
54 | return hr; | 54 | return hr; |
diff --git a/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp index 3b876e4e..b5c8c462 100644 --- a/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp +++ b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp | |||
@@ -31,7 +31,7 @@ HRESULT RunShutdownEngine( | |||
31 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); | 31 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); |
32 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); | 32 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); |
33 | 33 | ||
34 | pTestEngine->UnloadBA(); | 34 | pTestEngine->UnloadBA(FALSE); |
35 | 35 | ||
36 | LExit: | 36 | LExit: |
37 | return hr; | 37 | return hr; |
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( | |||
147 | return BAEngineQuit(&args, &results); | 147 | return BAEngineQuit(&args, &results); |
148 | } | 148 | } |
149 | 149 | ||
150 | void TestEngine::UnloadBA() | 150 | void TestEngine::UnloadBA( |
151 | __in BOOL fReload | ||
152 | ) | ||
151 | { | 153 | { |
152 | PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; | 154 | PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; |
153 | BOOL fDisableUnloading = m_pCreateResults && m_pCreateResults->fDisableUnloading; | 155 | BOOTSTRAPPER_DESTROY_ARGS args = { }; |
156 | BOOTSTRAPPER_DESTROY_RESULTS results = { }; | ||
157 | |||
158 | args.cbSize = sizeof(args); | ||
159 | args.fReload = fReload; | ||
160 | |||
161 | results.cbSize = sizeof(results); | ||
154 | 162 | ||
155 | ReleaseNullMem(m_pCreateResults); | 163 | ReleaseNullMem(m_pCreateResults); |
156 | 164 | ||
@@ -158,12 +166,12 @@ void TestEngine::UnloadBA() | |||
158 | 166 | ||
159 | if (pfnDestroy) | 167 | if (pfnDestroy) |
160 | { | 168 | { |
161 | pfnDestroy(); | 169 | pfnDestroy(&args, &results); |
162 | } | 170 | } |
163 | 171 | ||
164 | if (m_hBAModule) | 172 | if (m_hBAModule) |
165 | { | 173 | { |
166 | if (!fDisableUnloading) | 174 | if (!results.fDisableUnloading) |
167 | { | 175 | { |
168 | ::FreeLibrary(m_hBAModule); | 176 | ::FreeLibrary(m_hBAModule); |
169 | } | 177 | } |
diff --git a/src/ext/Bal/test/examples/TestEngine/TestEngine.h b/src/ext/Bal/test/examples/TestEngine/TestEngine.h index 44e813bd..248e979a 100644 --- a/src/ext/Bal/test/examples/TestEngine/TestEngine.h +++ b/src/ext/Bal/test/examples/TestEngine/TestEngine.h | |||
@@ -44,7 +44,9 @@ public: | |||
44 | __in DWORD dwExitCode | 44 | __in DWORD dwExitCode |
45 | ); | 45 | ); |
46 | 46 | ||
47 | void UnloadBA(); | 47 | void UnloadBA( |
48 | __in BOOL fReload | ||
49 | ); | ||
48 | 50 | ||
49 | private: | 51 | private: |
50 | HRESULT BAEngineLog( | 52 | HRESULT BAEngineLog( |
@@ -77,4 +79,4 @@ private: | |||
77 | HMODULE m_hBAModule; | 79 | HMODULE m_hBAModule; |
78 | BOOTSTRAPPER_CREATE_RESULTS* m_pCreateResults; | 80 | BOOTSTRAPPER_CREATE_RESULTS* m_pCreateResults; |
79 | DWORD m_dwThreadId; | 81 | DWORD m_dwThreadId; |
80 | }; \ No newline at end of file | 82 | }; |
diff --git a/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp b/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp index 2f80ba75..64b618f4 100644 --- a/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp +++ b/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp | |||
@@ -28,7 +28,7 @@ HRESULT RunWaitForQuitEngine( | |||
28 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); | 28 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); |
29 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); | 29 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); |
30 | 30 | ||
31 | pTestEngine->UnloadBA(); | 31 | pTestEngine->UnloadBA(FALSE); |
32 | 32 | ||
33 | LExit: | 33 | LExit: |
34 | return hr; | 34 | return hr; |