aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Bal/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/Bal/test')
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp4
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp2
-rw-r--r--src/ext/Bal/test/examples/TestEngine/TestEngine.cpp16
-rw-r--r--src/ext/Bal/test/examples/TestEngine/TestEngine.h6
-rw-r--r--src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp2
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
53LExit: 53LExit:
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
36LExit: 36LExit:
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
150void TestEngine::UnloadBA() 150void 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
49private: 51private:
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
33LExit: 33LExit:
34 return hr; 34 return hr;