diff options
Diffstat (limited to 'src/test/examples/TestEngine/TestEngine.cpp')
| -rw-r--r-- | src/test/examples/TestEngine/TestEngine.cpp | 16 |
1 files changed, 15 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 | } |
