diff options
Diffstat (limited to 'src/test/examples/TestEngine')
-rw-r--r-- | src/test/examples/TestEngine/TestEngine.cpp | 16 | ||||
-rw-r--r-- | src/test/examples/TestEngine/precomp.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/test/examples/TestEngine/TestEngine.cpp b/src/test/examples/TestEngine/TestEngine.cpp index 203df115..f0811e0a 100644 --- a/src/test/examples/TestEngine/TestEngine.cpp +++ b/src/test/examples/TestEngine/TestEngine.cpp | |||
@@ -35,6 +35,12 @@ HRESULT TestEngine::LoadBA( | |||
35 | 35 | ||
36 | command.cbSize = sizeof(BOOTSTRAPPER_COMMAND); | 36 | command.cbSize = sizeof(BOOTSTRAPPER_COMMAND); |
37 | 37 | ||
38 | hr = PathGetDirectory(wzBAFilePath, &command.wzBootstrapperWorkingFolder); | ||
39 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to allocate wzBootstrapperWorkingFolder"); | ||
40 | |||
41 | hr = PathConcat(command.wzBootstrapperWorkingFolder, L"BootstrapperApplicationData.xml", &command.wzBootstrapperApplicationDataPath); | ||
42 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to allocate wzBootstrapperApplicationDataPath"); | ||
43 | |||
38 | args.cbSize = sizeof(BOOTSTRAPPER_CREATE_ARGS); | 44 | args.cbSize = sizeof(BOOTSTRAPPER_CREATE_ARGS); |
39 | args.pCommand = &command; | 45 | args.pCommand = &command; |
40 | args.pfnBootstrapperEngineProc = TestEngine::EngineProc; | 46 | args.pfnBootstrapperEngineProc = TestEngine::EngineProc; |
@@ -53,6 +59,9 @@ HRESULT TestEngine::LoadBA( | |||
53 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure on BootstrapperApplicationCreate."); | 59 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure on BootstrapperApplicationCreate."); |
54 | 60 | ||
55 | LExit: | 61 | LExit: |
62 | ReleaseStr(command.wzBootstrapperApplicationDataPath); | ||
63 | ReleaseStr(command.wzBootstrapperWorkingFolder); | ||
64 | |||
56 | return hr; | 65 | return hr; |
57 | } | 66 | } |
58 | 67 | ||
@@ -92,6 +101,7 @@ HRESULT TestEngine::SendStartupEvent() | |||
92 | void TestEngine::UnloadBA() | 101 | void TestEngine::UnloadBA() |
93 | { | 102 | { |
94 | PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; | 103 | PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; |
104 | BOOL fDisableUnloading = m_pCreateResults && m_pCreateResults->fDisableUnloading; | ||
95 | 105 | ||
96 | ReleaseNullMem(m_pCreateResults); | 106 | ReleaseNullMem(m_pCreateResults); |
97 | 107 | ||
@@ -104,7 +114,11 @@ void TestEngine::UnloadBA() | |||
104 | 114 | ||
105 | if (m_hBAModule) | 115 | if (m_hBAModule) |
106 | { | 116 | { |
107 | ::FreeLibrary(m_hBAModule); | 117 | if (!fDisableUnloading) |
118 | { | ||
119 | ::FreeLibrary(m_hBAModule); | ||
120 | } | ||
121 | |||
108 | m_hBAModule = NULL; | 122 | m_hBAModule = NULL; |
109 | } | 123 | } |
110 | } | 124 | } |
diff --git a/src/test/examples/TestEngine/precomp.h b/src/test/examples/TestEngine/precomp.h index 0d2afb06..3fbc7e90 100644 --- a/src/test/examples/TestEngine/precomp.h +++ b/src/test/examples/TestEngine/precomp.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include "logutil.h" | 9 | #include "logutil.h" |
10 | #include "memutil.h" | 10 | #include "memutil.h" |
11 | #include "pathutil.h" | 11 | #include "pathutil.h" |
12 | #include "strutil.h" | ||
12 | 13 | ||
13 | #include "BootstrapperEngine.h" | 14 | #include "BootstrapperEngine.h" |
14 | #include "BootstrapperApplication.h" | 15 | #include "BootstrapperApplication.h" |