From d5b89ecb2ba931cd5429e00a78b9457f8a63c6d2 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 30 Mar 2020 19:25:36 +1000 Subject: Upgrade to latest dependencies. Stop skipping CanBuildUsingWixStdBa. Fix memory leak in wixstdba. --- src/wixstdba/WixStandardBootstrapperApplication.cpp | 4 +++- src/wixstdba/packages.config | 4 ++-- src/wixstdba/precomp.h | 3 ++- src/wixstdba/wixstdba.cpp | 7 +++++-- src/wixstdba/wixstdba.vcxproj | 8 ++++---- 5 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/wixstdba') diff --git a/src/wixstdba/WixStandardBootstrapperApplication.cpp b/src/wixstdba/WixStandardBootstrapperApplication.cpp index 6d2fd3e2..afc6a3ee 100644 --- a/src/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/wixstdba/WixStandardBootstrapperApplication.cpp @@ -3726,7 +3726,8 @@ HRESULT CreateBootstrapperApplication( __in HRESULT hrHostInitialization, __in IBootstrapperEngine* pEngine, __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, - __inout BOOTSTRAPPER_CREATE_RESULTS* pResults + __inout BOOTSTRAPPER_CREATE_RESULTS* pResults, + __out IBootstrapperApplication** ppApplication ) { HRESULT hr = S_OK; @@ -3737,6 +3738,7 @@ HRESULT CreateBootstrapperApplication( pResults->pfnBootstrapperApplicationProc = BalBaseBootstrapperApplicationProc; pResults->pvBootstrapperApplicationProcContext = pApplication; + *ppApplication = pApplication; pApplication = NULL; LExit: diff --git a/src/wixstdba/packages.config b/src/wixstdba/packages.config index fbcb6700..56b68f10 100644 --- a/src/wixstdba/packages.config +++ b/src/wixstdba/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/src/wixstdba/precomp.h b/src/wixstdba/precomp.h index 925a80ce..9c2b9f6a 100644 --- a/src/wixstdba/precomp.h +++ b/src/wixstdba/precomp.h @@ -52,5 +52,6 @@ HRESULT CreateBootstrapperApplication( __in HRESULT hrHostInitialization, __in IBootstrapperEngine* pEngine, __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, - __inout BOOTSTRAPPER_CREATE_RESULTS* pResults + __inout BOOTSTRAPPER_CREATE_RESULTS* pResults, + __out IBootstrapperApplication** ppApplication ); diff --git a/src/wixstdba/wixstdba.cpp b/src/wixstdba/wixstdba.cpp index f47c1f4e..2767c74e 100644 --- a/src/wixstdba/wixstdba.cpp +++ b/src/wixstdba/wixstdba.cpp @@ -3,6 +3,7 @@ #include "precomp.h" static HINSTANCE vhInstance = NULL; +static IBootstrapperApplication* vpApplication = NULL; extern "C" BOOL WINAPI DllMain( IN HINSTANCE hInstance, @@ -37,7 +38,7 @@ extern "C" HRESULT WINAPI BootstrapperApplicationCreate( hr = BalInitializeFromCreateArgs(pArgs, &pEngine); ExitOnFailure(hr, "Failed to initialize Bal."); - hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pArgs, pResults); + hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pArgs, pResults, &vpApplication); BalExitOnFailure(hr, "Failed to create bootstrapper application interface."); LExit: @@ -49,6 +50,7 @@ LExit: extern "C" void WINAPI BootstrapperApplicationDestroy() { + ReleaseNullObject(vpApplication); BalUninitialize(); } @@ -64,7 +66,7 @@ extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( BalInitialize(pEngine); - hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults); + hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); BalExitOnFailure(hr, "Failed to create managed prerequisite bootstrapper application interface."); LExit: @@ -74,5 +76,6 @@ LExit: extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy() { + ReleaseNullObject(vpApplication); BalUninitialize(); } diff --git a/src/wixstdba/wixstdba.vcxproj b/src/wixstdba/wixstdba.vcxproj index b6c3ebc0..009bdb54 100644 --- a/src/wixstdba/wixstdba.vcxproj +++ b/src/wixstdba/wixstdba.vcxproj @@ -2,8 +2,8 @@ - - + + @@ -107,8 +107,8 @@ rc.exe -fo "$(OutDir)wixstdba.res" "$(IntDir)wixstdba.messages.rc" This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + -- cgit v1.2.3-55-g6feb