diff options
Diffstat (limited to 'src/test/examples/TestEngine/ShutdownEngine.cpp')
-rw-r--r-- | src/test/examples/TestEngine/ShutdownEngine.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/examples/TestEngine/ShutdownEngine.cpp b/src/test/examples/TestEngine/ShutdownEngine.cpp new file mode 100644 index 00000000..69321d91 --- /dev/null +++ b/src/test/examples/TestEngine/ShutdownEngine.cpp | |||
@@ -0,0 +1,23 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | #include "precomp.h" | ||
4 | |||
5 | HRESULT RunShutdownEngine( | ||
6 | __in LPCWSTR wzBAFilePath | ||
7 | ) | ||
8 | { | ||
9 | HRESULT hr = S_OK; | ||
10 | TestEngine* pTestEngine = NULL; | ||
11 | |||
12 | pTestEngine = new TestEngine(); | ||
13 | ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine."); | ||
14 | |||
15 | hr = pTestEngine->LoadBA(wzBAFilePath); | ||
16 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA."); | ||
17 | |||
18 | hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER); | ||
19 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown."); | ||
20 | |||
21 | LExit: | ||
22 | return hr; | ||
23 | } | ||