From 0d3d54992104288e9ee0c834d0b96e8502fd2d42 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Jan 2024 18:26:20 -0800 Subject: Move the BootstrapperApplication out of proc --- src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp') diff --git a/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp b/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp index 5383efbf..14a898e8 100644 --- a/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp +++ b/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp @@ -51,10 +51,8 @@ public: // Constructor - initialize member variables. // CWixSampleBAFunctions( - __in HMODULE hModule, - __in IBootstrapperEngine* pEngine, - __in const BA_FUNCTIONS_CREATE_ARGS* pArgs - ) : CBalBaseBAFunctions(hModule, pEngine, pArgs) + __in HMODULE hModule + ) : CBalBaseBAFunctions(hModule) { } @@ -75,22 +73,22 @@ HRESULT WINAPI CreateBAFunctions( { HRESULT hr = S_OK; CWixSampleBAFunctions* pBAFunctions = NULL; - IBootstrapperEngine* pEngine = NULL; // This is required to enable logging functions. - hr = BalInitializeFromCreateArgs(pArgs->pBootstrapperCreateArgs, &pEngine); - ExitOnFailure(hr, "Failed to initialize Bal."); + BalInitialize(pArgs->pEngine); - pBAFunctions = new CWixSampleBAFunctions(hModule, pEngine, pArgs); + pBAFunctions = new CWixSampleBAFunctions(hModule); ExitOnNull(pBAFunctions, hr, E_OUTOFMEMORY, "Failed to create new CWixSampleBAFunctions object."); + hr = pBAFunctions->OnCreate(pArgs->pEngine, pArgs->pCommand); + ExitOnFailure(hr, "Failed to call OnCreate CPrereqBaf."); + pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc; pResults->pvBAFunctionsProcContext = pBAFunctions; pBAFunctions = NULL; LExit: ReleaseObject(pBAFunctions); - ReleaseObject(pEngine); return hr; } -- cgit v1.2.3-55-g6feb