1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// 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.
#include "precomp.h"
HRESULT RunShutdownEngine(
__in LPCWSTR wzBundleFilePath,
__in LPCWSTR wzBAFilePath
)
{
HRESULT hr = S_OK;
TestEngine* pTestEngine = NULL;
pTestEngine = new TestEngine();
ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine.");
hr = pTestEngine->Initialize(wzBundleFilePath);
ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to initialize engine.");
hr = pTestEngine->LoadBA(wzBAFilePath);
ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
hr = pTestEngine->SendStartupEvent();
ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
hr = pTestEngine->SimulateQuit(0);
ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to simulate quit.");
hr = pTestEngine->RunApplication();
ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to run engine.");
hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER);
ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
pTestEngine->UnloadBA(FALSE);
LExit:
return hr;
}
|