From 6a6974a15deb6edf593736cdb8043bfb93064782 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 13 May 2022 13:50:50 -0500 Subject: Move infinite loop detection into the hosts. Tell the BA during Destroy whether it will be reloaded, and let the BA decide then whether it's module should be unloaded. Show error when infinite prereq loop detected. Only clip the exit code if they're Win32 errors. Set related bundle type to none to avoid downgrades during preqba. --- .../inc/BootstrapperApplication.h | 18 ++++++++++++++++-- src/api/burn/balutil/inc/BAFunctions.h | 17 ++++++++++++++++- src/api/burn/balutil/inc/balutil.h | 1 + 3 files changed, 33 insertions(+), 3 deletions(-) (limited to 'src/api') diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index 228cb6ff..ea3be214 100644 --- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h +++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h @@ -1494,7 +1494,22 @@ extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_PROC)( __in_opt LPVOID pvContext ); -extern "C" typedef void (WINAPI *PFN_BOOTSTRAPPER_APPLICATION_DESTROY)(); +struct BOOTSTRAPPER_DESTROY_ARGS +{ + DWORD cbSize; + BOOL fReload; +}; + +struct BOOTSTRAPPER_DESTROY_RESULTS +{ + DWORD cbSize; + BOOL fDisableUnloading; // indicates the BA dll must not be unloaded after BootstrapperApplicationDestroy. +}; + +extern "C" typedef void (WINAPI *PFN_BOOTSTRAPPER_APPLICATION_DESTROY)( + __in const BOOTSTRAPPER_DESTROY_ARGS* pArgs, + __inout BOOTSTRAPPER_DESTROY_RESULTS* pResults + ); @@ -1512,7 +1527,6 @@ struct BOOTSTRAPPER_CREATE_RESULTS DWORD cbSize; PFN_BOOTSTRAPPER_APPLICATION_PROC pfnBootstrapperApplicationProc; LPVOID pvBootstrapperApplicationProcContext; - BOOL fDisableUnloading; // indicates the BA dll must not be unloaded after BootstrapperApplicationDestroy. }; extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_CREATE)( diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h index c1057ab6..b23dd02e 100644 --- a/src/api/burn/balutil/inc/BAFunctions.h +++ b/src/api/burn/balutil/inc/BAFunctions.h @@ -126,6 +126,18 @@ struct BA_FUNCTIONS_CREATE_RESULTS LPVOID pvBAFunctionsProcContext; }; +struct BA_FUNCTIONS_DESTROY_ARGS +{ + DWORD cbSize; + BOOL fReload; +}; + +struct BA_FUNCTIONS_DESTROY_RESULTS +{ + DWORD cbSize; + BOOL fDisableUnloading; // indicates the BAFunctions dll must not be unloaded after BAFunctionsDestroy. +}; + struct BA_FUNCTIONS_ONTHEMECONTROLLOADED_ARGS { DWORD cbSize; @@ -218,7 +230,10 @@ typedef HRESULT(WINAPI *PFN_BA_FUNCTIONS_CREATE)( __inout BA_FUNCTIONS_CREATE_RESULTS* pResults ); -typedef void (WINAPI *PFN_BA_FUNCTIONS_DESTROY)(); +typedef void (WINAPI *PFN_BA_FUNCTIONS_DESTROY)( + __in const BA_FUNCTIONS_DESTROY_ARGS* pArgs, + __inout BA_FUNCTIONS_DESTROY_RESULTS* pResults + ); #ifdef __cplusplus } diff --git a/src/api/burn/balutil/inc/balutil.h b/src/api/burn/balutil/inc/balutil.h index 2e370db7..33f1a6de 100644 --- a/src/api/burn/balutil/inc/balutil.h +++ b/src/api/burn/balutil/inc/balutil.h @@ -39,6 +39,7 @@ static const HRESULT E_WIXSTDBA_CONDITION_FAILED = MAKE_HRESULT(SEVERITY_ERROR, static const HRESULT E_MBAHOST_NET452_ON_WIN7RTM = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 1000); static const HRESULT E_DNCHOST_SCD_RUNTIME_FAILURE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 1001); +static const HRESULT E_PREREQBA_INFINITE_LOOP = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 1002); /******************************************************************* -- cgit v1.2.3-55-g6feb