From 391057093e45db2d4b2450bd236b9e1fc4cfd53c Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 13 Feb 2019 20:13:57 -0600 Subject: Add test for creating a Managed BA through mbahost. --- src/test/WixToolsetTest.MbaHost/EngineForTest.cpp | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/test/WixToolsetTest.MbaHost/EngineForTest.cpp (limited to 'src/test/WixToolsetTest.MbaHost/EngineForTest.cpp') diff --git a/src/test/WixToolsetTest.MbaHost/EngineForTest.cpp b/src/test/WixToolsetTest.MbaHost/EngineForTest.cpp new file mode 100644 index 00000000..b2567a7b --- /dev/null +++ b/src/test/WixToolsetTest.MbaHost/EngineForTest.cpp @@ -0,0 +1,45 @@ +// 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" + +static HRESULT BAEngineLog( + __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, + __in BAENGINE_LOG_ARGS* pArgs, + __in BAENGINE_LOG_RESULTS* /*pResults*/ +) +{ + HRESULT hr = S_OK; + + pContext->pfnLog(pArgs->wzMessage); + + return hr; +} + +HRESULT WINAPI EngineForTestProc( + __in BOOTSTRAPPER_ENGINE_MESSAGE message, + __in const LPVOID pvArgs, + __inout LPVOID pvResults, + __in_opt LPVOID pvContext +) +{ + HRESULT hr = S_OK; + BOOTSTRAPPER_ENGINE_CONTEXT* pContext = reinterpret_cast(pvContext); + + if (!pContext || !pvArgs || !pvResults) + { + ExitFunction1(hr = E_INVALIDARG); + } + + switch (message) + { + case BOOTSTRAPPER_ENGINE_MESSAGE_LOG: + hr = BAEngineLog(pContext, reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); + break; + default: + hr = E_NOTIMPL; + break; + } + +LExit: + return hr; +} \ No newline at end of file -- cgit v1.2.3-55-g6feb