From befcd209d62a25020f46a688002b259c59e4dc3b Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 28 Feb 2022 18:42:51 -0600 Subject: Refactor related bundle enumeration into butil. Related to #3693 --- src/libs/dutil/WixToolset.DUtil/inc/butil.h | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src/libs/dutil/WixToolset.DUtil/inc/butil.h') diff --git a/src/libs/dutil/WixToolset.DUtil/inc/butil.h b/src/libs/dutil/WixToolset.DUtil/inc/butil.h index 9c2010ee..0d3eefe3 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/butil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/butil.h @@ -12,6 +12,37 @@ typedef enum _BUNDLE_INSTALL_CONTEXT BUNDLE_INSTALL_CONTEXT_USER, } BUNDLE_INSTALL_CONTEXT; +typedef enum _BUNDLE_QUERY_CALLBACK_RESULT +{ + BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE, + BUNDLE_QUERY_CALLBACK_RESULT_CANCEL, +} BUNDLE_QUERY_CALLBACK_RESULT; + +typedef enum _BUNDLE_RELATION_TYPE +{ + BUNDLE_RELATION_NONE, + BUNDLE_RELATION_DETECT, + BUNDLE_RELATION_UPGRADE, + BUNDLE_RELATION_ADDON, + BUNDLE_RELATION_PATCH, + BUNDLE_RELATION_DEPENDENT, + BUNDLE_RELATION_UPDATE, +} BUNDLE_RELATION_TYPE; + +typedef struct _BUNDLE_QUERY_RELATED_BUNDLE_RESULT +{ + LPCWSTR wzBundleId; + BUNDLE_INSTALL_CONTEXT installContext; + REG_KEY_BITNESS regBitness; + HKEY hkBundle; + BUNDLE_RELATION_TYPE relationType; +} BUNDLE_QUERY_RELATED_BUNDLE_RESULT; + +typedef BUNDLE_QUERY_CALLBACK_RESULT(CALLBACK *PFNBUNDLE_QUERY_RELATED_BUNDLE_CALLBACK)( + __in const BUNDLE_QUERY_RELATED_BUNDLE_RESULT* pBundle, + __in_opt LPVOID pvContext + ); + /******************************************************************** BundleGetBundleInfo - Queries the bundle installation metadata for a given property, @@ -155,6 +186,24 @@ HRESULT DAPI BundleGetBundleVariableFixed( __inout SIZE_T* pcchValue ); +/******************************************************************** +BundleQueryRelatedBundles - Queries the bundle installation metadata for installs with the given detect, upgrade, addon, and patch codes. + Passes each related bundle to the callback function. +********************************************************************/ +HRESULT BundleQueryRelatedBundles( + __in BUNDLE_INSTALL_CONTEXT installContext, + __in_z_opt LPCWSTR* rgwzDetectCodes, + __in DWORD cDetectCodes, + __in_z_opt LPCWSTR* rgwzUpgradeCodes, + __in DWORD cUpgradeCodes, + __in_z_opt LPCWSTR* rgwzAddonCodes, + __in DWORD cAddonCodes, + __in_z_opt LPCWSTR* rgwzPatchCodes, + __in DWORD cPatchCodes, + __in PFNBUNDLE_QUERY_RELATED_BUNDLE_CALLBACK pfnCallback, + __in_opt LPVOID pvContext + ); + #ifdef __cplusplus } -- cgit v1.2.3-55-g6feb