diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 40766a805..3c803acd4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -98,7 +98,7 @@ jobs:
# Do NOT publish logs on `master` branch as they may contain secrets in them.
- name: Save logs
- if: github.ref != 'refs/heads/master' && (success() || failure())
+ if: github.ref != 'refs/heads/master' && always()
uses: actions/upload-artifact@v3
with:
name: logs_${{ github.run_id }}
diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/baenginetypes.h
similarity index 83%
rename from src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
rename to src/api/burn/WixToolset.BootstrapperCore.Native/inc/baenginetypes.h
index 96302bd1e..7af41d97b 100644
--- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
+++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/baenginetypes.h
@@ -86,6 +86,7 @@ enum BOOTSTRAPPER_UPDATE_HASH_TYPE
enum BOOTSTRAPPER_ENGINE_MESSAGE
{
+ BOOTSTRAPPER_ENGINE_MESSAGE_UNKNOWN,
BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT,
BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC,
BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING,
@@ -112,159 +113,161 @@ enum BOOTSTRAPPER_ENGINE_MESSAGE
BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATESOURCE,
BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS,
BOOTSTRAPPER_ENGINE_MESSAGE_GETRELATEDBUNDLEVARIABLE,
+
+ BOOTSTRAPPER_APPLICATION_MESSAGE_LAST = 65535
};
typedef struct _BAENGINE_APPLY_ARGS
{
- DWORD cbSize;
- HWND hwndParent;
+ DWORD dwApiVersion;
+ DWORD64 hwndParent;
} BAENGINE_APPLY_ARGS;
typedef struct _BAENGINE_APPLY_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_APPLY_RESULTS;
typedef struct _BAENGINE_CLOSESPLASHSCREEN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_CLOSESPLASHSCREEN_ARGS;
typedef struct _BAENGINE_CLOSESPLASHSCREEN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_CLOSESPLASHSCREEN_RESULTS;
typedef struct _BAENGINE_COMPAREVERSIONS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVersion1;
LPCWSTR wzVersion2;
} BAENGINE_COMPAREVERSIONS_ARGS;
typedef struct _BAENGINE_COMPAREVERSIONS_RESULTS
{
- DWORD cbSize;
- int nResult;
+ DWORD dwApiVersion;
+ INT32 nResult;
} BAENGINE_COMPAREVERSIONS_RESULTS;
typedef struct _BAENGINE_DETECT_ARGS
{
- DWORD cbSize;
- HWND hwndParent;
+ DWORD dwApiVersion;
+ DWORD64 hwndParent;
} BAENGINE_DETECT_ARGS;
typedef struct _BAENGINE_DETECT_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_DETECT_RESULTS;
typedef struct _BAENGINE_ELEVATE_ARGS
{
- DWORD cbSize;
- HWND hwndParent;
+ DWORD dwApiVersion;
+ DWORD64 hwndParent;
} BAENGINE_ELEVATE_ARGS;
typedef struct _BAENGINE_ELEVATE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_ELEVATE_RESULTS;
typedef struct _BAENGINE_ESCAPESTRING_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzIn;
} BAENGINE_ESCAPESTRING_ARGS;
typedef struct _BAENGINE_ESCAPESTRING_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPWSTR wzOut;
// Should be initialized to the size of wzOut.
- SIZE_T cchOut;
+ DWORD cchOut;
} BAENGINE_ESCAPESTRING_RESULTS;
typedef struct _BAENGINE_EVALUATECONDITION_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzCondition;
} BAENGINE_EVALUATECONDITION_ARGS;
typedef struct _BAENGINE_EVALUATECONDITION_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL f;
} BAENGINE_EVALUATECONDITION_RESULTS;
typedef struct _BAENGINE_FORMATSTRING_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzIn;
} BAENGINE_FORMATSTRING_ARGS;
typedef struct _BAENGINE_FORMATSTRING_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPWSTR wzOut;
// Should be initialized to the size of wzOut.
- SIZE_T cchOut;
+ DWORD cchOut;
} BAENGINE_FORMATSTRING_RESULTS;
typedef struct _BAENGINE_GETPACKAGECOUNT_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_GETPACKAGECOUNT_ARGS;
typedef struct _BAENGINE_GETPACKAGECOUNT_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD cPackages;
} BAENGINE_GETPACKAGECOUNT_RESULTS;
typedef struct _BAENGINE_GETVARIABLENUMERIC_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVariable;
} BAENGINE_GETVARIABLENUMERIC_ARGS;
typedef struct _BAENGINE_GETVARIABLENUMERIC_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LONGLONG llValue;
} BAENGINE_GETVARIABLENUMERIC_RESULTS;
typedef struct _BAENGINE_GETVARIABLESTRING_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVariable;
} BAENGINE_GETVARIABLESTRING_ARGS;
typedef struct _BAENGINE_GETVARIABLESTRING_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPWSTR wzValue;
// Should be initialized to the size of wzValue.
- SIZE_T cchValue;
+ DWORD cchValue;
} BAENGINE_GETVARIABLESTRING_RESULTS;
typedef struct _BAENGINE_GETVARIABLEVERSION_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVariable;
} BAENGINE_GETVARIABLEVERSION_ARGS;
typedef struct _BAENGINE_GETVARIABLEVERSION_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPWSTR wzValue;
// Should be initialized to the size of wzValue.
- SIZE_T cchValue;
+ DWORD cchValue;
} BAENGINE_GETVARIABLEVERSION_RESULTS;
typedef struct _BAENGINE_LAUNCHAPPROVEDEXE_ARGS
{
- DWORD cbSize;
- HWND hwndParent;
+ DWORD dwApiVersion;
+ DWORD64 hwndParent;
LPCWSTR wzApprovedExeForElevationId;
LPCWSTR wzArguments;
DWORD dwWaitForInputIdleTimeout;
@@ -272,57 +275,58 @@ typedef struct _BAENGINE_LAUNCHAPPROVEDEXE_ARGS
typedef struct _BAENGINE_LAUNCHAPPROVEDEXE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_LAUNCHAPPROVEDEXE_RESULTS;
typedef struct _BAENGINE_SETUPDATESOURCE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzUrl;
+ LPCWSTR wzAuthorizationHeader;
} BAENGINE_SETUPDATESOURCE_ARGS;
typedef struct _BAENGINE_SETUPDATESOURCE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETUPDATESOURCE_RESULTS;
typedef struct _BAENGINE_LOG_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_LOG_LEVEL level;
LPCWSTR wzMessage;
} BAENGINE_LOG_ARGS;
typedef struct _BAENGINE_LOG_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_LOG_RESULTS;
typedef struct _BAENGINE_PLAN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_ACTION action;
} BAENGINE_PLAN_ARGS;
typedef struct _BAENGINE_PLAN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_PLAN_RESULTS;
typedef struct _BAENGINE_QUIT_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD dwExitCode;
} BAENGINE_QUIT_ARGS;
typedef struct _BAENGINE_QUIT_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_QUIT_RESULTS;
typedef struct _BAENGINE_SENDEMBEDDEDERROR_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD dwErrorCode;
LPCWSTR wzMessage;
DWORD dwUIHint;
@@ -330,41 +334,42 @@ typedef struct _BAENGINE_SENDEMBEDDEDERROR_ARGS
typedef struct _BAENGINE_SENDEMBEDDEDERROR_RESULTS
{
- DWORD cbSize;
- int nResult;
+ DWORD dwApiVersion;
+ INT32 nResult;
} BAENGINE_SENDEMBEDDEDERROR_RESULTS;
typedef struct _BAENGINE_SENDEMBEDDEDPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD dwProgressPercentage;
DWORD dwOverallProgressPercentage;
} BAENGINE_SENDEMBEDDEDPROGRESS_ARGS;
typedef struct _BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS
{
- DWORD cbSize;
- int nResult;
+ DWORD dwApiVersion;
+ INT32 nResult;
} BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS;
typedef struct _BAENGINE_SETDOWNLOADSOURCE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
LPCWSTR wzUrl;
LPCWSTR wzUser;
LPCWSTR wzPassword;
+ LPCWSTR wzAuthorizationHeader;
} BAENGINE_SETDOWNLOADSOURCE_ARGS;
typedef struct _BAENGINE_SETDOWNLOADSOURCE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETDOWNLOADSOURCE_RESULTS;
typedef struct _BAENGINE_SETLOCALSOURCE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
LPCWSTR wzPath;
@@ -372,39 +377,40 @@ typedef struct _BAENGINE_SETLOCALSOURCE_ARGS
typedef struct _BAENGINE_SETLOCALSOURCE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETLOCALSOURCE_RESULTS;
typedef struct _BAENGINE_SETUPDATE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzLocalSource;
LPCWSTR wzDownloadSource;
DWORD64 qwSize;
BOOTSTRAPPER_UPDATE_HASH_TYPE hashType;
LPCWSTR wzHash;
+ LPCWSTR wzUpdatePackageId;
} BAENGINE_SETUPDATE_ARGS;
typedef struct _BAENGINE_SETUPDATE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETUPDATE_RESULTS;
typedef struct _BAENGINE_SETVARIABLENUMERIC_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVariable;
LONGLONG llValue;
} BAENGINE_SETVARIABLENUMERIC_ARGS;
typedef struct _BAENGINE_SETVARIABLENUMERIC_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETVARIABLENUMERIC_RESULTS;
typedef struct _BAENGINE_SETVARIABLESTRING_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVariable;
LPCWSTR wzValue;
BOOL fFormatted;
@@ -412,42 +418,42 @@ typedef struct _BAENGINE_SETVARIABLESTRING_ARGS
typedef struct _BAENGINE_SETVARIABLESTRING_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETVARIABLESTRING_RESULTS;
typedef struct _BAENGINE_SETVARIABLEVERSION_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzVariable;
LPCWSTR wzValue;
} BAENGINE_SETVARIABLEVERSION_ARGS;
typedef struct _BAENGINE_SETVARIABLEVERSION_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
} BAENGINE_SETVARIABLEVERSION_RESULTS;
typedef struct _BAENGINE_GETRELATEDBUNDLEVARIABLE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
LPCWSTR wzVariable;
} BAENGINE_GETRELATEDBUNDLEVARIABLE_ARGS;
typedef struct _BAENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPWSTR wzValue;
// Should be initialized to the size of wzValue.
- SIZE_T cchValue;
+ DWORD cchValue;
} BAENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS;
-extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_ENGINE_PROC)(
- __in BOOTSTRAPPER_ENGINE_MESSAGE message,
- __in const LPVOID pvArgs,
- __inout LPVOID pvResults,
- __in_opt LPVOID pvContext
- );
+// extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_ENGINE_PROC)(
+// __in BOOTSTRAPPER_ENGINE_MESSAGE message,
+// __in const LPVOID pvArgs,
+// __inout LPVOID pvResults,
+// __in_opt LPVOID pvContext
+// );
#if defined(__cplusplus)
}
diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/batypes.h
similarity index 86%
rename from src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h
rename to src/api/burn/WixToolset.BootstrapperCore.Native/inc/batypes.h
index 2633a9c2b..0116364c9 100644
--- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h
+++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/batypes.h
@@ -2,6 +2,10 @@
// 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.
+const LPCWSTR BOOTSTRAPPER_APPLICATION_COMMANDLINE_SWITCH_API_VERSION = L"burn.ba.apiver";
+const LPCWSTR BOOTSTRAPPER_APPLICATION_COMMANDLINE_SWITCH_PIPE_NAME = L"burn.ba.pipe";
+const DWORD WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION = 5;
+
enum BOOTSTRAPPER_DISPLAY
{
BOOTSTRAPPER_DISPLAY_UNKNOWN,
@@ -143,27 +147,30 @@ enum BOOTSTRAPPER_MSI_FILE_VERSIONING
enum BOOTSTRAPPER_APPLICATION_MESSAGE
{
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_UNKNOWN = 65536,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONCREATE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDESTROY,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPATCHTARGET,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPATCHTARGET,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPATCHTARGET,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPATCHTARGET,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYBEGIN,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATEBEGIN,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATECOMPLETE,
@@ -215,8 +222,6 @@ enum BOOTSTRAPPER_APPLICATION_MESSAGE
BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATEBEGIN,
- BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATECOMPLETE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE,
@@ -345,7 +350,7 @@ struct BOOTSTRAPPER_COMMAND
BOOTSTRAPPER_DISPLAY display;
LPWSTR wzCommandLine;
- int nCmdShow;
+ INT32 nCmdShow;
BOOTSTRAPPER_RESUME_TYPE resumeType;
HWND hwndSplashScreen;
@@ -361,19 +366,19 @@ struct BOOTSTRAPPER_COMMAND
struct BA_ONAPPLYBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD dwPhaseCount;
};
struct BA_ONAPPLYBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONAPPLYCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
// Indicates whether any package required a reboot or initiated the reboot already.
BOOTSTRAPPER_APPLY_RESTART restart;
@@ -382,49 +387,49 @@ struct BA_ONAPPLYCOMPLETE_ARGS
struct BA_ONAPPLYCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_APPLYCOMPLETE_ACTION action;
};
struct BA_ONAPPLYDOWNGRADE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrRecommended;
};
struct BA_ONAPPLYDOWNGRADE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONBEGINMSITRANSACTIONBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzTransactionId;
};
struct BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzTransactionId;
HRESULT hrStatus;
};
struct BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONCACHEACQUIREBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
LPCWSTR wzSource;
@@ -435,14 +440,14 @@ struct BA_ONCACHEACQUIREBEGIN_ARGS
struct BA_ONCACHEACQUIREBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOTSTRAPPER_CACHE_OPERATION action;
};
struct BA_ONCACHEACQUIRECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
HRESULT hrStatus;
@@ -451,13 +456,13 @@ struct BA_ONCACHEACQUIRECOMPLETE_ARGS
struct BA_ONCACHEACQUIRECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action;
};
struct BA_ONCACHEACQUIREPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
DWORD64 dw64Progress;
@@ -467,13 +472,13 @@ struct BA_ONCACHEACQUIREPROGRESS_ARGS
struct BA_ONCACHEACQUIREPROGRESS_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHEACQUIRERESOLVING_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
LPCWSTR* rgSearchPaths;
@@ -487,7 +492,7 @@ struct BA_ONCACHEACQUIRERESOLVING_ARGS
struct BA_ONCACHEACQUIRERESOLVING_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD dwChosenSearchPath;
BOOTSTRAPPER_CACHE_RESOLVE_OPERATION action;
BOOL fCancel;
@@ -495,42 +500,42 @@ struct BA_ONCACHEACQUIRERESOLVING_RESULTS
struct BA_ONCACHEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONCACHEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONCACHECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
};
struct BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
HRESULT hrStatus;
@@ -538,12 +543,12 @@ struct BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS
struct BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
DWORD64 dw64Progress;
@@ -553,13 +558,13 @@ struct BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS
struct BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHEPACKAGEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
DWORD cCachePayloads;
DWORD64 dw64PackageCacheSize;
@@ -569,13 +574,13 @@ struct BA_ONCACHEPACKAGEBEGIN_ARGS
struct BA_ONCACHEPACKAGEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHEPACKAGECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
HRESULT hrStatus;
BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation;
@@ -583,13 +588,13 @@ struct BA_ONCACHEPACKAGECOMPLETE_ARGS
struct BA_ONCACHEPACKAGECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action;
};
struct BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
HRESULT hrStatus;
BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION recommendation;
@@ -597,26 +602,26 @@ struct BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_ARGS
struct BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION action;
};
struct BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzContainerId;
LPCWSTR wzPayloadId;
};
struct BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzContainerId;
LPCWSTR wzPayloadId;
HRESULT hrStatus;
@@ -624,12 +629,12 @@ struct BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS
struct BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzContainerId;
LPCWSTR wzPayloadId;
DWORD64 dw64Progress;
@@ -639,26 +644,26 @@ struct BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS
struct BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHEVERIFYBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
};
struct BA_ONCACHEVERIFYBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCACHEVERIFYCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
HRESULT hrStatus;
@@ -667,13 +672,13 @@ struct BA_ONCACHEVERIFYCOMPLETE_ARGS
struct BA_ONCACHEVERIFYCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action;
};
struct BA_ONCACHEVERIFYPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageOrContainerId;
LPCWSTR wzPayloadId;
DWORD64 dw64Progress;
@@ -684,25 +689,25 @@ struct BA_ONCACHEVERIFYPROGRESS_ARGS
struct BA_ONCACHEVERIFYPROGRESS_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzTransactionId;
};
struct BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzTransactionId;
HRESULT hrStatus;
BOOTSTRAPPER_APPLY_RESTART restart;
@@ -711,13 +716,50 @@ struct BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS
struct BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action;
};
+struct BA_ONCREATE_ARGS
+{
+ DWORD dwApiVersion;
+ BOOTSTRAPPER_COMMAND command;
+ // BOOTSTRAPPER_ACTION action;
+ // BOOTSTRAPPER_DISPLAY display;
+
+ // LPWSTR wzCommandLine;
+ // INT32 nCmdShow;
+
+ // BOOTSTRAPPER_RESUME_TYPE resumeType;
+ // HWND hwndSplashScreen;
+
+ // BOOTSTRAPPER_RELATION_TYPE relationType;
+ // BOOL fPassthrough;
+
+ // LPWSTR wzLayoutDirectory;
+ // LPWSTR wzBootstrapperWorkingFolder;
+ // LPWSTR wzBootstrapperApplicationDataPath;
+};
+
+struct BA_ONCREATE_RESULTS
+{
+ DWORD dwApiVersion;
+};
+
+struct BA_ONDESTROY_ARGS
+{
+ DWORD dwApiVersion;
+ BOOL fReload;
+};
+
+struct BA_ONDESTROY_RESULTS
+{
+ DWORD dwApiVersion;
+};
+
struct BA_ONDETECTBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_REGISTRATION_TYPE registrationType;
DWORD cPackages;
BOOL fCached;
@@ -725,13 +767,13 @@ struct BA_ONDETECTBEGIN_ARGS
struct BA_ONDETECTBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzCompatiblePackageId;
LPCWSTR wzCompatiblePackageVersion;
@@ -739,25 +781,25 @@ struct BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS
struct BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
BOOL fEligibleForCleanup;
};
struct BA_ONDETECTCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
BOOTSTRAPPER_RELATION_TYPE relationType;
LPCWSTR wzBundleTag;
@@ -768,13 +810,13 @@ struct BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS
struct BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTMSIFEATURE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzFeatureId;
BOOTSTRAPPER_FEATURE_STATE state;
@@ -782,25 +824,25 @@ struct BA_ONDETECTMSIFEATURE_ARGS
struct BA_ONDETECTMSIFEATURE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTPACKAGEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
};
struct BA_ONDETECTPACKAGEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTPACKAGECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
HRESULT hrStatus;
BOOTSTRAPPER_PACKAGE_STATE state;
@@ -809,12 +851,12 @@ struct BA_ONDETECTPACKAGECOMPLETE_ARGS
struct BA_ONDETECTPACKAGECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONDETECTRELATEDBUNDLE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
BOOTSTRAPPER_RELATION_TYPE relationType;
LPCWSTR wzBundleTag;
@@ -825,13 +867,13 @@ struct BA_ONDETECTRELATEDBUNDLE_ARGS
struct BA_ONDETECTRELATEDBUNDLE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTRELATEDBUNDLEPACKAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzBundleId;
BOOTSTRAPPER_RELATION_TYPE relationType;
@@ -841,13 +883,13 @@ struct BA_ONDETECTRELATEDBUNDLEPACKAGE_ARGS
struct BA_ONDETECTRELATEDBUNDLEPACKAGE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTRELATEDMSIPACKAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzUpgradeCode;
LPCWSTR wzProductCode;
@@ -858,13 +900,13 @@ struct BA_ONDETECTRELATEDMSIPACKAGE_ARGS
struct BA_ONDETECTRELATEDMSIPACKAGE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTPATCHTARGET_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzProductCode;
BOOTSTRAPPER_PACKAGE_STATE patchState;
@@ -872,13 +914,13 @@ struct BA_ONDETECTPATCHTARGET_ARGS
struct BA_ONDETECTPATCHTARGET_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONDETECTUPDATE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzUpdateLocation;
DWORD64 dw64Size;
LPCWSTR wzHash;
@@ -892,61 +934,61 @@ struct BA_ONDETECTUPDATE_ARGS
struct BA_ONDETECTUPDATE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOL fStopProcessingUpdates;
};
struct BA_ONDETECTUPDATEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzUpdateLocation;
};
struct BA_ONDETECTUPDATEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOL fSkip;
};
struct BA_ONDETECTUPDATECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONDETECTUPDATECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fIgnoreError;
};
struct BA_ONELEVATEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONELEVATEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONELEVATECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONELEVATECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONERROR_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_ERROR_TYPE errorType;
LPCWSTR wzPackageId;
DWORD dwCode;
@@ -954,75 +996,75 @@ struct BA_ONERROR_ARGS
DWORD dwUIHint;
DWORD cData;
LPCWSTR* rgwzData;
- int nRecommendation;
+ INT32 nRecommendation;
};
struct BA_ONERROR_RESULTS
{
- DWORD cbSize;
- int nResult;
+ DWORD dwApiVersion;
+ INT32 nResult;
};
struct BA_ONEXECUTEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD cExecutingPackages;
};
struct BA_ONEXECUTEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONEXECUTECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONEXECUTECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONEXECUTEFILESINUSE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
DWORD cFiles;
LPCWSTR* rgwzFiles;
- int nRecommendation;
+ INT32 nRecommendation;
BOOTSTRAPPER_FILES_IN_USE_TYPE source;
};
struct BA_ONEXECUTEFILESINUSE_RESULTS
{
- DWORD cbSize;
- int nResult;
+ DWORD dwApiVersion;
+ INT32 nResult;
};
struct BA_ONEXECUTEMSIMESSAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
INSTALLMESSAGE messageType;
DWORD dwUIHint;
LPCWSTR wzMessage;
DWORD cData;
LPCWSTR* rgwzData;
- int nRecommendation;
+ INT32 nRecommendation;
};
struct BA_ONEXECUTEMSIMESSAGE_RESULTS
{
- DWORD cbSize;
- int nResult;
+ DWORD dwApiVersion;
+ INT32 nResult;
};
struct BA_ONEXECUTEPACKAGEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
BOOL fExecute; // false means rollback.
BOOTSTRAPPER_ACTION_STATE action;
@@ -1032,13 +1074,13 @@ struct BA_ONEXECUTEPACKAGEBEGIN_ARGS
struct BA_ONEXECUTEPACKAGEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONEXECUTEPACKAGECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
HRESULT hrStatus;
// Indicates whether this package requires a reboot or initiated the reboot already.
@@ -1048,26 +1090,26 @@ struct BA_ONEXECUTEPACKAGECOMPLETE_ARGS
struct BA_ONEXECUTEPACKAGECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION action;
};
struct BA_ONEXECUTEPATCHTARGET_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzTargetProductCode;
};
struct BA_ONEXECUTEPATCHTARGET_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONEXECUTEPROCESSCANCEL_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
DWORD dwProcessId;
BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION recommendation;
@@ -1075,13 +1117,13 @@ struct BA_ONEXECUTEPROCESSCANCEL_ARGS
struct BA_ONEXECUTEPROCESSCANCEL_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION action;
};
struct BA_ONEXECUTEPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
DWORD dwProgressPercentage;
DWORD dwOverallPercentage;
@@ -1089,24 +1131,24 @@ struct BA_ONEXECUTEPROGRESS_ARGS
struct BA_ONEXECUTEPROGRESS_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
// Only valid if the operation succeeded.
DWORD dwProcessId;
@@ -1114,45 +1156,45 @@ struct BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS
struct BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPLANBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD cPackages;
};
struct BA_ONPLANBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzCompatiblePackageId;
LPCWSTR wzCompatiblePackageVersion;
@@ -1161,14 +1203,14 @@ struct BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS
struct BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOL fRequestRemove;
};
struct BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzCompatiblePackageId;
HRESULT hrStatus;
@@ -1177,23 +1219,23 @@ struct BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS
struct BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPLANCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONPLANCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
BOOTSTRAPPER_RELATION_TYPE relationType;
LPCWSTR wzBundleTag;
@@ -1204,14 +1246,14 @@ struct BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS
struct BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOL fIgnoreBundle;
};
struct BA_ONPLANMSIFEATURE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzFeatureId;
BOOTSTRAPPER_FEATURE_STATE recommendedState;
@@ -1219,14 +1261,14 @@ struct BA_ONPLANMSIFEATURE_ARGS
struct BA_ONPLANMSIFEATURE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_FEATURE_STATE requestedState;
BOOL fCancel;
};
struct BA_ONPLANMSIPACKAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
BOOL fExecute; // false means rollback.
BOOTSTRAPPER_ACTION_STATE action;
@@ -1235,7 +1277,7 @@ struct BA_ONPLANMSIPACKAGE_ARGS
struct BA_ONPLANMSIPACKAGE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BURN_MSI_PROPERTY actionMsiProperty;
INSTALLUILEVEL uiLevel;
@@ -1245,7 +1287,7 @@ struct BA_ONPLANMSIPACKAGE_RESULTS
struct BA_ONPLANNEDCOMPATIBLEPACKAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzCompatiblePackageId;
BOOL fRemove;
@@ -1253,12 +1295,12 @@ struct BA_ONPLANNEDCOMPATIBLEPACKAGE_ARGS
struct BA_ONPLANNEDCOMPATIBLEPACKAGE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPLANNEDPACKAGE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
BOOTSTRAPPER_ACTION_STATE execute;
BOOTSTRAPPER_ACTION_STATE rollback;
@@ -1268,12 +1310,12 @@ struct BA_ONPLANNEDPACKAGE_ARGS
struct BA_ONPLANNEDPACKAGE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPLANPACKAGEBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
BOOTSTRAPPER_PACKAGE_STATE state;
BOOL fCached;
@@ -1285,7 +1327,7 @@ struct BA_ONPLANPACKAGEBEGIN_ARGS
struct BA_ONPLANPACKAGEBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOTSTRAPPER_REQUEST_STATE requestedState;
BOOTSTRAPPER_CACHE_TYPE requestedCacheType;
@@ -1293,7 +1335,7 @@ struct BA_ONPLANPACKAGEBEGIN_RESULTS
struct BA_ONPLANPACKAGECOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
HRESULT hrStatus;
BOOTSTRAPPER_REQUEST_STATE requested;
@@ -1301,68 +1343,68 @@ struct BA_ONPLANPACKAGECOMPLETE_ARGS
struct BA_ONPLANPACKAGECOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONPLANRELATEDBUNDLE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
BOOTSTRAPPER_REQUEST_STATE recommendedState;
};
struct BA_ONPLANRELATEDBUNDLE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOTSTRAPPER_REQUEST_STATE requestedState;
};
struct BA_ONPLANRELATEDBUNDLETYPE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE recommendedType;
};
struct BA_ONPLANRELATEDBUNDLETYPE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE requestedType;
};
struct BA_ONPLANRESTORERELATEDBUNDLE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzBundleId;
BOOTSTRAPPER_REQUEST_STATE recommendedState;
};
struct BA_ONPLANRESTORERELATEDBUNDLE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOTSTRAPPER_REQUEST_STATE requestedState;
};
struct BA_ONPLANROLLBACKBOUNDARY_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzRollbackBoundaryId;
BOOL fRecommendedTransaction;
};
struct BA_ONPLANROLLBACKBOUNDARY_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fTransaction;
BOOL fCancel;
};
struct BA_ONPLANPATCHTARGET_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzPackageId;
LPCWSTR wzProductCode;
BOOTSTRAPPER_REQUEST_STATE recommendedState;
@@ -1370,62 +1412,62 @@ struct BA_ONPLANPATCHTARGET_ARGS
struct BA_ONPLANPATCHTARGET_RESULTS
{
- DWORD cbSize;
- BOOTSTRAPPER_REQUEST_STATE requestedState;
+ DWORD dwApiVersion;
BOOL fCancel;
+ BOOTSTRAPPER_REQUEST_STATE requestedState;
};
struct BA_ONPROGRESS_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD dwProgressPercentage;
DWORD dwOverallPercentage;
};
struct BA_ONPROGRESS_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
};
struct BA_ONREGISTERBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_REGISTRATION_TYPE recommendedRegistrationType;
};
struct BA_ONREGISTERBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fCancel;
BOOTSTRAPPER_REGISTRATION_TYPE registrationType;
};
struct BA_ONREGISTERCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONREGISTERCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzTransactionId;
};
struct BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
LPCWSTR wzTransactionId;
HRESULT hrStatus;
BOOTSTRAPPER_APPLY_RESTART restart;
@@ -1434,99 +1476,76 @@ struct BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS
struct BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action;
};
-struct BA_ONSETUPDATEBEGIN_ARGS
-{
- DWORD cbSize;
-};
-
-struct BA_ONSETUPDATEBEGIN_RESULTS
-{
- DWORD cbSize;
-};
-
-struct BA_ONSETUPDATECOMPLETE_ARGS
-{
- DWORD cbSize;
- HRESULT hrStatus;
- LPCWSTR wzPreviousPackageId;
- LPCWSTR wzNewPackageId;
-};
-
-struct BA_ONSETUPDATECOMPLETE_RESULTS
-{
- DWORD cbSize;
-};
-
struct BA_ONSHUTDOWN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONSHUTDOWN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_SHUTDOWN_ACTION action;
};
struct BA_ONSTARTUP_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONSTARTUP_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
struct BA_ONUNREGISTERBEGIN_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_REGISTRATION_TYPE recommendedRegistrationType;
};
struct BA_ONUNREGISTERBEGIN_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOTSTRAPPER_REGISTRATION_TYPE registrationType;
};
struct BA_ONUNREGISTERCOMPLETE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
HRESULT hrStatus;
};
struct BA_ONUNREGISTERCOMPLETE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
};
-
+#ifdef TODO_DELETE
extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_PROC)(
__in BOOTSTRAPPER_APPLICATION_MESSAGE message,
@@ -1537,13 +1556,13 @@ extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_PROC)(
struct BOOTSTRAPPER_DESTROY_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fReload;
};
struct BOOTSTRAPPER_DESTROY_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
BOOL fDisableUnloading; // indicates the BA dll must not be unloaded after BootstrapperApplicationDestroy.
};
@@ -1556,7 +1575,7 @@ extern "C" typedef void (WINAPI *PFN_BOOTSTRAPPER_APPLICATION_DESTROY)(
struct BOOTSTRAPPER_CREATE_ARGS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
DWORD64 qwEngineAPIVersion;
PFN_BOOTSTRAPPER_ENGINE_PROC pfnBootstrapperEngineProc;
LPVOID pvBootstrapperEngineProcContext;
@@ -1565,7 +1584,7 @@ struct BOOTSTRAPPER_CREATE_ARGS
struct BOOTSTRAPPER_CREATE_RESULTS
{
- DWORD cbSize;
+ DWORD dwApiVersion;
PFN_BOOTSTRAPPER_APPLICATION_PROC pfnBootstrapperApplicationProc;
LPVOID pvBootstrapperApplicationProcContext;
};
@@ -1574,3 +1593,5 @@ extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_CREATE)(
__in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
__inout BOOTSTRAPPER_CREATE_RESULTS* pResults
);
+
+#endif
diff --git a/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs b/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs
index 339bfd8f6..25995e27f 100644
--- a/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs
+++ b/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs
@@ -6,58 +6,48 @@ namespace WixToolset.Mba.Core
using System.Runtime.InteropServices;
///
- /// Default implementation of .
+ /// This is no longer used.
///
+ [Obsolete("Bootstrapper applications now run out of proc and do not use a BootstrapperApplicationFactory. Remove your BootstrapperApplicationFactory class. See https://wixtoolset.org/docs/fiveforfour/ for more details.")]
public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory
{
///
- /// Default implementation of
+ /// This is no longer used.
///
- /// The args struct given by the engine when initially creating the BA.
- /// The results struct given by the engine when initially creating the BA
+ /// This is no longer used.
+ /// This is no longer used.
public void Create(IntPtr pArgs, IntPtr pResults)
{
- InitializeFromCreateArgs(pArgs, out var engine, out var bootstrapperCommand);
-
- var ba = this.Create(engine, bootstrapperCommand);
- StoreBAInCreateResults(pResults, ba);
+ throw new NotImplementedException();
}
///
- /// Called by to get the .
+ /// This is no longer used.
///
- /// The bundle engine.
- /// Command information passed from the engine for the BA to perform.
- /// The for the bundle.
+ /// This is no longer used.
+ /// This is no longer used.
+ /// This is no longer used.
protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand);
///
- /// Initializes the native part of .
- /// Most users should inherit from instead of calling this method.
+ /// This is no longer used.
///
- /// The args struct given by the engine when initially creating the BA.
- /// The bundle engine interface.
- /// The context of the current run of the bundle.
+ /// This is no longer used.
+ /// This is no longer used.
+ /// This is no longer used.
public static void InitializeFromCreateArgs(IntPtr pArgs, out IEngine engine, out IBootstrapperCommand bootstrapperCommand)
{
- Command pCommand = new Command
- {
- cbSize = Marshal.SizeOf(typeof(Command))
- };
- var pEngine = MbaNative.InitializeFromCreateArgs(pArgs, ref pCommand);
- engine = new Engine(pEngine);
- bootstrapperCommand = pCommand.GetBootstrapperCommand();
+ throw new NotImplementedException();
}
///
- /// Registers the BA with the engine using the default mapping between the message based interface and the COM interface.
- /// Most users should inherit from instead of calling this method.
+ /// This is no longer used.
///
- /// The results struct given by the engine when initially creating the BA
- /// The .
+ /// This is no longer used.
+ /// This is no longer used.
public static void StoreBAInCreateResults(IntPtr pResults, IBootstrapperApplication ba)
{
- MbaNative.StoreBAInCreateResults(pResults, ba);
+ throw new NotImplementedException();
}
}
}
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs
index a0ec6ab94..98b342172 100644
--- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs
@@ -12,24 +12,16 @@ namespace WixToolset.Mba.Core
[ClassInterface(ClassInterfaceType.None)]
public abstract class BootstrapperApplication : MarshalByRefObject, IDefaultBootstrapperApplication
{
- ///
- /// Specifies whether this bootstrapper should run asynchronously. The default is true.
- ///
- protected readonly bool asyncExecution;
-
///
/// Gets the for interaction with the engine.
///
- protected readonly IEngine engine;
+ protected IEngine engine;
- ///
- /// Creates a new instance of the class.
- ///
- protected BootstrapperApplication(IEngine engine)
- {
- this.engine = engine;
- this.asyncExecution = true;
- }
+ ///
+ public event EventHandler Create;
+
+ ///
+ public event EventHandler Destroy;
///
public event EventHandler Startup;
@@ -265,12 +257,6 @@ protected BootstrapperApplication(IEngine engine)
///
public event EventHandler CachePayloadExtractComplete;
- ///
- public event EventHandler SetUpdateBegin;
-
- ///
- public event EventHandler SetUpdateComplete;
-
///
public event EventHandler PlanRestoreRelatedBundle;
@@ -283,36 +269,74 @@ protected BootstrapperApplication(IEngine engine)
///
public event EventHandler CachePackageNonVitalValidationFailure;
+ ///
+ /// The default constructor.
+ ///
+ ///
+ /// The engine object will be valid after handling the OnCreate() event.
+ ///
+ protected BootstrapperApplication()
+ {
+ }
+
+ ///
+ /// This constructor is no longer used.
+ ///
+ [Obsolete("This constructor is no longer used. Use the default constructor. The engine object will be valid after handling the OnCreate() event.")]
+ protected BootstrapperApplication(IEngine engine)
+ {
+ throw new NotImplementedException("This constructor is no longer used. Use the default constructor. The engine object will be valid after handling the OnCreate() event.");
+ }
+
///
/// Entry point that is called when the bootstrapper application is ready to run.
///
protected abstract void Run();
///
- /// Called by the engine, raises the event.
+ /// Called by the engine, raises the event.
///
/// Additional arguments for this event.
- protected virtual void OnStartup(StartupEventArgs args)
+ protected virtual void OnCreate(CreateEventArgs args)
{
- EventHandler handler = this.Startup;
+ this.engine = args.Engine;
+
+ EventHandler handler = this.Create;
if (null != handler)
{
handler(this, args);
}
+ }
- if (this.asyncExecution)
+ ///
+ /// Called by the engine, raises the event.
+ ///
+ /// Additional arguments for this event.
+ protected virtual void OnDestroy(DestroyEventArgs args)
+ {
+ EventHandler handler = this.Destroy;
+ if (null != handler)
{
- this.engine.Log(LogLevel.Verbose, "Creating BA thread to run asynchronously.");
- Thread uiThread = new Thread(this.Run);
- uiThread.Name = "UIThread";
- uiThread.SetApartmentState(ApartmentState.STA);
- uiThread.Start();
+ handler(this, args);
}
- else
+ }
+
+ ///
+ /// Called by the engine, raises the event.
+ ///
+ /// Additional arguments for this event.
+ protected virtual void OnStartup(StartupEventArgs args)
+ {
+ EventHandler handler = this.Startup;
+ if (null != handler)
{
- this.engine.Log(LogLevel.Verbose, "Creating BA thread to run synchronously.");
- this.Run();
+ handler(this, args);
}
+
+ Thread uiThread = new Thread(this.Run);
+ uiThread.Name = "UIThread";
+ uiThread.SetApartmentState(ApartmentState.STA);
+ uiThread.Start();
}
///
@@ -1315,31 +1339,6 @@ protected virtual void OnCachePayloadExtractComplete(CachePayloadExtractComplete
}
}
- ///
- /// Called by the engine, raises the event.
- ///
- /// Additional arguments for this event.
- protected virtual void OnSetUpdateBegin(SetUpdateBeginEventArgs args)
- {
- EventHandler handler = this.SetUpdateBegin;
- if (null != handler)
- {
- handler(this, args);
- }
- }
-
- ///
- /// Called by the engine, raises the event.
- ///
- /// Additional arguments for this event.
- protected virtual void OnSetUpdateComplete(SetUpdateCompleteEventArgs args)
- {
- EventHandler handler = this.SetUpdateComplete;
- if (null != handler)
- {
- handler(this, args);
- }
- }
///
/// Called by the engine, raises the event.
@@ -1395,7 +1394,7 @@ protected virtual void OnCachePackageNonVitalValidationFailure(CachePackageNonVi
#region IBootstrapperApplication Members
- int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults, IntPtr pvContext)
+ int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults)
{
switch (message)
{
@@ -1404,8 +1403,24 @@ int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults
}
}
- void IBootstrapperApplication.BAProcFallback(int message, IntPtr pvArgs, IntPtr pvResults, ref int phr, IntPtr pvContext)
+ void IBootstrapperApplication.BAProcFallback(int message, IntPtr pvArgs, IntPtr pvResults, ref int phr)
+ {
+ }
+
+ int IBootstrapperApplication.OnCreate(IBootstrapperEngine engine, ref Command command)
{
+ CreateEventArgs args = new CreateEventArgs(new Engine(engine), command.GetBootstrapperCommand());
+ this.OnCreate(args);
+
+ return args.HResult;
+ }
+
+ int IBootstrapperApplication.OnDestroy(bool reload)
+ {
+ DestroyEventArgs args = new DestroyEventArgs(reload);
+ this.OnDestroy(args);
+
+ return args.HResult;
}
int IBootstrapperApplication.OnStartup()
@@ -2107,22 +2122,6 @@ int IBootstrapperApplication.OnCachePayloadExtractComplete(string wzContainerId,
return args.HResult;
}
- int IBootstrapperApplication.OnSetUpdateBegin()
- {
- SetUpdateBeginEventArgs args = new SetUpdateBeginEventArgs();
- this.OnSetUpdateBegin(args);
-
- return args.HResult;
- }
-
- int IBootstrapperApplication.OnSetUpdateComplete(int hrStatus, string wzPreviousPackageId, string wzNewPackageId)
- {
- SetUpdateCompleteEventArgs args = new SetUpdateCompleteEventArgs(hrStatus, wzPreviousPackageId, wzNewPackageId);
- this.OnSetUpdateComplete(args);
-
- return args.HResult;
- }
-
int IBootstrapperApplication.OnPlanRestoreRelatedBundle(string wzBundleId, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
{
PlanRestoreRelatedBundleEventArgs args = new PlanRestoreRelatedBundleEventArgs(wzBundleId, recommendedState, pRequestedState, fCancel);
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs
index 95252cf3b..6b4654084 100644
--- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs
@@ -5,31 +5,27 @@ namespace WixToolset.Mba.Core
using System;
///
- /// Identifies the bootstrapper application factory class.
+ /// This is no longer used.
///
- ///
- /// This required assembly attribute identifies the bootstrapper application factory class.
- ///
+ [Obsolete("Bootstrapper applications now run out of proc and do not use a BootstrapperApplicationFactory. Remove your BootstrapperApplicationFactory class. See https://wixtoolset.org/docs/fiveforfour/ for more details.")]
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class BootstrapperApplicationFactoryAttribute : Attribute
{
- private Type bootstrapperApplicationFactoryType;
-
///
- /// Creates a new instance of the class.
+ /// This is no longer used.
///
- /// The of the BA factory.
+ /// This is no longer used
public BootstrapperApplicationFactoryAttribute(Type bootstrapperApplicationFactoryType)
{
- this.bootstrapperApplicationFactoryType = bootstrapperApplicationFactoryType;
+ throw new NotImplementedException();
}
///
- /// Gets the type of the bootstrapper application factory class to create.
+ /// This is no longer used.
///
public Type BootstrapperApplicationFactoryType
{
- get { return this.bootstrapperApplicationFactoryType; }
+ get { throw new NotImplementedException(); }
}
}
}
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs
index ed1dc1917..b96a8f955 100644
--- a/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs
@@ -3,10 +3,54 @@
namespace WixToolset.Mba.Core
{
using System;
+ using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
+ ///
+ /// Command-line provided to the bootstrapper application.
+ ///
+ [Serializable]
+ [StructLayout(LayoutKind.Sequential)]
+ [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
+ public struct Command
+ {
+ // Strings must be declared as pointers so that Marshaling doesn't free them.
+ [MarshalAs(UnmanagedType.I4)] internal int cbSize;
+ [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action;
+ [MarshalAs(UnmanagedType.U4)] private readonly Display display;
+ private readonly IntPtr wzCommandLine;
+ [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow;
+ [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume;
+ private readonly IntPtr hwndSplashScreen;
+ [MarshalAs(UnmanagedType.I4)] private readonly RelationType relation;
+ [MarshalAs(UnmanagedType.Bool)] private readonly bool passthrough;
+ private readonly IntPtr wzLayoutDirectory;
+ private readonly IntPtr wzBootstrapperWorkingFolder;
+ private readonly IntPtr wzBootstrapperApplicationDataPath;
+
+ ///
+ /// Gets the IBootstrapperCommand for this Command.
+ ///
+ /// IBootstrapperCommand
+ public IBootstrapperCommand GetBootstrapperCommand()
+ {
+ return new BootstrapperCommand(
+ this.action,
+ this.display,
+ Marshal.PtrToStringUni(this.wzCommandLine),
+ this.nCmdShow,
+ this.resume,
+ this.hwndSplashScreen,
+ this.relation,
+ this.passthrough,
+ Marshal.PtrToStringUni(this.wzLayoutDirectory),
+ Marshal.PtrToStringUni(this.wzBootstrapperWorkingFolder),
+ Marshal.PtrToStringUni(this.wzBootstrapperApplicationDataPath));
+ }
+ }
+
///
/// Default implementation of .
///
diff --git a/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs b/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs
index ee751ebfc..0039f375b 100644
--- a/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs
+++ b/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs
@@ -34,17 +34,17 @@ internal BundleInfo()
}
///
- public IPackageInfo AddRelatedBundleAsPackage(DetectRelatedBundleEventArgs e)
+ public IPackageInfo AddRelatedBundleAsPackage(string productCode, RelationType relationType, bool perMachine, string version)
{
- var package = PackageInfo.GetRelatedBundleAsPackage(e.ProductCode, e.RelationType, e.PerMachine, e.Version);
+ var package = PackageInfo.GetRelatedBundleAsPackage(productCode, relationType, perMachine, version);
this.Packages.Add(package.Id, package);
return package;
}
///
- public IPackageInfo AddUpdateBundleAsPackage(SetUpdateCompleteEventArgs e)
+ public IPackageInfo AddUpdateBundleAsPackage(string packageId)
{
- var package = PackageInfo.GetUpdateBundleAsPackage(e.NewPackageId);
+ var package = PackageInfo.GetUpdateBundleAsPackage(packageId);
this.Packages.Add(package.Id, package);
return package;
}
diff --git a/src/api/burn/WixToolset.Mba.Core/Engine.cs b/src/api/burn/WixToolset.Mba.Core/Engine.cs
index 1120fb1c6..df412e8cd 100644
--- a/src/api/burn/WixToolset.Mba.Core/Engine.cs
+++ b/src/api/burn/WixToolset.Mba.Core/Engine.cs
@@ -253,9 +253,9 @@ public void Plan(LaunchAction action)
}
///
- public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, string hash)
+ public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, string hash, string updatePackageId)
{
- this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash);
+ this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, updatePackageId);
}
///
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs
index 4b7f2245d..6506c8409 100644
--- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs
+++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs
@@ -197,6 +197,54 @@ public CacheProgressBaseEventArgs(string packageOrContainerId, string payloadId,
public int OverallPercentage { get; private set; }
}
+ ///
+ /// Event arguments for .
+ ///
+ [Serializable]
+ public class CreateEventArgs : HResultEventArgs
+ {
+ ///
+ /// This class is for events raised by the engine.
+ /// It is not intended to be instantiated by user code.
+ ///
+ public CreateEventArgs(IEngine engine, IBootstrapperCommand command)
+ {
+ this.Engine = engine;
+ this.Command = command;
+ }
+
+ ///
+ /// Engine running the application.
+ ///
+ public IEngine Engine { get; }
+
+ ///
+ /// Command line arguments.
+ ///
+ public IBootstrapperCommand Command { get; }
+ }
+
+ ///
+ /// Event arguments for .
+ ///
+ [Serializable]
+ public class DestroyEventArgs : HResultEventArgs
+ {
+ ///
+ /// This class is for events raised by the engine.
+ /// It is not intended to be instantiated by user code.
+ ///
+ public DestroyEventArgs(bool reload)
+ {
+ this.Reload = reload;
+ }
+
+ ///
+ /// Bootstrapper application is being reloaded.
+ ///
+ public bool Reload { get; }
+ }
+
///
/// Event arguments for .
///
@@ -2566,49 +2614,6 @@ public CachePayloadExtractCompleteEventArgs(string containerId, string payloadId
public string PayloadId { get; private set; }
}
- ///
- /// EventArgs for .
- ///
- [Serializable]
- public class SetUpdateBeginEventArgs : HResultEventArgs
- {
- ///
- /// This class is for events raised by the engine.
- /// It is not intended to be instantiated by user code.
- ///
- public SetUpdateBeginEventArgs()
- {
- }
- }
-
- ///
- /// Event arguments for
- ///
- [Serializable]
- public class SetUpdateCompleteEventArgs : StatusEventArgs
- {
- ///
- /// This class is for events raised by the engine.
- /// It is not intended to be instantiated by user code.
- ///
- public SetUpdateCompleteEventArgs(int hrStatus, string previousPackageId, string newPackageId)
- : base(hrStatus)
- {
- this.PreviousPackageId = previousPackageId;
- this.NewPackageId = newPackageId;
- }
-
- ///
- /// Gets the identifier of the update package that was removed.
- ///
- public string PreviousPackageId { get; private set; }
-
- ///
- /// Gets the identifier of the update package that was added.
- ///
- public string NewPackageId { get; private set; }
- }
-
///
/// Event arguments for
///
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs
index 36c7fd33d..8a255c44a 100644
--- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs
@@ -21,8 +21,7 @@ public interface IBootstrapperApplication
int BAProc(
int message,
IntPtr pvArgs,
- IntPtr pvResults,
- IntPtr pvContext
+ IntPtr pvResults
);
///
@@ -32,10 +31,23 @@ void BAProcFallback(
int message,
IntPtr pvArgs,
IntPtr pvResults,
- ref int phr,
- IntPtr pvContext
+ ref int phr
);
+ ///
+ /// See .
+ ///
+ [PreserveSig]
+ [return: MarshalAs(UnmanagedType.I4)]
+ int OnCreate(IBootstrapperEngine engine, ref Command command);
+
+ ///
+ /// See .
+ ///
+ [PreserveSig]
+ [return: MarshalAs(UnmanagedType.I4)]
+ int OnDestroy(bool reload);
+
///
/// See .
///
@@ -939,24 +951,6 @@ int OnCachePayloadExtractComplete(
int hrStatus
);
- ///
- /// See .
- ///
- [PreserveSig]
- [return: MarshalAs(UnmanagedType.I4)]
- int OnSetUpdateBegin();
-
- ///
- /// See .
- ///
- [PreserveSig]
- [return: MarshalAs(UnmanagedType.I4)]
- int OnSetUpdateComplete(
- int hrStatus,
- [MarshalAs(UnmanagedType.LPWStr)] string wzPreviousPackageId,
- [MarshalAs(UnmanagedType.LPWStr)] string wzNewPackageId
- );
-
///
/// See .
///
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs
index 2e84de675..393c7e31e 100644
--- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs
@@ -7,58 +7,16 @@ namespace WixToolset.Mba.Core
using System.Runtime.InteropServices;
///
- /// Interface used by the native host to dynamically load the BA.
+ /// This is no longer used.
///
- [ComVisible(true)]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- [Guid("2965A12F-AC7B-43A0-85DF-E4B2168478A4")]
- [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
+ [Obsolete("Bootstrapper applications now run out of proc and do not use a BootstrapperApplicationFactory. Remove your BootstrapperApplicationFactory class. See https://wixtoolset.org/docs/fiveforfour/ for more details.")]
public interface IBootstrapperApplicationFactory
{
///
- /// Low level method called by the native host.
+ /// This is no longer used.
///
- ///
- ///
- void Create(
- IntPtr pArgs,
- IntPtr pResults
- );
- }
-
- [Serializable]
- [StructLayout(LayoutKind.Sequential)]
- [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
- internal struct Command
- {
- // Strings must be declared as pointers so that Marshaling doesn't free them.
- [MarshalAs(UnmanagedType.I4)] internal int cbSize;
- [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action;
- [MarshalAs(UnmanagedType.U4)] private readonly Display display;
- private readonly IntPtr wzCommandLine;
- [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow;
- [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume;
- private readonly IntPtr hwndSplashScreen;
- [MarshalAs(UnmanagedType.I4)] private readonly RelationType relation;
- [MarshalAs(UnmanagedType.Bool)] private readonly bool passthrough;
- private readonly IntPtr wzLayoutDirectory;
- private readonly IntPtr wzBootstrapperWorkingFolder;
- private readonly IntPtr wzBootstrapperApplicationDataPath;
-
- public IBootstrapperCommand GetBootstrapperCommand()
- {
- return new BootstrapperCommand(
- this.action,
- this.display,
- Marshal.PtrToStringUni(this.wzCommandLine),
- this.nCmdShow,
- this.resume,
- this.hwndSplashScreen,
- this.relation,
- this.passthrough,
- Marshal.PtrToStringUni(this.wzLayoutDirectory),
- Marshal.PtrToStringUni(this.wzBootstrapperWorkingFolder),
- Marshal.PtrToStringUni(this.wzBootstrapperApplicationDataPath));
- }
+ /// This is no longer used.
+ /// This is no longer used.
+ void Create(IntPtr pArgs, IntPtr pResults);
}
}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs
index 3f90639fe..a175beade 100644
--- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs
@@ -108,14 +108,15 @@ void SendEmbeddedProgress(
);
///
- /// See .
+ /// See .
///
void SetUpdate(
[MarshalAs(UnmanagedType.LPWStr)] string wzLocalSource,
[MarshalAs(UnmanagedType.LPWStr)] string wzDownloadSource,
[MarshalAs(UnmanagedType.U8)] long qwValue,
[MarshalAs(UnmanagedType.U4)] UpdateHashType hashType,
- [MarshalAs(UnmanagedType.LPWStr)] string wzHash
+ [MarshalAs(UnmanagedType.LPWStr)] string wzHash,
+ [MarshalAs(UnmanagedType.LPWStr)] string wzUpdatePackageId
);
///
@@ -330,12 +331,12 @@ public enum LaunchAction
Repair,
///
- /// Launch the update registered with and then exit without waiting for it to complete.
+ /// Launch the update registered with and then exit without waiting for it to complete.
///
UpdateReplace,
///
- /// Launch the update registered with as an embedded bundle.
+ /// Launch the update registered with as an embedded bundle.
///
UpdateReplaceEmbedded,
}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs b/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs
index 951f511ac..3c52fc02b 100644
--- a/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs
+++ b/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs
@@ -37,15 +37,18 @@ public interface IBundleInfo
///
/// Adds a related bundle as a package.
///
- ///
+ ///
+ ///
+ ///
+ ///
/// The created .
- IPackageInfo AddRelatedBundleAsPackage(DetectRelatedBundleEventArgs e);
+ IPackageInfo AddRelatedBundleAsPackage(string productCode, RelationType relationType, bool perMachine, string version);
///
/// Adds an update bundle as a package.
///
- ///
+ /// Package id added as update bundle.
/// The created .
- IPackageInfo AddUpdateBundleAsPackage(SetUpdateCompleteEventArgs e);
+ IPackageInfo AddUpdateBundleAsPackage(string packageId);
}
}
diff --git a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs
index 2fa88bdb7..51ea4e4dd 100644
--- a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs
+++ b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs
@@ -138,6 +138,16 @@ public interface IDefaultBootstrapperApplication : IBootstrapperApplication
///
event EventHandler CommitMsiTransactionComplete;
+ ///
+ /// Fired when the application is being created.
+ ///
+ event EventHandler Create;
+
+ ///
+ /// Fired when the application is being destroyed.
+ ///
+ event EventHandler Destroy;
+
///
/// Fired when the overall detection phase has begun.
///
@@ -393,16 +403,6 @@ public interface IDefaultBootstrapperApplication : IBootstrapperApplication
///
event EventHandler RollbackMsiTransactionComplete;
- ///
- /// Fired when the engine has begun to setup the update package.
- ///
- event EventHandler SetUpdateBegin;
-
- ///
- /// Fired when the engine has completed setting up the update package.
- ///
- event EventHandler SetUpdateComplete;
-
///
/// Fired when the engine is shutting down the bootstrapper application.
///
diff --git a/src/api/burn/WixToolset.Mba.Core/IEngine.cs b/src/api/burn/WixToolset.Mba.Core/IEngine.cs
index 7ffa80d7a..dde97a70b 100644
--- a/src/api/burn/WixToolset.Mba.Core/IEngine.cs
+++ b/src/api/burn/WixToolset.Mba.Core/IEngine.cs
@@ -149,7 +149,8 @@ public interface IEngine
/// Size of the expected update.
/// Type of the hash expected on the update.
/// Optional hash expected for the update.
- void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, string hash);
+ /// Optional package id for the update.
+ void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, string hash, string updatePackageId);
///
/// Sets the URL to the update feed.
diff --git a/src/api/burn/WixToolset.Mba.Core/ManagedBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/ManagedBootstrapperApplication.cs
new file mode 100644
index 000000000..74bfbd73d
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/ManagedBootstrapperApplication.cs
@@ -0,0 +1,19 @@
+// 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.
+
+namespace WixToolset.Mba.Core
+{
+ ///
+ /// Managed bootstrapper application entry point.
+ ///
+ public static class ManagedBootstrapperApplication
+ {
+ ///
+ /// Run the managed bootstrapper application.
+ ///
+ /// Bootstrapper applciation to run.
+ public static void Run(IBootstrapperApplication application)
+ {
+ MbaNative.BootstrapperApplicationRun(application);
+ }
+ }
+}
diff --git a/src/api/burn/WixToolset.Mba.Core/MbaNative.cs b/src/api/burn/WixToolset.Mba.Core/MbaNative.cs
index a68a39070..e8e9d576f 100644
--- a/src/api/burn/WixToolset.Mba.Core/MbaNative.cs
+++ b/src/api/burn/WixToolset.Mba.Core/MbaNative.cs
@@ -8,14 +8,10 @@ namespace WixToolset.Mba.Core
internal static class MbaNative
{
[DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
- internal static extern IBootstrapperEngine InitializeFromCreateArgs(
- IntPtr pArgs,
- ref Command pCommand
- );
+ internal static extern void BootstrapperApplicationDebuggerCheck();
- [DllImport("mbanative.dll", ExactSpelling = true)]
- internal static extern void StoreBAInCreateResults(
- IntPtr pResults,
+ [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
+ internal static extern void BootstrapperApplicationRun(
[MarshalAs(UnmanagedType.Interface)] IBootstrapperApplication pBA
);
}
diff --git a/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs b/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs
index c63736479..b91c52c9d 100644
--- a/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs
+++ b/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs
@@ -365,19 +365,19 @@ internal static void ParseBalPackageInfoFromXml(XPathNavigator root, XmlNamespac
package.DisplayInternalUICondition = BootstrapperApplicationData.GetAttribute(node, "DisplayInternalUICondition");
}
- nodes = root.Select("/p:BootstrapperApplicationData/p:WixMbaPrereqInformation", namespaceManager);
+ nodes = root.Select("/p:BootstrapperApplicationData/p:WixPrereqInformation", namespaceManager);
foreach (XPathNavigator node in nodes)
{
string id = BootstrapperApplicationData.GetAttribute(node, "PackageId");
if (id == null)
{
- throw new Exception("Failed to get package identifier for WixMbaPrereqInformation.");
+ throw new Exception("Failed to get package identifier for WixPrereqInformation.");
}
if (!packagesById.TryGetValue(id, out var ipackage))
{
- throw new Exception(String.Format("Failed to find package specified in WixMbaPrereqInformation: {0}", id));
+ throw new Exception(String.Format("Failed to find package specified in WixPrereqInformation: {0}", id));
}
var package = (PackageInfo)ipackage;
diff --git a/src/api/burn/balutil/BalBaseBAFunctionsProc.cpp b/src/api/burn/balutil/BalBaseBAFunctionsProc.cpp
new file mode 100644
index 000000000..38ebf65c8
--- /dev/null
+++ b/src/api/burn/balutil/BalBaseBAFunctionsProc.cpp
@@ -0,0 +1,1099 @@
+// 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 BalBaseBAFunctionsProcOnDestroy(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDESTROY_ARGS* pArgs,
+ __inout BA_ONDESTROY_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnDestroy(pArgs->fReload);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTBEGIN_ARGS* pArgs,
+ __inout BA_ONDETECTBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectBegin(pArgs->fCached, pArgs->registrationType, pArgs->cPackages, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTCOMPLETE_ARGS* pArgs,
+ __inout BA_ONDETECTCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnDetectComplete(pArgs->hrStatus, pArgs->fEligibleForCleanup);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANBEGIN_ARGS* pArgs,
+ __inout BA_ONPLANBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanBegin(pArgs->cPackages, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANCOMPLETE_ARGS* pArgs,
+ __inout BA_ONPLANCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPlanComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnStartup(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONSTARTUP_ARGS* /*pArgs*/,
+ __inout BA_ONSTARTUP_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnStartup();
+}
+
+static HRESULT BalBaseBAFunctionsProcOnShutdown(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONSHUTDOWN_ARGS* /*pArgs*/,
+ __inout BA_ONSHUTDOWN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnShutdown(&pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectForwardCompatibleBundle(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS* pArgs,
+ __inout BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectForwardCompatibleBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fMissingFromCache, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectUpdateBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTUPDATEBEGIN_ARGS* pArgs,
+ __inout BA_ONDETECTUPDATEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectUpdateBegin(pArgs->wzUpdateLocation, &pResults->fCancel, &pResults->fSkip);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectUpdate(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTUPDATE_ARGS* pArgs,
+ __inout BA_ONDETECTUPDATE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectUpdate(pArgs->wzUpdateLocation, pArgs->dw64Size, pArgs->wzHash, pArgs->hashAlgorithm, pArgs->wzVersion, pArgs->wzTitle, pArgs->wzSummary, pArgs->wzContentType, pArgs->wzContent, &pResults->fCancel, &pResults->fStopProcessingUpdates);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectUpdateComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTUPDATECOMPLETE_ARGS* pArgs,
+ __inout BA_ONDETECTUPDATECOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectUpdateComplete(pArgs->hrStatus, &pResults->fIgnoreError);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectRelatedBundle(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTRELATEDBUNDLE_ARGS* pArgs,
+ __inout BA_ONDETECTRELATEDBUNDLE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectRelatedBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fMissingFromCache, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectPackageBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTPACKAGEBEGIN_ARGS* pArgs,
+ __inout BA_ONDETECTPACKAGEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectPackageBegin(pArgs->wzPackageId, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectCompatiblePackage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS* pArgs,
+ __inout BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectCompatibleMsiPackage(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->wzCompatiblePackageVersion, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectRelatedMsiPackage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTRELATEDMSIPACKAGE_ARGS* pArgs,
+ __inout BA_ONDETECTRELATEDMSIPACKAGE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectRelatedMsiPackage(pArgs->wzPackageId, pArgs->wzUpgradeCode, pArgs->wzProductCode, pArgs->fPerMachine, pArgs->wzVersion, pArgs->operation, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectPatchTarget(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTPATCHTARGET_ARGS* pArgs,
+ __inout BA_ONDETECTPATCHTARGET_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectPatchTarget(pArgs->wzPackageId, pArgs->wzProductCode, pArgs->patchState, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectMsiFeature(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTMSIFEATURE_ARGS* pArgs,
+ __inout BA_ONDETECTMSIFEATURE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectMsiFeature(pArgs->wzPackageId, pArgs->wzFeatureId, pArgs->state, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectPackageComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTPACKAGECOMPLETE_ARGS* pArgs,
+ __inout BA_ONDETECTPACKAGECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnDetectPackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->state, pArgs->fCached);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanRelatedBundle(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANRELATEDBUNDLE_ARGS* pArgs,
+ __inout BA_ONPLANRELATEDBUNDLE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanRelatedBundle(pArgs->wzBundleId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanRollbackBoundary(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANROLLBACKBOUNDARY_ARGS* pArgs,
+ __inout BA_ONPLANROLLBACKBOUNDARY_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanRollbackBoundary(pArgs->wzRollbackBoundaryId, pArgs->fRecommendedTransaction, &pResults->fTransaction, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanPackageBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANPACKAGEBEGIN_ARGS* pArgs,
+ __inout BA_ONPLANPACKAGEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanPackageBegin(pArgs->wzPackageId, pArgs->state, pArgs->fCached, pArgs->installCondition, pArgs->repairCondition, pArgs->recommendedState, pArgs->recommendedCacheType, &pResults->requestedState, &pResults->requestedCacheType, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanCompatibleMsiPackageBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS* pArgs,
+ __inout BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanCompatibleMsiPackageBegin(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->wzCompatiblePackageVersion, pArgs->fRecommendedRemove, &pResults->fRequestRemove, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanCompatibleMsiPackageComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS* pArgs,
+ __inout BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPlanCompatibleMsiPackageComplete(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->hrStatus, pArgs->fRequestedRemove);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanPatchTarget(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANPATCHTARGET_ARGS* pArgs,
+ __inout BA_ONPLANPATCHTARGET_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanPatchTarget(pArgs->wzPackageId, pArgs->wzProductCode, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanMsiFeature(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANMSIFEATURE_ARGS* pArgs,
+ __inout BA_ONPLANMSIFEATURE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanMsiFeature(pArgs->wzPackageId, pArgs->wzFeatureId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanPackageComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANPACKAGECOMPLETE_ARGS* pArgs,
+ __inout BA_ONPLANPACKAGECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPlanPackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->requested);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlannedCompatiblePackage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANNEDCOMPATIBLEPACKAGE_ARGS* pArgs,
+ __inout BA_ONPLANNEDCOMPATIBLEPACKAGE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPlannedCompatiblePackage(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->fRemove);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlannedPackage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANNEDPACKAGE_ARGS* pArgs,
+ __inout BA_ONPLANNEDPACKAGE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPlannedPackage(pArgs->wzPackageId, pArgs->execute, pArgs->rollback, pArgs->fPlannedCache, pArgs->fPlannedUncache);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnApplyBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONAPPLYBEGIN_ARGS* pArgs,
+ __inout BA_ONAPPLYBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnApplyBegin(pArgs->dwPhaseCount, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnElevateBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONELEVATEBEGIN_ARGS* /*pArgs*/,
+ __inout BA_ONELEVATEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnElevateBegin(&pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnElevateComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONELEVATECOMPLETE_ARGS* pArgs,
+ __inout BA_ONELEVATECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnElevateComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnProgress(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPROGRESS_ARGS* pArgs,
+ __inout BA_ONPROGRESS_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnProgress(pArgs->dwProgressPercentage, pArgs->dwOverallPercentage, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnError(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONERROR_ARGS* pArgs,
+ __inout BA_ONERROR_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnError(pArgs->errorType, pArgs->wzPackageId, pArgs->dwCode, pArgs->wzError, pArgs->dwUIHint, pArgs->cData, pArgs->rgwzData, pArgs->nRecommendation, &pResults->nResult);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnRegisterBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONREGISTERBEGIN_ARGS* pArgs,
+ __inout BA_ONREGISTERBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnRegisterBegin(pArgs->recommendedRegistrationType, &pResults->fCancel, &pResults->registrationType);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnRegisterComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONREGISTERCOMPLETE_ARGS* pArgs,
+ __inout BA_ONREGISTERCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnRegisterComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEBEGIN_ARGS* /*pArgs*/,
+ __inout BA_ONCACHEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheBegin(&pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCachePackageBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEPACKAGEBEGIN_ARGS* pArgs,
+ __inout BA_ONCACHEPACKAGEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCachePackageBegin(pArgs->wzPackageId, pArgs->cCachePayloads, pArgs->dw64PackageCacheSize, pArgs->fVital, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheAcquireBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEACQUIREBEGIN_ARGS* pArgs,
+ __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheAcquireBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzSource, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->action, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheAcquireProgress(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEACQUIREPROGRESS_ARGS* pArgs,
+ __inout BA_ONCACHEACQUIREPROGRESS_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheAcquireProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheAcquireResolving(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs,
+ __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheAcquireResolving(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->rgSearchPaths, pArgs->cSearchPaths, pArgs->fFoundLocal, pArgs->dwRecommendedSearchPath, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->dwChosenSearchPath, &pResults->action, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheAcquireComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEACQUIRECOMPLETE_ARGS* pArgs,
+ __inout BA_ONCACHEACQUIRECOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheAcquireComplete(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheVerifyBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEVERIFYBEGIN_ARGS* pArgs,
+ __inout BA_ONCACHEVERIFYBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheVerifyBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheVerifyProgress(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEVERIFYPROGRESS_ARGS* pArgs,
+ __inout BA_ONCACHEVERIFYPROGRESS_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheVerifyProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, pArgs->verifyStep, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheVerifyComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEVERIFYCOMPLETE_ARGS* pArgs,
+ __inout BA_ONCACHEVERIFYCOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheVerifyComplete(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCachePackageComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEPACKAGECOMPLETE_ARGS* pArgs,
+ __inout BA_ONCACHEPACKAGECOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCachePackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHECOMPLETE_ARGS* pArgs,
+ __inout BA_ONCACHECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnCacheComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecuteBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEBEGIN_ARGS* pArgs,
+ __inout BA_ONEXECUTEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecuteBegin(pArgs->cExecutingPackages, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecutePackageBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEPACKAGEBEGIN_ARGS* pArgs,
+ __inout BA_ONEXECUTEPACKAGEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecutePackageBegin(pArgs->wzPackageId, pArgs->fExecute, pArgs->action, pArgs->uiLevel, pArgs->fDisableExternalUiHandler, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecutePatchTarget(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEPATCHTARGET_ARGS* pArgs,
+ __inout BA_ONEXECUTEPATCHTARGET_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecutePatchTarget(pArgs->wzPackageId, pArgs->wzTargetProductCode, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecuteProgress(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEPROGRESS_ARGS* pArgs,
+ __inout BA_ONEXECUTEPROGRESS_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecuteProgress(pArgs->wzPackageId, pArgs->dwProgressPercentage, pArgs->dwOverallPercentage, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecuteMsiMessage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEMSIMESSAGE_ARGS* pArgs,
+ __inout BA_ONEXECUTEMSIMESSAGE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecuteMsiMessage(pArgs->wzPackageId, pArgs->messageType, pArgs->dwUIHint, pArgs->wzMessage, pArgs->cData, pArgs->rgwzData, pArgs->nRecommendation, &pResults->nResult);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecuteFilesInUse(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEFILESINUSE_ARGS* pArgs,
+ __inout BA_ONEXECUTEFILESINUSE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecuteFilesInUse(pArgs->wzPackageId, pArgs->cFiles, pArgs->rgwzFiles, pArgs->nRecommendation, pArgs->source, &pResults->nResult);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecutePackageComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEPACKAGECOMPLETE_ARGS* pArgs,
+ __inout BA_ONEXECUTEPACKAGECOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecutePackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecuteProcessCancel(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTEPROCESSCANCEL_ARGS* pArgs,
+ __inout BA_ONEXECUTEPROCESSCANCEL_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnExecuteProcessCancel(pArgs->wzPackageId, pArgs->dwProcessId, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnExecuteComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONEXECUTECOMPLETE_ARGS* pArgs,
+ __inout BA_ONEXECUTECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnExecuteComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnUnregisterBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONUNREGISTERBEGIN_ARGS* pArgs,
+ __inout BA_ONUNREGISTERBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnUnregisterBegin(pArgs->recommendedRegistrationType, &pResults->registrationType);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnUnregisterComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONUNREGISTERCOMPLETE_ARGS* pArgs,
+ __inout BA_ONUNREGISTERCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnUnregisterComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnApplyComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONAPPLYCOMPLETE_ARGS* pArgs,
+ __inout BA_ONAPPLYCOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnApplyComplete(pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnLaunchApprovedExeBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS* /*pArgs*/,
+ __inout BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnLaunchApprovedExeBegin(&pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnLaunchApprovedExeComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS* pArgs,
+ __inout BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnLaunchApprovedExeComplete(pArgs->hrStatus, pArgs->dwProcessId);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanMsiPackage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANMSIPACKAGE_ARGS* pArgs,
+ __inout BA_ONPLANMSIPACKAGE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanMsiPackage(pArgs->wzPackageId, pArgs->fExecute, pArgs->action, pArgs->recommendedFileVersioning, &pResults->fCancel, &pResults->actionMsiProperty, &pResults->uiLevel, &pResults->fDisableExternalUiHandler, &pResults->fileVersioning);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnBeginMsiTransactionBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONBEGINMSITRANSACTIONBEGIN_ARGS* pArgs,
+ __inout BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnBeginMsiTransactionBegin(pArgs->wzTransactionId, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnBeginMsiTransactionComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS* pArgs,
+ __inout BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnBeginMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCommitMsiTransactionBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS* pArgs,
+ __inout BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCommitMsiTransactionBegin(pArgs->wzTransactionId, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCommitMsiTransactionComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS* pArgs,
+ __inout BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCommitMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnRollbackMsiTransactionBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS* pArgs,
+ __inout BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnRollbackMsiTransactionBegin(pArgs->wzTransactionId);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnRollbackMsiTransactionComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS* pArgs,
+ __inout BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnRollbackMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPauseAutomaticUpdatesBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS* /*pArgs*/,
+ __inout BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPauseAutomaticUpdatesBegin();
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPauseAutomaticUpdatesComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS* pArgs,
+ __inout BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnPauseAutomaticUpdatesComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnSystemRestorePointBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS* /*pArgs*/,
+ __inout BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnSystemRestorePointBegin();
+}
+
+static HRESULT BalBaseBAFunctionsProcOnSystemRestorePointComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS* pArgs,
+ __inout BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnSystemRestorePointComplete(pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanForwardCompatibleBundle(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS* pArgs,
+ __inout BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanForwardCompatibleBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fRecommendedIgnoreBundle, &pResults->fCancel, &pResults->fIgnoreBundle);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheContainerOrPayloadVerifyBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS* pArgs,
+ __inout BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheContainerOrPayloadVerifyBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheContainerOrPayloadVerifyProgress(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS* pArgs,
+ __inout BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCacheContainerOrPayloadVerifyProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCacheContainerOrPayloadVerifyComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS* pArgs,
+ __inout BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnCacheContainerOrPayloadVerifyComplete(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCachePayloadExtractBegin(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS* pArgs,
+ __inout BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCachePayloadExtractBegin(pArgs->wzContainerId, pArgs->wzPayloadId, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCachePayloadExtractProgress(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS* pArgs,
+ __inout BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCachePayloadExtractProgress(pArgs->wzContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCachePayloadExtractComplete(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS* pArgs,
+ __inout BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnCachePayloadExtractComplete(pArgs->wzContainerId, pArgs->wzPayloadId, pArgs->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanRestoreRelatedBundle(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANRESTORERELATEDBUNDLE_ARGS* pArgs,
+ __inout BA_ONPLANRESTORERELATEDBUNDLE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanRestoreRelatedBundle(pArgs->wzBundleId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnPlanRelatedBundleType(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONPLANRELATEDBUNDLETYPE_ARGS* pArgs,
+ __inout BA_ONPLANRELATEDBUNDLETYPE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnPlanRelatedBundleType(pArgs->wzBundleId, pArgs->recommendedType, &pResults->requestedType, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnApplyDowngrade(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONAPPLYDOWNGRADE_ARGS* pArgs,
+ __inout BA_ONAPPLYDOWNGRADE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnApplyDowngrade(pArgs->hrRecommended, &pResults->hrStatus);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnDetectRelatedBundlePackage(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONDETECTRELATEDBUNDLEPACKAGE_ARGS* pArgs,
+ __inout BA_ONDETECTRELATEDBUNDLEPACKAGE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnDetectRelatedBundlePackage(pArgs->wzPackageId, pArgs->wzBundleId, pArgs->relationType, pArgs->fPerMachine, pArgs->wzVersion, &pResults->fCancel);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnCachePackageNonVitalValidationFailure(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_ARGS* pArgs,
+ __inout BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnCachePackageNonVitalValidationFailure(pArgs->wzPackageId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnThemeLoaded(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_FUNCTIONS_ONTHEMELOADED_ARGS* pArgs,
+ __inout BA_FUNCTIONS_ONTHEMELOADED_RESULTS* /*pResults*/
+ )
+{
+ return pBAFunctions->OnThemeLoaded(pArgs->hWnd);
+}
+
+static HRESULT BalBaseBAFunctionsProcWndProc(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_FUNCTIONS_WNDPROC_ARGS* pArgs,
+ __inout BA_FUNCTIONS_WNDPROC_RESULTS* pResults
+ )
+{
+ return pBAFunctions->WndProc(pArgs->hWnd, pArgs->uMsg, pArgs->wParam, pArgs->lParam, &pResults->fProcessed, &pResults->lResult);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnThemeControlLoading(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_FUNCTIONS_ONTHEMECONTROLLOADING_ARGS* pArgs,
+ __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId, &pResults->dwAutomaticBehaviorType);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS* pArgs,
+ __inout BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnThemeControlWmCommand(pArgs->wParam, pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed, &pResults->lResult);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnThemeControlWmNotify(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_ARGS* pArgs,
+ __inout BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnThemeControlWmNotify(pArgs->lParam, pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed, &pResults->lResult);
+}
+
+static HRESULT BalBaseBAFunctionsProcOnThemeControlLoaded(
+ __in IBAFunctions* pBAFunctions,
+ __in BA_FUNCTIONS_ONTHEMECONTROLLOADED_ARGS* pArgs,
+ __inout BA_FUNCTIONS_ONTHEMECONTROLLOADED_RESULTS* pResults
+ )
+{
+ return pBAFunctions->OnThemeControlLoaded(pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed);
+}
+
+/*******************************************************************
+BalBaseBAFunctionsProc - requires pvContext to be of type IBAFunctions.
+Provides a default mapping between the message based BAFunctions interface and
+the COM-based BAFunctions interface.
+
+*******************************************************************/
+HRESULT WINAPI BalBaseBAFunctionsProc(
+ __in BA_FUNCTIONS_MESSAGE message,
+ __in const LPVOID pvArgs,
+ __inout LPVOID pvResults,
+ __in_opt LPVOID pvContext
+ )
+{
+ IBAFunctions* pBAFunctions = reinterpret_cast(pvContext);
+ HRESULT hr = pBAFunctions->BAFunctionsProc(message, pvArgs, pvResults, pvContext);
+
+ if (E_NOTIMPL == hr)
+ {
+ switch (message)
+ {
+ case BA_FUNCTIONS_MESSAGE_ONCREATE:
+ // ONCREATE is handled when the function is created, not via callback.
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDESTROY:
+ hr = BalBaseBAFunctionsProcOnDestroy(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONSTARTUP:
+ hr = BalBaseBAFunctionsProcOnStartup(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONSHUTDOWN:
+ hr = BalBaseBAFunctionsProcOnShutdown(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTBEGIN:
+ hr = BalBaseBAFunctionsProcOnDetectBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnDetectComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANBEGIN:
+ hr = BalBaseBAFunctionsProcOnPlanBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnPlanComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE:
+ hr = BalBaseBAFunctionsProcOnDetectForwardCompatibleBundle(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN:
+ hr = BalBaseBAFunctionsProcOnDetectUpdateBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE:
+ hr = BalBaseBAFunctionsProcOnDetectUpdate(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnDetectUpdateComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDBUNDLE:
+ hr = BalBaseBAFunctionsProcOnDetectRelatedBundle(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTPACKAGEBEGIN:
+ hr = BalBaseBAFunctionsProcOnDetectPackageBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDMSIPACKAGE:
+ hr = BalBaseBAFunctionsProcOnDetectRelatedMsiPackage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTPATCHTARGET:
+ hr = BalBaseBAFunctionsProcOnDetectPatchTarget(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTMSIFEATURE:
+ hr = BalBaseBAFunctionsProcOnDetectMsiFeature(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTPACKAGECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnDetectPackageComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANRELATEDBUNDLE:
+ hr = BalBaseBAFunctionsProcOnPlanRelatedBundle(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANPACKAGEBEGIN:
+ hr = BalBaseBAFunctionsProcOnPlanPackageBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANPATCHTARGET:
+ hr = BalBaseBAFunctionsProcOnPlanPatchTarget(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANMSIFEATURE:
+ hr = BalBaseBAFunctionsProcOnPlanMsiFeature(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANPACKAGECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnPlanPackageComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONAPPLYBEGIN:
+ hr = BalBaseBAFunctionsProcOnApplyBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONELEVATEBEGIN:
+ hr = BalBaseBAFunctionsProcOnElevateBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONELEVATECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnElevateComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPROGRESS:
+ hr = BalBaseBAFunctionsProcOnProgress(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONERROR:
+ hr = BalBaseBAFunctionsProcOnError(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONREGISTERBEGIN:
+ hr = BalBaseBAFunctionsProcOnRegisterBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONREGISTERCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnRegisterComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEBEGIN:
+ hr = BalBaseBAFunctionsProcOnCacheBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN:
+ hr = BalBaseBAFunctionsProcOnCachePackageBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN:
+ hr = BalBaseBAFunctionsProcOnCacheAcquireBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS:
+ hr = BalBaseBAFunctionsProcOnCacheAcquireProgress(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING:
+ hr = BalBaseBAFunctionsProcOnCacheAcquireResolving(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCacheAcquireComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN:
+ hr = BalBaseBAFunctionsProcOnCacheVerifyBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYPROGRESS:
+ hr = BalBaseBAFunctionsProcOnCacheVerifyProgress(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCacheVerifyComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCachePackageComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCacheComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEBEGIN:
+ hr = BalBaseBAFunctionsProcOnExecuteBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEPACKAGEBEGIN:
+ hr = BalBaseBAFunctionsProcOnExecutePackageBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEPATCHTARGET:
+ hr = BalBaseBAFunctionsProcOnExecutePatchTarget(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEPROGRESS:
+ hr = BalBaseBAFunctionsProcOnExecuteProgress(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEMSIMESSAGE:
+ hr = BalBaseBAFunctionsProcOnExecuteMsiMessage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEFILESINUSE:
+ hr = BalBaseBAFunctionsProcOnExecuteFilesInUse(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEPACKAGECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnExecutePackageComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnExecuteComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONUNREGISTERBEGIN:
+ hr = BalBaseBAFunctionsProcOnUnregisterBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONUNREGISTERCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnUnregisterComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONAPPLYCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnApplyComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN:
+ hr = BalBaseBAFunctionsProcOnLaunchApprovedExeBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnLaunchApprovedExeComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANMSIPACKAGE:
+ hr = BalBaseBAFunctionsProcOnPlanMsiPackage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONBEGINMSITRANSACTIONBEGIN:
+ hr = BalBaseBAFunctionsProcOnBeginMsiTransactionBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnBeginMsiTransactionComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN:
+ hr = BalBaseBAFunctionsProcOnCommitMsiTransactionBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCommitMsiTransactionComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN:
+ hr = BalBaseBAFunctionsProcOnRollbackMsiTransactionBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnRollbackMsiTransactionComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ case BA_FUNCTIONS_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN:
+ hr = BalBaseBAFunctionsProcOnPauseAutomaticUpdatesBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnPauseAutomaticUpdatesComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN:
+ hr = BalBaseBAFunctionsProcOnSystemRestorePointBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnSystemRestorePointComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANNEDPACKAGE:
+ hr = BalBaseBAFunctionsProcOnPlannedPackage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE:
+ hr = BalBaseBAFunctionsProcOnPlanForwardCompatibleBundle(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN:
+ hr = BalBaseBAFunctionsProcOnCacheContainerOrPayloadVerifyBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS:
+ hr = BalBaseBAFunctionsProcOnCacheContainerOrPayloadVerifyProgress(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCacheContainerOrPayloadVerifyComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN:
+ hr = BalBaseBAFunctionsProcOnCachePayloadExtractBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS:
+ hr = BalBaseBAFunctionsProcOnCachePayloadExtractProgress(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE:
+ hr = BalBaseBAFunctionsProcOnCachePayloadExtractComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY:
+ hr = BalBaseBAFunctionsProcOnPlanRollbackBoundary(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE:
+ hr = BalBaseBAFunctionsProcOnDetectCompatiblePackage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN:
+ hr = BalBaseBAFunctionsProcOnPlanCompatibleMsiPackageBegin(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE:
+ hr = BalBaseBAFunctionsProcOnPlanCompatibleMsiPackageComplete(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANNEDCOMPATIBLEPACKAGE:
+ hr = BalBaseBAFunctionsProcOnPlannedCompatiblePackage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANRESTORERELATEDBUNDLE:
+ hr = BalBaseBAFunctionsProcOnPlanRestoreRelatedBundle(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONPLANRELATEDBUNDLETYPE:
+ hr = BalBaseBAFunctionsProcOnPlanRelatedBundleType(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONAPPLYDOWNGRADE:
+ hr = BalBaseBAFunctionsProcOnApplyDowngrade(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONEXECUTEPROCESSCANCEL:
+ hr = BalBaseBAFunctionsProcOnExecuteProcessCancel(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDBUNDLEPACKAGE:
+ hr = BalBaseBAFunctionsProcOnDetectRelatedBundlePackage(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGENONVITALVALIDATIONFAILURE:
+ hr = BalBaseBAFunctionsProcOnCachePackageNonVitalValidationFailure(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONTHEMELOADED:
+ hr = BalBaseBAFunctionsProcOnThemeLoaded(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_WNDPROC:
+ hr = BalBaseBAFunctionsProcWndProc(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING:
+ hr = BalBaseBAFunctionsProcOnThemeControlLoading(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMCOMMAND:
+ hr = BalBaseBAFunctionsProcOnThemeControlWmCommand(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMNOTIFY:
+ hr = BalBaseBAFunctionsProcOnThemeControlWmNotify(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADED:
+ hr = BalBaseBAFunctionsProcOnThemeControlLoaded(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
+ }
+ }
+
+ return hr;
+}
diff --git a/src/api/burn/balutil/BalBootstrapperEngine.cpp b/src/api/burn/balutil/BalBootstrapperEngine.cpp
index be53c6b94..b924906ef 100644
--- a/src/api/burn/balutil/BalBootstrapperEngine.cpp
+++ b/src/api/burn/balutil/BalBootstrapperEngine.cpp
@@ -2,7 +2,6 @@
#include "precomp.h"
-
class CBalBootstrapperEngine : public IBootstrapperEngine
{
public: // IUnknown
@@ -64,18 +63,44 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_GETPACKAGECOUNT_ARGS args = { };
BAENGINE_GETPACKAGECOUNT_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
ExitOnNull(pcPackages, hr, E_INVALIDARG, "pcPackages is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetPackageCount args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetPackageCount results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA GetPackageCount failed.");
- results.cbSize = sizeof(results);
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read value length from GetPackageCount results.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, (DWORD*)&results.cPackages);
+ ExitOnFailure(hr, "Failed to read value length from GetPackageCount results.");
*pcPackages = results.cPackages;
LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -87,20 +112,50 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_GETVARIABLENUMERIC_ARGS args = { };
BAENGINE_GETVARIABLENUMERIC_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ LPWSTR sczValue = NULL;
ExitOnNull(pllValue, hr, E_INVALIDARG, "pllValue is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVariable = wzVariable;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableNumeric args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable name of GetVariableNumeric args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableNumeric results.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA GetVariableNumeric failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read value length from GetVariableNumeric results.");
+
+ hr = BuffReadNumber64(rpc.pbData, rpc.cbData, &iBuffer, (DWORD64*)&results.llValue);
+ ExitOnFailure(hr, "Failed to read value length from GetVariableNumeric results.");
*pllValue = results.llValue;
LExit:
- SecureZeroMemory(&results, sizeof(results));
+ ReleaseStr(sczValue);
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -113,21 +168,69 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_GETVARIABLESTRING_ARGS args = { };
BAENGINE_GETVARIABLESTRING_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ LPWSTR sczValue = NULL;
ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVariable = wzVariable;
- results.cbSize = sizeof(results);
- results.wzValue = wzValue;
- results.cchValue = *pcchValue;
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ results.cchValue = static_cast(*pcchValue);
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableString args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable name of GetVariableString args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableString results.");
+
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.cchValue);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableString results value.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA GetVariableString failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read value length from GetVariableString results.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.cchValue);
+ ExitOnFailure(hr, "Failed to read value length from GetVariableString results.");
+
+ hr = BuffReadString(rpc.pbData, rpc.cbData, &iBuffer, &sczValue);
+ ExitOnFailure(hr, "Failed to read value from GetVariableString results.");
+
+ results.wzValue = sczValue;
+
+ if (wzValue)
+ {
+ hr = ::StringCchCopyW(wzValue, *pcchValue, results.wzValue);
+ }
+ else if (results.cchValue)
+ {
+ hr = E_MOREDATA;
+ }
*pcchValue = results.cchValue;
+ ExitOnFailure(hr, "Failed to copy value from GetVariableString results.");
LExit:
+ ReleaseStr(sczValue);
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -140,21 +243,70 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_GETVARIABLEVERSION_ARGS args = { };
BAENGINE_GETVARIABLEVERSION_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ LPWSTR sczValue = NULL;
ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVariable = wzVariable;
- results.cbSize = sizeof(results);
- results.wzValue = wzValue;
- results.cchValue = *pcchValue;
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ hr = DutilSizetToDword(*pcchValue, &results.cchValue);
+ ExitOnFailure(hr, "Failed to convert pcchValue to DWORD.");
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableVersion args.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable name of GetVariableVersion args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableVersion results.");
+
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.cchValue);
+ ExitOnFailure(hr, "Failed to write API version of GetVariableVersion results value.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA GetVariableVersion failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read value length from GetVariableVersion results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.cchValue);
+ ExitOnFailure(hr, "Failed to read value length from GetVariableVersion results.");
+
+ hr = BuffReadString(rpc.pbData, rpc.cbData, &iBuffer, &sczValue);
+ ExitOnFailure(hr, "Failed to read value from GetVariableVersion results.");
+
+ results.wzValue = sczValue;
+
+ if (wzValue)
+ {
+ hr = ::StringCchCopyW(wzValue, *pcchValue, results.wzValue);
+ }
+ else if (results.cchValue)
+ {
+ hr = E_MOREDATA;
+ }
*pcchValue = results.cchValue;
+ ExitOnFailure(hr, "Failed to copy value from GetVariableVersion results.");
LExit:
+ ReleaseStr(sczValue);
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -168,21 +320,74 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_GETRELATEDBUNDLEVARIABLE_ARGS args = { };
BAENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ LPWSTR sczValue = NULL;
ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzBundleId = wzBundleId;
args.wzVariable = wzVariable;
- results.cbSize = sizeof(results);
- results.wzValue = wzValue;
- results.cchValue = *pcchValue;
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ hr = DutilSizetToDword(*pcchValue, &results.cchValue);
+ ExitOnFailure(hr, "Failed to convert pcchValue to DWORD.");
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetRelatedBundleVariable args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId);
+ ExitOnFailure(hr, "Failed to write bundle id of GetRelatedBundleVariable args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable name of GetRelatedBundleVariable args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of GetRelatedBundleVariable results.");
+
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.cchValue);
+ ExitOnFailure(hr, "Failed to write API version of GetRelatedBundleVariable results value.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_GETRELATEDBUNDLEVARIABLE, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_GETRELATEDBUNDLEVARIABLE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA GetRelatedBundleVariable failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read value length from GetRelatedBundleVariable results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.cchValue);
+ ExitOnFailure(hr, "Failed to read value length from GetRelatedBundleVariable results.");
+
+ hr = BuffReadString(rpc.pbData, rpc.cbData, &iBuffer, &sczValue);
+ ExitOnFailure(hr, "Failed to read value from GetRelatedBundleVariable results.");
+
+ results.wzValue = sczValue;
+
+ if (wzValue)
+ {
+ hr = ::StringCchCopyW(wzValue, *pcchValue, results.wzValue);
+ }
+ else if (results.cchValue)
+ {
+ hr = E_MOREDATA;
+ }
*pcchValue = results.cchValue;
+ ExitOnFailure(hr, "Failed to copy value from GetRelatedBundleVariable results.");
+
LExit:
+ ReleaseStr(sczValue);
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -195,21 +400,70 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_FORMATSTRING_ARGS args = { };
BAENGINE_FORMATSTRING_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ LPWSTR sczOut = NULL;
ExitOnNull(pcchOut, hr, E_INVALIDARG, "pcchOut is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzIn = wzIn;
- results.cbSize = sizeof(results);
- results.wzOut = wzOut;
- results.cchOut = *pcchOut;
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ hr = DutilSizetToDword(*pcchOut, &results.cchOut);
+ ExitOnFailure(hr, "Failed to convert pcchOut to DWORD.");
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of FormatString args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzIn);
+ ExitOnFailure(hr, "Failed to write string to format of FormatString args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of FormatString results.");
+
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.cchOut);
+ ExitOnFailure(hr, "Failed to write format string maximum size of FormatString results value.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_FORMATSTRING, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA FormatString failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read size from FormatString results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.cchOut);
+ ExitOnFailure(hr, "Failed to read formatted string length from FormatString results.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_FORMATSTRING, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffReadString(rpc.pbData, rpc.cbData, &iBuffer, &sczOut);
+ ExitOnFailure(hr, "Failed to read formatted string from FormatString results.");
+
+ results.wzOut = sczOut;
+
+ if (wzOut)
+ {
+ hr = ::StringCchCopyW(wzOut, *pcchOut, results.wzOut);
+ }
+ else if (results.cchOut)
+ {
+ hr = E_MOREDATA;
+ }
*pcchOut = results.cchOut;
+ ExitOnFailure(hr, "Failed to copy formatted string from FormatString results.");
LExit:
+ ReleaseStr(sczOut);
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -222,21 +476,70 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_ESCAPESTRING_ARGS args = { };
BAENGINE_ESCAPESTRING_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ LPWSTR sczOut = NULL;
ExitOnNull(pcchOut, hr, E_INVALIDARG, "pcchOut is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzIn = wzIn;
- results.cbSize = sizeof(results);
- results.wzOut = wzOut;
- results.cchOut = *pcchOut;
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ hr = DutilSizetToDword(*pcchOut, &results.cchOut);
+ ExitOnFailure(hr, "Failed to convert pcchOut to DWORD.");
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of EscapeString args.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_ESCAPESTRING, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzIn);
+ ExitOnFailure(hr, "Failed to write string to escape of EscapeString args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of EscapeString results.");
+
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.cchOut);
+ ExitOnFailure(hr, "Failed to write escape string maximum size of EscapeString results value.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_ESCAPESTRING, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA EscapeString failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read size from EscapeString results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.cchOut);
+ ExitOnFailure(hr, "Failed to read escaped string length from EscapeString results.");
+
+ hr = BuffReadString(rpc.pbData, rpc.cbData, &iBuffer, &sczOut);
+ ExitOnFailure(hr, "Failed to read escaped string from EscapeString results.");
+
+ results.wzOut = sczOut;
+
+ if (wzOut)
+ {
+ hr = ::StringCchCopyW(wzOut, *pcchOut, results.wzOut);
+ }
+ else if (results.cchOut)
+ {
+ hr = E_MOREDATA;
+ }
*pcchOut = results.cchOut;
+ ExitOnFailure(hr, "Failed to copy escaped string from EscapeString results.");
LExit:
+ ReleaseStr(sczOut);
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -248,19 +551,56 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_EVALUATECONDITION_ARGS args = { };
BAENGINE_EVALUATECONDITION_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
+ ExitOnNull(wzCondition, hr, E_INVALIDARG, "wzCondition is required");
ExitOnNull(pf, hr, E_INVALIDARG, "pf is required");
- args.cbSize = sizeof(args);
+ // Empty condition evaluates to true.
+ if (!*wzCondition)
+ {
+ *pf = TRUE;
+ ExitFunction();
+ }
+
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzCondition = wzCondition;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of EvaluateCondition args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzCondition);
+ ExitOnFailure(hr, "Failed to write condition of EvaluateCondition args.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_EVALUATECONDITION, &args, &results, m_pvBAEngineProcContext);
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of EvaluateCondition results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_EVALUATECONDITION, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA EvaluateCondition failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read size from EvaluateCondition results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, reinterpret_cast(&results.f));
+ ExitOnFailure(hr, "Failed to read result from EvaluateCondition results.");
*pf = results.f;
LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -269,16 +609,44 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in_z LPCWSTR wzMessage
)
{
+ HRESULT hr = S_OK;
BAENGINE_LOG_ARGS args = { };
BAENGINE_LOG_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.level = level;
args.wzMessage = wzMessage;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Log args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.level);
+ ExitOnFailure(hr, "Failed to write level of Log args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzMessage);
+ ExitOnFailure(hr, "Failed to write message of Log args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Log results.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_LOG, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_LOG, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA Log failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SendEmbeddedError(
@@ -291,21 +659,56 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_SENDEMBEDDEDERROR_ARGS args = { };
BAENGINE_SENDEMBEDDEDERROR_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
ExitOnNull(pnResult, hr, E_INVALIDARG, "pnResult is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.dwErrorCode = dwErrorCode;
args.wzMessage = wzMessage;
args.dwUIHint = dwUIHint;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SendEmbeddedError args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwErrorCode);
+ ExitOnFailure(hr, "Failed to write error code of SendEmbeddedError args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzMessage);
+ ExitOnFailure(hr, "Failed to write message of SendEmbeddedError args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwUIHint);
+ ExitOnFailure(hr, "Failed to write UI hint of SendEmbeddedError args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SendEmbeddedError results.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDERROR, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDERROR, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SendEmbeddedError failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read size from SendEmbeddedError results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, reinterpret_cast(&results.nResult));
+ ExitOnFailure(hr, "Failed to read result from SendEmbeddedError results.");
*pnResult = results.nResult;
LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -318,20 +721,52 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_SENDEMBEDDEDPROGRESS_ARGS args = { };
BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
ExitOnNull(pnResult, hr, E_INVALIDARG, "pnResult is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.dwProgressPercentage = dwProgressPercentage;
args.dwOverallProgressPercentage = dwOverallProgressPercentage;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SendEmbeddedProgress args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwProgressPercentage);
+ ExitOnFailure(hr, "Failed to write progress of SendEmbeddedProgress args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwOverallProgressPercentage);
+ ExitOnFailure(hr, "Failed to write overall progress of SendEmbeddedProgress args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SendEmbeddedProgress results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDPROGRESS, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SendEmbeddedProgress failed.");
+
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read size from SendEmbeddedProgress results.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDPROGRESS, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, reinterpret_cast(&results.nResult));
+ ExitOnFailure(hr, "Failed to read result from SendEmbeddedProgress results.");
*pnResult = results.nResult;
LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
@@ -340,22 +775,67 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in_z_opt LPCWSTR wzDownloadSource,
__in DWORD64 qwSize,
__in BOOTSTRAPPER_UPDATE_HASH_TYPE hashType,
- __in_z_opt LPCWSTR wzHash
+ __in_z_opt LPCWSTR wzHash,
+ __in_z_opt LPCWSTR wzUpdatePackageId
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETUPDATE_ARGS args = { };
BAENGINE_SETUPDATE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzLocalSource = wzLocalSource;
args.wzDownloadSource = wzDownloadSource;
args.qwSize = qwSize;
args.hashType = hashType;
args.wzHash = wzHash;
+ args.wzUpdatePackageId = wzUpdatePackageId;
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetUpdate args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzLocalSource);
+ ExitOnFailure(hr, "Failed to write local source of SetUpdate args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzDownloadSource);
+ ExitOnFailure(hr, "Failed to write download source of SetUpdate args.");
+
+ hr = BuffWriteNumber64ToBuffer(&bufferArgs, args.qwSize);
+ ExitOnFailure(hr, "Failed to write udpate size of SetUpdate args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, static_cast(args.hashType));
+ ExitOnFailure(hr, "Failed to write hash type of SetUpdate args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzHash);
+ ExitOnFailure(hr, "Failed to write hash of SetUpdate args.");
- results.cbSize = sizeof(results);
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzHash);
+ ExitOnFailure(hr, "Failed to write hash of SetUpdate args.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATE, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzUpdatePackageId);
+ ExitOnFailure(hr, "Failed to write update package id to SetUpdate args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetUpdate results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetUpdate failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SetLocalSource(
@@ -364,17 +844,48 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in_z LPCWSTR wzPath
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETLOCALSOURCE_ARGS args = { };
BAENGINE_SETLOCALSOURCE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzPackageOrContainerId = wzPackageOrContainerId;
args.wzPayloadId = wzPayloadId;
args.wzPath = wzPath;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetLocalSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPackageOrContainerId);
+ ExitOnFailure(hr, "Failed to write package or container id of SetLocalSource args.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETLOCALSOURCE, &args, &results, m_pvBAEngineProcContext);
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPayloadId);
+ ExitOnFailure(hr, "Failed to write payload id of SetLocalSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPath);
+ ExitOnFailure(hr, "Failed to write path of SetLocalSource args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetLocalSource results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETLOCALSOURCE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetLocalSource failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SetDownloadSource(
@@ -382,22 +893,64 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in_z_opt LPCWSTR wzPayloadId,
__in_z LPCWSTR wzUrl,
__in_z_opt LPCWSTR wzUser,
- __in_z_opt LPCWSTR wzPassword
+ __in_z_opt LPCWSTR wzPassword,
+ __in_z_opt LPCWSTR wzAuthorizationHeader
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETDOWNLOADSOURCE_ARGS args = { };
BAENGINE_SETDOWNLOADSOURCE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzPackageOrContainerId = wzPackageOrContainerId;
args.wzPayloadId = wzPayloadId;
args.wzUrl = wzUrl;
args.wzUser = wzUser;
args.wzPassword = wzPassword;
+ args.wzAuthorizationHeader = wzAuthorizationHeader;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETDOWNLOADSOURCE, &args, &results, m_pvBAEngineProcContext);
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetDownloadSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPackageOrContainerId);
+ ExitOnFailure(hr, "Failed to write package or container id of SetDownloadSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPayloadId);
+ ExitOnFailure(hr, "Failed to write payload id of SetDownloadSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzUrl);
+ ExitOnFailure(hr, "Failed to write url of SetDownloadSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzUser);
+ ExitOnFailure(hr, "Failed to write user of SetDownloadSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPassword);
+ ExitOnFailure(hr, "Failed to write password of SetDownloadSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzAuthorizationHeader);
+ ExitOnFailure(hr, "Failed to write authorization header of SetDownloadSource args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetDownloadSource results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETDOWNLOADSOURCE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetDownloadSource failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SetVariableNumeric(
@@ -405,16 +958,44 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in LONGLONG llValue
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETVARIABLENUMERIC_ARGS args = { };
BAENGINE_SETVARIABLENUMERIC_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVariable = wzVariable;
args.llValue = llValue;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetVariableNumeric args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable of SetVariableNumeric args.");
+
+ hr = BuffWriteNumber64ToBuffer(&bufferArgs, static_cast(args.llValue));
+ ExitOnFailure(hr, "Failed to write value of SetVariableNumeric args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetVariableNumeric results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLENUMERIC, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetVariableNumeric failed.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLENUMERIC, &args, &results, m_pvBAEngineProcContext);
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SetVariableString(
@@ -423,17 +1004,48 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in BOOL fFormatted
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETVARIABLESTRING_ARGS args = { };
BAENGINE_SETVARIABLESTRING_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVariable = wzVariable;
args.wzValue = wzValue;
args.fFormatted = fFormatted;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetVariableString args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable of SetVariableString args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzValue);
+ ExitOnFailure(hr, "Failed to write value of SetVariableString args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.fFormatted);
+ ExitOnFailure(hr, "Failed to write formatted flag of SetVariableString args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetVariableString results.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLESTRING, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLESTRING, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetVariableString failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SetVariableVersion(
@@ -441,103 +1053,278 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in_z_opt LPCWSTR wzValue
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETVARIABLEVERSION_ARGS args = { };
BAENGINE_SETVARIABLEVERSION_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVariable = wzVariable;
args.wzValue = wzValue;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetVariableVersion args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVariable);
+ ExitOnFailure(hr, "Failed to write variable of SetVariableVersion args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzValue);
+ ExitOnFailure(hr, "Failed to write value of SetVariableVersion args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetVariableVersion results.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLEVERSION, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLEVERSION, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetVariableVersion failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP CloseSplashScreen()
{
+ HRESULT hr = S_OK;
BAENGINE_CLOSESPLASHSCREEN_ARGS args = { };
BAENGINE_CLOSESPLASHSCREEN_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of CloseSplashScreen args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of CloseSplashScreen results.");
- args.cbSize = sizeof(args);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_CLOSESPLASHSCREEN, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA CloseSplashScreen failed.");
- results.cbSize = sizeof(results);
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_CLOSESPLASHSCREEN, &args, &results, m_pvBAEngineProcContext);
+ return hr;
}
virtual STDMETHODIMP Detect(
__in_opt HWND hwndParent
)
{
+ HRESULT hr = S_OK;
BAENGINE_DETECT_ARGS args = { };
BAENGINE_DETECT_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ args.hwndParent = reinterpret_cast(hwndParent);
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
- args.cbSize = sizeof(args);
- args.hwndParent = hwndParent;
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Detect args.");
- results.cbSize = sizeof(results);
+ hr = BuffWriteNumber64ToBuffer(&bufferArgs, args.hwndParent);
+ ExitOnFailure(hr, "Failed to write parent window of Detect args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Detect results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_DETECT, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA Detect failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_DETECT, &args, &results, m_pvBAEngineProcContext);
+ return hr;
}
virtual STDMETHODIMP Plan(
__in BOOTSTRAPPER_ACTION action
)
{
+ HRESULT hr = S_OK;
BAENGINE_PLAN_ARGS args = { };
BAENGINE_PLAN_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.action = action;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Plan args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, static_cast(args.action));
+ ExitOnFailure(hr, "Failed to write parent window of Plan args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Plan results.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_PLAN, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_PLAN, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA Plan failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP Elevate(
__in_opt HWND hwndParent
)
{
+ HRESULT hr = S_OK;
BAENGINE_ELEVATE_ARGS args = { };
BAENGINE_ELEVATE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ args.hwndParent = reinterpret_cast(hwndParent);
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Elevate args.");
- args.cbSize = sizeof(args);
- args.hwndParent = hwndParent;
+ hr = BuffWriteNumber64ToBuffer(&bufferArgs, args.hwndParent);
+ ExitOnFailure(hr, "Failed to write parent window of Elevate args.");
- results.cbSize = sizeof(results);
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Elevate results.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_ELEVATE, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_ELEVATE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA Elevate failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP Apply(
__in HWND hwndParent
)
{
+ HRESULT hr = S_OK;
BAENGINE_APPLY_ARGS args = { };
BAENGINE_APPLY_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ args.hwndParent = reinterpret_cast(hwndParent);
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Apply args.");
+
+ hr = BuffWriteNumber64ToBuffer(&bufferArgs, args.hwndParent);
+ ExitOnFailure(hr, "Failed to write parent window of Apply args.");
- args.cbSize = sizeof(args);
- args.hwndParent = hwndParent;
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Apply results.");
- results.cbSize = sizeof(results);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_APPLY, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA Apply failed.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_APPLY, &args, &results, m_pvBAEngineProcContext);
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP Quit(
__in DWORD dwExitCode
)
{
+ HRESULT hr = S_OK;
BAENGINE_QUIT_ARGS args = { };
BAENGINE_QUIT_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.dwExitCode = dwExitCode;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_QUIT, &args, &results, m_pvBAEngineProcContext);
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Quit args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwExitCode);
+ ExitOnFailure(hr, "Failed to write exit code of Quit args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of Quit results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_QUIT, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA Quit failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP LaunchApprovedExe(
@@ -547,33 +1334,101 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
__in DWORD dwWaitForInputIdleTimeout
)
{
+ HRESULT hr = S_OK;
BAENGINE_LAUNCHAPPROVEDEXE_ARGS args = { };
BAENGINE_LAUNCHAPPROVEDEXE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+
+ ExitOnNull(wzApprovedExeForElevationId, hr, E_INVALIDARG, "wzApprovedExeForElevationId is required");
- args.cbSize = sizeof(args);
- args.hwndParent = hwndParent;
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+ args.hwndParent = reinterpret_cast(hwndParent);
args.wzApprovedExeForElevationId = wzApprovedExeForElevationId;
args.wzArguments = wzArguments;
args.dwWaitForInputIdleTimeout = dwWaitForInputIdleTimeout;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE, &args, &results, m_pvBAEngineProcContext);
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of LaunchApprovedExe args.");
+
+ hr = BuffWriteNumber64ToBuffer(&bufferArgs, args.hwndParent);
+ ExitOnFailure(hr, "Failed to write parent window of LaunchApprovedExe args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzApprovedExeForElevationId);
+ ExitOnFailure(hr, "Failed to write approved exe elevation id of LaunchApprovedExe args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzArguments);
+ ExitOnFailure(hr, "Failed to write arguments of LaunchApprovedExe args.");
+
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwWaitForInputIdleTimeout);
+ ExitOnFailure(hr, "Failed to write wait for idle input timeout of LaunchApprovedExe args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of LaunchApprovedExe results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA LaunchApprovedExe failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP SetUpdateSource(
- __in_z LPCWSTR wzUrl
+ __in_z LPCWSTR wzUrl,
+ __in_z_opt LPCWSTR wzAuthorizationHeader
)
{
+ HRESULT hr = S_OK;
BAENGINE_SETUPDATESOURCE_ARGS args = { };
BAENGINE_SETUPDATESOURCE_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+
+ ExitOnNull(wzUrl, hr, E_INVALIDARG, "wzUrl is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzUrl = wzUrl;
+ args.wzAuthorizationHeader = wzAuthorizationHeader;
+
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetUpdateSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzUrl);
+ ExitOnFailure(hr, "Failed to write url of SetUpdateSource args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzAuthorizationHeader);
+ ExitOnFailure(hr, "Failed to write authorization header of SetUpdateSource args.");
- results.cbSize = sizeof(results);
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of SetUpdateSource results.");
- return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATESOURCE, &args, &results, m_pvBAEngineProcContext);
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATESOURCE, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA SetUpdateSource failed.");
+
+ LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
+ return hr;
}
virtual STDMETHODIMP CompareVersions(
@@ -585,66 +1440,133 @@ class CBalBootstrapperEngine : public IBootstrapperEngine
HRESULT hr = S_OK;
BAENGINE_COMPAREVERSIONS_ARGS args = { };
BAENGINE_COMPAREVERSIONS_RESULTS results = { };
+ BUFF_BUFFER bufferArgs = { };
+ BUFF_BUFFER bufferResults = { };
+ PIPE_RPC_RESULT rpc = { };
+ SIZE_T iBuffer = 0;
ExitOnNull(pnResult, hr, E_INVALIDARG, "pnResult is required");
- args.cbSize = sizeof(args);
+ // Init send structs.
+ args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
args.wzVersion1 = wzVersion1;
args.wzVersion2 = wzVersion2;
- results.cbSize = sizeof(results);
+ results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION;
+
+ // Send args.
+ hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of CompareVersions args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVersion1);
+ ExitOnFailure(hr, "Failed to write first input of CompareVersions args.");
+
+ hr = BuffWriteStringToBuffer(&bufferArgs, args.wzVersion2);
+ ExitOnFailure(hr, "Failed to write second input of CompareVersions args.");
+
+ // Send results.
+ hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to write API version of CompareVersions results.");
+
+ // Get results.
+ hr = SendRequest(BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS, &bufferArgs, &bufferResults, &rpc);
+ ExitOnFailure(hr, "BA CompareVersions failed.");
- hr = m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS, &args, &results, m_pvBAEngineProcContext);
+ // Read results.
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, &results.dwApiVersion);
+ ExitOnFailure(hr, "Failed to read size from CompareVersions results.");
+
+ hr = BuffReadNumber(rpc.pbData, rpc.cbData, &iBuffer, reinterpret_cast(&results.nResult));
+ ExitOnFailure(hr, "Failed to read result from CompareVersions results.");
*pnResult = results.nResult;
LExit:
+ PipeFreeRpcResult(&rpc);
+ ReleaseBuffer(bufferResults);
+ ReleaseBuffer(bufferArgs);
+
return hr;
}
-public:
- HRESULT Init()
+private:
+ HRESULT SendRequest(
+ __in DWORD dwMessageType,
+ __in BUFF_BUFFER* pBufferArgs,
+ __in BUFF_BUFFER* pBufferResults,
+ __in PIPE_RPC_RESULT* pRpc
+ )
{
- return ::CoCreateFreeThreadedMarshaler(this, &m_pFreeThreadedMarshaler);
+ HRESULT hr = S_OK;
+ BUFF_BUFFER buffer = { };
+
+ hr = CombineArgsAndResults(pBufferArgs, pBufferResults, &buffer);
+ if (SUCCEEDED(hr))
+ {
+ hr = PipeRpcRequest(&m_hRpcPipe, dwMessageType, buffer.pbData, buffer.cbData, pRpc);
+ }
+
+ ReleaseBuffer(buffer);
+ return hr;
}
+ HRESULT CombineArgsAndResults(
+ __in BUFF_BUFFER* pBufferArgs,
+ __in BUFF_BUFFER* pBufferResults,
+ __in BUFF_BUFFER* pBufferCombined
+ )
+ {
+ HRESULT hr = S_OK;
+
+ // Write args to buffer.
+ hr = BuffWriteStreamToBuffer(pBufferCombined, pBufferArgs->pbData, pBufferArgs->cbData);
+ ExitOnFailure(hr, "Failed to write args buffer.");
+
+ // Write results to buffer.
+ hr = BuffWriteStreamToBuffer(pBufferCombined, pBufferResults->pbData, pBufferResults->cbData);
+ ExitOnFailure(hr, "Failed to write results buffer.");
+
+ LExit:
+ return hr;
+ }
+
+public:
CBalBootstrapperEngine(
- __in PFN_BOOTSTRAPPER_ENGINE_PROC pfnBAEngineProc,
- __in_opt LPVOID pvBAEngineProcContext
+ __in HANDLE hPipe,
+ __out HRESULT* phr
)
{
m_cReferences = 1;
- m_pfnBAEngineProc = pfnBAEngineProc;
- m_pvBAEngineProcContext = pvBAEngineProcContext;
- m_pFreeThreadedMarshaler = NULL;
+
+ PipeRpcInitialize(&m_hRpcPipe, hPipe, FALSE);
+
+ *phr = ::CoCreateFreeThreadedMarshaler(this, &m_pFreeThreadedMarshaler);
}
~CBalBootstrapperEngine()
{
+ PipeRpcUninitiailize(&m_hRpcPipe);
ReleaseObject(m_pFreeThreadedMarshaler);
}
private:
long m_cReferences;
- PFN_BOOTSTRAPPER_ENGINE_PROC m_pfnBAEngineProc;
- LPVOID m_pvBAEngineProcContext;
+ PIPE_RPC_HANDLE m_hRpcPipe;
IUnknown* m_pFreeThreadedMarshaler;
};
+
HRESULT BalBootstrapperEngineCreate(
- __in PFN_BOOTSTRAPPER_ENGINE_PROC pfnBAEngineProc,
- __in_opt LPVOID pvBAEngineProcContext,
+ __in HANDLE hPipe,
__out IBootstrapperEngine** ppBootstrapperEngine
)
{
HRESULT hr = S_OK;
CBalBootstrapperEngine* pBootstrapperEngine = NULL;
- pBootstrapperEngine = new CBalBootstrapperEngine(pfnBAEngineProc, pvBAEngineProcContext);
+ pBootstrapperEngine = new CBalBootstrapperEngine(hPipe, &hr);
ExitOnNull(pBootstrapperEngine, hr, E_OUTOFMEMORY, "Failed to allocate new BalBootstrapperEngine object.");
-
- hr = pBootstrapperEngine->Init();
- ExitOnFailure(hr, "Failed to initialize CBalBootstrapperEngine.");
+ ExitOnFailure(hr, "Failed to initialize BalBootstrapperEngine.");
hr = pBootstrapperEngine->QueryInterface(IID_PPV_ARGS(ppBootstrapperEngine));
ExitOnFailure(hr, "Failed to QI for IBootstrapperEngine from BalBootstrapperEngine object.");
diff --git a/src/api/burn/balutil/inc/BalBootstrapperEngine.h b/src/api/burn/balutil/BalBootstrapperEngine.h
similarity index 60%
rename from src/api/burn/balutil/inc/BalBootstrapperEngine.h
rename to src/api/burn/balutil/BalBootstrapperEngine.h
index 45131d983..b3bd4ca76 100644
--- a/src/api/burn/balutil/inc/BalBootstrapperEngine.h
+++ b/src/api/burn/balutil/BalBootstrapperEngine.h
@@ -1,17 +1,7 @@
+#pragma once
// 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.
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// function declarations
-
HRESULT BalBootstrapperEngineCreate(
- __in PFN_BOOTSTRAPPER_ENGINE_PROC pfnBAEngineProc,
- __in_opt LPVOID pvBAEngineProcContext,
+ __in HANDLE hEnginePipe,
__out IBootstrapperEngine** ppEngineForApplication
);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/api/burn/balutil/balinfo.cpp b/src/api/burn/balutil/balinfo.cpp
index 751ba4f14..6f609a400 100644
--- a/src/api/burn/balutil/balinfo.cpp
+++ b/src/api/burn/balutil/balinfo.cpp
@@ -223,7 +223,6 @@ DAPI_(HRESULT) BalInfoAddRelatedBundleAsPackage(
DAPI_(HRESULT) BalInfoAddUpdateBundleAsPackage(
__in BAL_INFO_PACKAGES* pPackages,
__in_z LPCWSTR wzId,
- __in_z LPCWSTR /*wzPreviousId*/,
__out_opt BAL_INFO_PACKAGE** ppPackage
)
{
@@ -356,7 +355,7 @@ DAPI_(HRESULT) BalSetOverridableVariablesFromEngine(
LPCWSTR wzVariableValue = pCommand->rgVariableValues[i];
hr = DictGetValue(pOverridableVariables->sdVariables, wzVariableName, reinterpret_cast(&pOverridableVariable));
- if (E_NOTFOUND == hr)
+ if (E_NOTFOUND == hr || E_INVALIDARG == hr)
{
BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to set non-overridable variable: '%ls'.", wzVariableName);
hr = S_OK;
@@ -549,16 +548,16 @@ static HRESULT ParseBalPackageInfoFromXml(
}
ExitOnFailure(hr, "Failed to parse all WixBalPackageInfo elements.");
- hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixMbaPrereqInformation", &pNodeList);
+ hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixPrereqInformation", &pNodeList);
ExitOnFailure(hr, "Failed to select all packages.");
while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
{
hr = XmlGetAttributeEx(pNode, L"PackageId", &scz);
- ExitOnRequiredXmlQueryFailure(hr, "Failed to get package identifier for WixMbaPrereqInformation.");
+ ExitOnRequiredXmlQueryFailure(hr, "Failed to get package identifier for WixPrereqInformation.");
hr = BalInfoFindPackageById(pPackages, scz, &pPackage);
- ExitOnFailure(hr, "Failed to find package specified in WixMbaPrereqInformation: %ls", scz);
+ ExitOnFailure(hr, "Failed to find package specified in WixPrereqInformation: %ls", scz);
pPackage->fPrereqPackage = TRUE;
@@ -570,7 +569,7 @@ static HRESULT ParseBalPackageInfoFromXml(
ReleaseNullObject(pNode);
}
- ExitOnFailure(hr, "Failed to parse all WixMbaPrereqInformation elements.");
+ ExitOnFailure(hr, "Failed to parse all WixPrereqInformation elements.");
if (S_FALSE == hr)
{
diff --git a/src/api/burn/balutil/balutil.cpp b/src/api/burn/balutil/balutil.cpp
index 2d80878c4..a77ff7d0e 100644
--- a/src/api/burn/balutil/balutil.cpp
+++ b/src/api/burn/balutil/balutil.cpp
@@ -3,8 +3,39 @@
#include "precomp.h"
const DWORD VARIABLE_GROW_FACTOR = 80;
+static DWORD vdwDebuggerCheck = 0;
static IBootstrapperEngine* vpEngine = NULL;
+static HRESULT ParseCommandLine(
+ __inout_z LPWSTR *psczPipeBaseName,
+ __inout_z LPWSTR *psczPipeSecret,
+ __out DWORD64 *pqwEngineAPIVersion
+ );
+static HRESULT ConnectToEngine(
+ __in_z LPCWSTR wzPipeBaseName,
+ __in_z LPCWSTR wzPipeSecret,
+ __out HANDLE *phBAPipe,
+ __out HANDLE *phEnginePipe
+ );
+static HRESULT ConnectAndVerify(
+ __in_z LPCWSTR wzPipeName,
+ __in_z LPCWSTR wzPipeSecret,
+ __in DWORD cbPipeSecret,
+ __out HANDLE *phPipe
+ );
+static HRESULT PumpMessages(
+ __in HANDLE hPipe,
+ __in IBootstrapperApplication* pApplication,
+ __in IBootstrapperEngine* pEngine
+ );
+static void MsgProc(
+ __in BOOTSTRAPPER_APPLICATION_MESSAGE messageType,
+ __in_bcount(cbData) LPVOID pvData,
+ __in DWORD cbData,
+ __in IBootstrapperApplication* pApplication,
+ __in IBootstrapperEngine* pEngine
+ );
+
// prototypes
DAPI_(void) BalInitialize(
@@ -17,38 +48,136 @@ DAPI_(void) BalInitialize(
vpEngine = pEngine;
}
-DAPI_(HRESULT) BalInitializeFromCreateArgs(
- __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
- __out_opt IBootstrapperEngine** ppEngine
+DAPI_(void) BalUninitialize()
+{
+ ReleaseNullObject(vpEngine);
+}
+
+DAPI_(HRESULT) BootstrapperApplicationRun(
+ __in IBootstrapperApplication* pApplication
)
{
HRESULT hr = S_OK;
+ BOOL fComInitialized = FALSE;
+ DWORD64 qwEngineAPIVersion = 0;
+ LPWSTR sczPipeBaseName = NULL;
+ LPWSTR sczPipeSecret = NULL;
+ HANDLE hBAPipe = INVALID_HANDLE_VALUE;
+ HANDLE hEnginePipe = INVALID_HANDLE_VALUE;
IBootstrapperEngine* pEngine = NULL;
+ BOOL fInitializedBal = FALSE;
+
+ // initialize COM
+ hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ ExitOnFailure(hr, "Failed to initialize COM.");
+ fComInitialized = TRUE;
+
+ hr = ParseCommandLine(&sczPipeBaseName, &sczPipeSecret, &qwEngineAPIVersion);
+ BalExitOnFailure(hr, "Failed to parse command line.");
- hr = BalBootstrapperEngineCreate(pArgs->pfnBootstrapperEngineProc, pArgs->pvBootstrapperEngineProcContext, &pEngine);
- ExitOnFailure(hr, "Failed to create BalBootstrapperEngine.");
+ // TODO: Validate the engine API version.
+
+ hr = ConnectToEngine(sczPipeBaseName, sczPipeSecret, &hBAPipe, &hEnginePipe);
+ BalExitOnFailure(hr, "Failed to connect to engine.");
+
+ hr = BalBootstrapperEngineCreate(hEnginePipe, &pEngine);
+ BalExitOnFailure(hr, "Failed to create bootstrapper engine.");
BalInitialize(pEngine);
+ fInitializedBal = TRUE;
+
+ BootstrapperApplicationDebuggerCheck();
- if (ppEngine)
+ hr = MsgPump(hBAPipe, pApplication, pEngine);
+ BalExitOnFailure(hr, "Failed while pumping messages.");
+
+LExit:
+ if (fInitializedBal)
{
- *ppEngine = pEngine;
+ BalUninitialize();
}
- pEngine = NULL;
-LExit:
- ReleaseObject(pEngine);
+ ReleaseNullObject(pEngine);
+ ReleasePipeHandle(hEnginePipe);
+ ReleasePipeHandle(hBAPipe);
+ ReleaseStr(sczPipeSecret);
+ ReleaseStr(sczPipeBaseName);
+
+ if (fComInitialized)
+ {
+ ::CoUninitialize();
+ }
return hr;
}
-
-DAPI_(void) BalUninitialize()
+DAPI_(VOID) BootstrapperApplicationDebuggerCheck()
{
- ReleaseNullObject(vpEngine);
+ HRESULT hr = S_OK;
+ HKEY hk = NULL;
+ BOOL fDebug = FALSE;
+ LPWSTR sczDebugBootstrapperApplications = NULL;
+ LPWSTR sczDebugBootstrapperApplication = NULL;
+ LPWSTR sczModulePath = NULL;
+ LPCWSTR wzModuleFilename = NULL;
+ WCHAR wzMessage[1024] = { };
+
+ if (0 == vdwDebuggerCheck)
+ {
+ ++vdwDebuggerCheck;
+
+ hr = RegOpen(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Control\\Session Manager\\Environment", KEY_QUERY_VALUE, &hk);
+ if (SUCCEEDED(hr))
+ {
+ hr = RegReadString(hk, L"WixDebugBootstrapperApplications", &sczDebugBootstrapperApplications);
+ if (SUCCEEDED(hr) && sczDebugBootstrapperApplications && *sczDebugBootstrapperApplications &&
+ sczDebugBootstrapperApplications[0] != L'0' && !sczDebugBootstrapperApplications[1])
+ {
+ hr = PathForCurrentProcess(&sczModulePath, NULL);
+ if (SUCCEEDED(hr) && sczModulePath && *sczModulePath)
+ {
+ wzModuleFilename = PathFile(sczModulePath);
+ if (wzModuleFilename)
+ {
+ fDebug = TRUE;
+ }
+ }
+ }
+ else
+ {
+ hr = RegReadString(hk, L"WixDebugBootstrapperApplication", &sczDebugBootstrapperApplication);
+ if (SUCCEEDED(hr) && sczDebugBootstrapperApplication && *sczDebugBootstrapperApplication)
+ {
+ hr = PathForCurrentProcess(&sczModulePath, NULL);
+ if (SUCCEEDED(hr) && sczModulePath && *sczModulePath)
+ {
+ wzModuleFilename = PathFile(sczModulePath);
+ if (wzModuleFilename && CSTR_EQUAL == ::CompareStringOrdinal(sczDebugBootstrapperApplication, -1, wzModuleFilename, -1, TRUE))
+ {
+ fDebug = TRUE;
+ }
+ }
+ }
+ }
+
+ if (fDebug)
+ {
+ hr = ::StringCchPrintfW(wzMessage, countof(wzMessage), L"To debug the boostrapper application process %ls\n\nSet breakpoints and attach a debugger to process id: %d (0x%x)", wzModuleFilename, ::GetCurrentProcessId(), ::GetCurrentProcessId());
+
+ if (SUCCEEDED(hr))
+ {
+ ::MessageBoxW(NULL, wzMessage, L"WiX Bootstrapper Application", MB_SERVICE_NOTIFICATION | MB_TOPMOST | MB_ICONQUESTION | MB_OK | MB_SYSTEMMODAL);
+ }
+ }
+ }
+ }
+
+ ReleaseRegKey(hk);
+ ReleaseStr(sczModulePath);
+ ReleaseStr(sczDebugBootstrapperApplication);
+ ReleaseStr(sczDebugBootstrapperApplications);
}
-
DAPI_(HRESULT) BalManifestLoad(
__in HMODULE hBootstrapperApplicationModule,
__out IXMLDOMDocument** ppixdManifest
@@ -671,3 +800,146 @@ DAPI_(HRESULT) BalLogIdArgs(
return hr;
}
+
+
+static HRESULT ParseCommandLine(
+ __inout_z LPWSTR *psczPipeBaseName,
+ __inout_z LPWSTR *psczPipeSecret,
+ __out DWORD64 *pqwEngineAPIVersion
+ )
+{
+ HRESULT hr = S_OK;
+ LPWSTR wzCommandLine = ::GetCommandLineW();
+ int argc = 0;
+ LPWSTR* argv = NULL;
+
+ *pqwEngineAPIVersion = 0;
+
+ hr = AppParseCommandLine(wzCommandLine, &argc, &argv);
+ ExitOnFailure(hr, "Failed to parse command line.");
+
+ // Skip the executable full path in argv[0].
+ for (int i = 1; i < argc; ++i)
+ {
+ if (argv[i][0] == L'-')
+ {
+ if (CSTR_EQUAL == ::CompareStringOrdinal(&argv[i][1], -1, BOOTSTRAPPER_APPLICATION_COMMANDLINE_SWITCH_API_VERSION, -1, TRUE))
+ {
+ if (i + 1 >= argc)
+ {
+ BalExitOnRootFailure(hr = E_INVALIDARG, "Must specify an api version.");
+ }
+
+ ++i;
+
+ hr = StrStringToUInt64(argv[i], 0, pqwEngineAPIVersion);
+ BalExitOnFailure(hr, "Failed to parse api version: %ls", argv[i]);
+ }
+ else if (CSTR_EQUAL == ::CompareStringOrdinal(&argv[i][1], -1, BOOTSTRAPPER_APPLICATION_COMMANDLINE_SWITCH_PIPE_NAME, -1, TRUE))
+ {
+ if (i + 2 >= argc)
+ {
+ BalExitOnRootFailure(hr = E_INVALIDARG, "Must specify a pipe name and pipe secret.");
+ }
+
+ ++i;
+
+ hr = StrAllocString(psczPipeBaseName, argv[i], 0);
+ BalExitOnFailure(hr, "Failed to copy pipe name.");
+
+ ++i;
+
+ hr = StrAllocString(psczPipeSecret, argv[i], 0);
+ BalExitOnFailure(hr, "Failed to copy pipe secret.");
+ }
+ }
+ else
+ {
+ BalExitWithRootFailure(hr, E_INVALIDARG, "Invalid argument: %ls", argv[i]);
+ }
+ }
+
+LExit:
+ if (argv)
+ {
+ AppFreeCommandLineArgs(argv);
+ }
+
+ return hr;
+}
+
+static HRESULT ConnectToEngine(
+ __in_z LPCWSTR wzPipeBaseName,
+ __in_z LPCWSTR wzPipeSecret,
+ __out HANDLE *phBAPipe,
+ __out HANDLE *phEnginePipe
+ )
+{
+ HRESULT hr = S_OK;
+ LPWSTR sczBAPipeName = NULL;
+ LPWSTR sczEnginePipeName = NULL;
+ HANDLE hBAPipe = INVALID_HANDLE_VALUE;
+ HANDLE hEnginePipe = INVALID_HANDLE_VALUE;
+
+ DWORD cbPipeSecret = lstrlenW(wzPipeSecret) * sizeof(WCHAR);
+
+ hr = StrAllocFormatted(&sczBAPipeName, L"%ls%ls", wzPipeBaseName, L".BA");
+ ExitOnFailure(hr, "Failed to allocate BA pipe name.");
+
+ hr = StrAllocFormatted(&sczEnginePipeName, L"%ls%ls", wzPipeBaseName, L".BAEngine");
+ ExitOnFailure(hr, "Failed to allocate BA engine pipe name.");
+
+ hr = ConnectAndVerify(sczBAPipeName, wzPipeSecret, cbPipeSecret, &hBAPipe);
+ BalExitOnFailure(hr, "Failed to connect to bootstrapper application pipe.");
+
+ hr = ConnectAndVerify(sczEnginePipeName, wzPipeSecret, cbPipeSecret, &hEnginePipe);
+ BalExitOnFailure(hr, "Failed to connect to engine pipe.");
+
+ *phBAPipe = hBAPipe;
+ hBAPipe = INVALID_HANDLE_VALUE;
+
+ *phEnginePipe = hEnginePipe;
+ hEnginePipe = INVALID_HANDLE_VALUE;
+
+LExit:
+ ReleasePipeHandle(hEnginePipe);
+ ReleasePipeHandle(hBAPipe);
+ ReleaseStr(sczEnginePipeName);
+ ReleaseStr(sczBAPipeName);
+
+ return hr;
+}
+
+static HRESULT ConnectAndVerify(
+ __in_z LPCWSTR wzPipeName,
+ __in_z LPCWSTR wzPipeSecret,
+ __in DWORD cbPipeSecret,
+ __out HANDLE *phPipe
+ )
+{
+ HRESULT hr = S_OK;
+ HRESULT hrConnect = S_OK;
+ HANDLE hPipe = INVALID_HANDLE_VALUE;
+
+ hr = PipeClientConnect(wzPipeName, &hPipe);
+ BalExitOnFailure(hr, "Failed to connect to pipe.");
+
+ hr = FileWriteHandle(hPipe, reinterpret_cast(&cbPipeSecret), sizeof(cbPipeSecret));
+ BalExitOnFailure(hr, "Failed to write secret size to pipe.");
+
+ hr = FileWriteHandle(hPipe, reinterpret_cast(wzPipeSecret), cbPipeSecret);
+ BalExitOnFailure(hr, "Failed to write secret size to pipe.");
+
+ FileReadHandle(hPipe, reinterpret_cast(&hrConnect), sizeof(hrConnect));
+ BalExitOnFailure(hr, "Failed to read connect result from pipe.");
+
+ BalExitOnFailure(hrConnect, "Failed connect result from pipe.");
+
+ *phPipe = hPipe;
+ hPipe = INVALID_HANDLE_VALUE;
+
+LExit:
+ ReleasePipeHandle(hPipe);
+
+ return hr;
+}
diff --git a/src/api/burn/balutil/balutil.vcxproj b/src/api/burn/balutil/balutil.vcxproj
index d5cd146b8..8f93d636e 100644
--- a/src/api/burn/balutil/balutil.vcxproj
+++ b/src/api/burn/balutil/balutil.vcxproj
@@ -53,6 +53,7 @@
+
@@ -61,23 +62,23 @@
Create
+
-
-
-
+
+
diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h
index 4a0b85997..7908a74ca 100644
--- a/src/api/burn/balutil/inc/BAFunctions.h
+++ b/src/api/burn/balutil/inc/BAFunctions.h
@@ -1,6 +1,7 @@
#pragma once
// 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 "IBootstrapperEngine.h"
#ifdef __cplusplus
extern "C" {
@@ -9,12 +10,14 @@ extern "C" {
// The first 1024 messages are reserved so that the BA messages have the same value here.
enum BA_FUNCTIONS_MESSAGE
{
+ BA_FUNCTIONS_MESSAGE_ONCREATE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCREATE,
+ BA_FUNCTIONS_MESSAGE_ONDESTROY = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDESTROY,
+ BA_FUNCTIONS_MESSAGE_ONSTARTUP = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP,
+ BA_FUNCTIONS_MESSAGE_ONSHUTDOWN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN,
BA_FUNCTIONS_MESSAGE_ONDETECTBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN,
BA_FUNCTIONS_MESSAGE_ONDETECTCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE,
BA_FUNCTIONS_MESSAGE_ONPLANBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN,
BA_FUNCTIONS_MESSAGE_ONPLANCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE,
- BA_FUNCTIONS_MESSAGE_ONSTARTUP = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP,
- BA_FUNCTIONS_MESSAGE_ONSHUTDOWN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN,
BA_FUNCTIONS_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE,
BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN,
BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE,
@@ -81,8 +84,6 @@ enum BA_FUNCTIONS_MESSAGE
BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE,
BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS,
BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY = BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY,
- BA_FUNCTIONS_MESSAGE_ONSETUPDATEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATEBEGIN,
- BA_FUNCTIONS_MESSAGE_ONSETUPDATECOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATECOMPLETE,
BA_FUNCTIONS_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE,
BA_FUNCTIONS_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN,
BA_FUNCTIONS_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE,
@@ -117,7 +118,8 @@ struct BA_FUNCTIONS_CREATE_ARGS
{
DWORD cbSize;
DWORD64 qwBAFunctionsAPIVersion;
- BOOTSTRAPPER_CREATE_ARGS* pBootstrapperCreateArgs;
+ IBootstrapperEngine* pEngine;
+ BOOTSTRAPPER_COMMAND* pCommand;
};
struct BA_FUNCTIONS_CREATE_RESULTS
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h
index 6ad109c35..33b71324a 100644
--- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h
+++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h
@@ -1,16 +1,12 @@
#pragma once
// 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
#include
-#include "BAFunctions.h"
+#include
+
#include "IBAFunctions.h"
-#include "BootstrapperEngine.h"
-#include "BootstrapperApplication.h"
-#include "IBootstrapperEngine.h"
-#include "IBootstrapperApplication.h"
class CBalBaseBAFunctions : public IBAFunctions
{
@@ -69,8 +65,7 @@ class CBalBaseBAFunctions : public IBAFunctions
virtual STDMETHODIMP_(HRESULT) BAProc(
__in BOOTSTRAPPER_APPLICATION_MESSAGE /*message*/,
__in const LPVOID /*pvArgs*/,
- __inout LPVOID /*pvResults*/,
- __in_opt LPVOID /*pvContext*/
+ __inout LPVOID /*pvResults*/
)
{
return E_NOTIMPL;
@@ -80,12 +75,31 @@ class CBalBaseBAFunctions : public IBAFunctions
__in BOOTSTRAPPER_APPLICATION_MESSAGE /*message*/,
__in const LPVOID /*pvArgs*/,
__inout LPVOID /*pvResults*/,
- __inout HRESULT* /*phr*/,
- __in_opt LPVOID /*pvContext*/
+ __inout HRESULT* /*phr*/
)
{
}
+ virtual STDMETHODIMP OnCreate(
+ __in IBootstrapperEngine* pEngine,
+ __in BOOTSTRAPPER_COMMAND* /*pCommand*/
+ )
+ {
+ HRESULT hr = S_OK;
+
+ pEngine->AddRef();
+ m_pEngine = pEngine;
+
+ return hr;
+ }
+
+ virtual STDMETHODIMP OnDestroy(
+ __in BOOL /*fReload*/
+ )
+ {
+ return S_OK;
+ }
+
virtual STDMETHODIMP OnStartup()
{
return S_OK;
@@ -837,20 +851,6 @@ class CBalBaseBAFunctions : public IBAFunctions
return S_OK;
}
- virtual STDMETHODIMP OnSetUpdateBegin()
- {
- return S_OK;
- }
-
- virtual STDMETHODIMP OnSetUpdateComplete(
- __in HRESULT /*hrStatus*/,
- __in_z_opt LPCWSTR /*wzPreviousPackageId*/,
- __in_z_opt LPCWSTR /*wzNewPackageId*/
- )
- {
- return S_OK;
- }
-
virtual STDMETHODIMP OnPlanRestoreRelatedBundle(
__in_z LPCWSTR /*wzBundleId*/,
__in BOOTSTRAPPER_REQUEST_STATE /*recommendedState*/,
@@ -996,22 +996,13 @@ class CBalBaseBAFunctions : public IBAFunctions
}
protected:
- CBalBaseBAFunctions(
- __in HMODULE hModule,
- __in IBootstrapperEngine* pEngine,
- __in const BA_FUNCTIONS_CREATE_ARGS* pArgs
- )
+ CBalBaseBAFunctions(HMODULE hModule)
{
m_cReferences = 1;
m_hModule = hModule;
- pEngine->AddRef();
- m_pEngine = pEngine;
- memcpy_s(&m_command, sizeof(m_command), pArgs->pBootstrapperCreateArgs->pCommand, sizeof(BOOTSTRAPPER_COMMAND));
- memcpy_s(&m_baCreateArgs, sizeof(m_baCreateArgs), pArgs->pBootstrapperCreateArgs, sizeof(BOOTSTRAPPER_CREATE_ARGS));
- memcpy_s(&m_bafCreateArgs, sizeof(m_bafCreateArgs), pArgs, sizeof(BA_FUNCTIONS_CREATE_ARGS));
- m_baCreateArgs.pCommand = &m_command;
- m_bafCreateArgs.pBootstrapperCreateArgs = &m_baCreateArgs;
+ m_hwndParent = NULL;
+ m_pEngine = NULL;
}
virtual ~CBalBaseBAFunctions()
@@ -1025,8 +1016,5 @@ class CBalBaseBAFunctions : public IBAFunctions
protected:
IBootstrapperEngine* m_pEngine;
HMODULE m_hModule;
- BA_FUNCTIONS_CREATE_ARGS m_bafCreateArgs;
- BOOTSTRAPPER_CREATE_ARGS m_baCreateArgs;
- BOOTSTRAPPER_COMMAND m_command;
HWND m_hwndParent;
};
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h
index 728bd2b56..65eeb0b47 100644
--- a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h
+++ b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h
@@ -1,191 +1,15 @@
#pragma once
// 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 "BalBaseBootstrapperApplicationProc.h"
-#include "BAFunctions.h"
-#include "IBAFunctions.h"
-
-static HRESULT BalBaseBAFunctionsProcOnThemeLoaded(
- __in IBAFunctions* pBAFunctions,
- __in BA_FUNCTIONS_ONTHEMELOADED_ARGS* pArgs,
- __inout BA_FUNCTIONS_ONTHEMELOADED_RESULTS* /*pResults*/
- )
-{
- return pBAFunctions->OnThemeLoaded(pArgs->hWnd);
-}
-
-static HRESULT BalBaseBAFunctionsProcWndProc(
- __in IBAFunctions* pBAFunctions,
- __in BA_FUNCTIONS_WNDPROC_ARGS* pArgs,
- __inout BA_FUNCTIONS_WNDPROC_RESULTS* pResults
- )
-{
- return pBAFunctions->WndProc(pArgs->hWnd, pArgs->uMsg, pArgs->wParam, pArgs->lParam, &pResults->fProcessed, &pResults->lResult);
-}
-
-static HRESULT BalBaseBAFunctionsProcOnThemeControlLoading(
- __in IBAFunctions* pBAFunctions,
- __in BA_FUNCTIONS_ONTHEMECONTROLLOADING_ARGS* pArgs,
- __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults
- )
-{
- return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId, &pResults->dwAutomaticBehaviorType);
-}
-
-static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand(
- __in IBAFunctions* pBAFunctions,
- __in BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS* pArgs,
- __inout BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_RESULTS* pResults
- )
-{
- return pBAFunctions->OnThemeControlWmCommand(pArgs->wParam, pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed, &pResults->lResult);
-}
-
-static HRESULT BalBaseBAFunctionsProcOnThemeControlWmNotify(
- __in IBAFunctions* pBAFunctions,
- __in BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_ARGS* pArgs,
- __inout BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_RESULTS* pResults
- )
-{
- return pBAFunctions->OnThemeControlWmNotify(pArgs->lParam, pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed, &pResults->lResult);
-}
-
-static HRESULT BalBaseBAFunctionsProcOnThemeControlLoaded(
- __in IBAFunctions* pBAFunctions,
- __in BA_FUNCTIONS_ONTHEMECONTROLLOADED_ARGS* pArgs,
- __inout BA_FUNCTIONS_ONTHEMECONTROLLOADED_RESULTS* pResults
- )
-{
- return pBAFunctions->OnThemeControlLoaded(pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed);
-}
-
/*******************************************************************
BalBaseBAFunctionsProc - requires pvContext to be of type IBAFunctions.
Provides a default mapping between the message based BAFunctions interface and
the COM-based BAFunctions interface.
*******************************************************************/
-static HRESULT WINAPI BalBaseBAFunctionsProc(
+HRESULT WINAPI BalBaseBAFunctionsProc(
__in BA_FUNCTIONS_MESSAGE message,
__in const LPVOID pvArgs,
__inout LPVOID pvResults,
__in_opt LPVOID pvContext
- )
-{
- IBAFunctions* pBAFunctions = reinterpret_cast(pvContext);
- HRESULT hr = pBAFunctions->BAFunctionsProc(message, pvArgs, pvResults, pvContext);
-
- if (E_NOTIMPL == hr)
- {
- switch (message)
- {
- case BA_FUNCTIONS_MESSAGE_ONDETECTBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONDETECTCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPLANBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONPLANCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONSTARTUP:
- case BA_FUNCTIONS_MESSAGE_ONSHUTDOWN:
- case BA_FUNCTIONS_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDBUNDLE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTPACKAGEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDMSIPACKAGE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTPATCHTARGET:
- case BA_FUNCTIONS_MESSAGE_ONDETECTMSIFEATURE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTPACKAGECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPLANRELATEDBUNDLE:
- case BA_FUNCTIONS_MESSAGE_ONPLANPACKAGEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONPLANPATCHTARGET:
- case BA_FUNCTIONS_MESSAGE_ONPLANMSIFEATURE:
- case BA_FUNCTIONS_MESSAGE_ONPLANPACKAGECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONAPPLYBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONELEVATEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONELEVATECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPROGRESS:
- case BA_FUNCTIONS_MESSAGE_ONERROR:
- case BA_FUNCTIONS_MESSAGE_ONREGISTERBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONREGISTERCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCACHEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS:
- case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING:
- case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCACHECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEPACKAGEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEPATCHTARGET:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEPROGRESS:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEMSIMESSAGE:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEFILESINUSE:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEPACKAGECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONUNREGISTERBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONUNREGISTERCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONAPPLYCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPLANMSIPACKAGE:
- case BA_FUNCTIONS_MESSAGE_ONBEGINMSITRANSACTIONBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPLANNEDPACKAGE:
- case BA_FUNCTIONS_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE:
- case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYPROGRESS:
- case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS:
- case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS:
- case BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY:
- case BA_FUNCTIONS_MESSAGE_ONSETUPDATEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONSETUPDATECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE:
- case BA_FUNCTIONS_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN:
- case BA_FUNCTIONS_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE:
- case BA_FUNCTIONS_MESSAGE_ONPLANNEDCOMPATIBLEPACKAGE:
- case BA_FUNCTIONS_MESSAGE_ONPLANRESTORERELATEDBUNDLE:
- case BA_FUNCTIONS_MESSAGE_ONPLANRELATEDBUNDLETYPE:
- case BA_FUNCTIONS_MESSAGE_ONAPPLYDOWNGRADE:
- case BA_FUNCTIONS_MESSAGE_ONEXECUTEPROCESSCANCEL:
- case BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDBUNDLEPACKAGE:
- case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGENONVITALVALIDATIONFAILURE:
- hr = BalBaseBootstrapperApplicationProc((BOOTSTRAPPER_APPLICATION_MESSAGE)message, pvArgs, pvResults, pvContext);
- break;
- case BA_FUNCTIONS_MESSAGE_ONTHEMELOADED:
- hr = BalBaseBAFunctionsProcOnThemeLoaded(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BA_FUNCTIONS_MESSAGE_WNDPROC:
- hr = BalBaseBAFunctionsProcWndProc(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING:
- hr = BalBaseBAFunctionsProcOnThemeControlLoading(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMCOMMAND:
- hr = BalBaseBAFunctionsProcOnThemeControlWmCommand(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMNOTIFY:
- hr = BalBaseBAFunctionsProcOnThemeControlWmNotify(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADED:
- hr = BalBaseBAFunctionsProcOnThemeControlLoaded(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- }
- }
-
- return hr;
-}
+ );
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h
index ae7b2a934..30c75fb62 100644
--- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h
+++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h
@@ -3,8 +3,6 @@
#include
#include
-#include "BootstrapperEngine.h"
-#include "BootstrapperApplication.h"
#include "IBootstrapperEngine.h"
#include "IBootstrapperApplication.h"
@@ -12,7 +10,9 @@
#include "balinfo.h"
#include "balretry.h"
-class CBalBaseBootstrapperApplication : public IBootstrapperApplication
+#define CBalBaseBootstrapperApplication CBootstrapperApplication
+
+class CBootstrapperApplication : public IBootstrapperApplication
{
public: // IUnknown
virtual STDMETHODIMP QueryInterface(
@@ -65,8 +65,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
virtual STDMETHODIMP_(HRESULT) BAProc(
__in BOOTSTRAPPER_APPLICATION_MESSAGE /*message*/,
__in const LPVOID /*pvArgs*/,
- __inout LPVOID /*pvResults*/,
- __in_opt LPVOID /*pvContext*/
+ __inout LPVOID /*pvResults*/
)
{
return E_NOTIMPL;
@@ -76,10 +75,35 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
__in BOOTSTRAPPER_APPLICATION_MESSAGE /*message*/,
__in const LPVOID /*pvArgs*/,
__inout LPVOID /*pvResults*/,
- __inout HRESULT* /*phr*/,
- __in_opt LPVOID /*pvContext*/
+ __inout HRESULT* /*phr*/
+ )
+ {
+ }
+
+ virtual STDMETHODIMP OnCreate(
+ __in IBootstrapperEngine* pEngine,
+ __in BOOTSTRAPPER_COMMAND* pCommand
+ )
+ {
+ HRESULT hr = S_OK;
+
+ m_commandDisplay = pCommand->display;
+
+ hr = BalInfoParseCommandLine(&m_BalInfoCommand, pCommand);
+ BalExitOnFailure(hr, "Failed to parse command line with balutil.");
+
+ pEngine->AddRef();
+ m_pEngine = pEngine;
+
+ LExit:
+ return hr;
+ }
+
+ virtual STDMETHODIMP OnDestroy(
+ __in BOOL /*fReload*/
)
{
+ return S_OK;
}
virtual STDMETHODIMP OnStartup()
@@ -429,7 +453,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
m_dwProgressPercentage = dwProgressPercentage;
m_dwOverallProgressPercentage = dwOverallProgressPercentage;
- if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
+ if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_commandDisplay)
{
hr = m_pEngine->SendEmbeddedProgress(m_dwProgressPercentage, m_dwOverallProgressPercentage, &nResult);
BalExitOnFailure(hr, "Failed to send embedded overall progress.");
@@ -463,7 +487,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
{
BalRetryErrorOccurred(wzPackageId, dwCode);
- if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
+ if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_commandDisplay)
{
HRESULT hr = m_pEngine->SendEmbeddedError(dwCode, wzError, dwUIHint, pResult);
if (FAILED(hr))
@@ -475,7 +499,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
{
*pResult = IDCANCEL;
}
- else if (BOOTSTRAPPER_DISPLAY_FULL == m_display)
+ else if (BOOTSTRAPPER_DISPLAY_FULL == m_commandDisplay)
{
if (BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_SERVER == errorType || BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_PROXY == errorType)
{
@@ -553,7 +577,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
// Send progress even though we don't update the numbers to at least give the caller an opportunity
// to cancel.
- if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
+ if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_commandDisplay)
{
hr = m_pEngine->SendEmbeddedProgress(m_dwProgressPercentage, m_dwOverallProgressPercentage, &nResult);
BalExitOnFailure(hr, "Failed to send embedded cache progress.");
@@ -733,7 +757,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
// Send progress even though we don't update the numbers to at least give the caller an opportunity
// to cancel.
- if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_display)
+ if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_commandDisplay)
{
hr = m_pEngine->SendEmbeddedProgress(m_dwProgressPercentage, m_dwOverallProgressPercentage, &nResult);
BalExitOnFailure(hr, "Failed to send embedded execute progress.");
@@ -848,7 +872,7 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
{
HRESULT hr = S_OK;
BOOL fRestartRequired = BOOTSTRAPPER_APPLY_RESTART_REQUIRED == restart;
- BOOL fShouldBlockRestart = BOOTSTRAPPER_DISPLAY_FULL <= m_display && BAL_INFO_RESTART_PROMPT >= m_BalInfoCommand.restart;
+ BOOL fShouldBlockRestart = BOOTSTRAPPER_DISPLAY_FULL <= m_commandDisplay && BAL_INFO_RESTART_PROMPT >= m_BalInfoCommand.restart;
if (fRestartRequired && !fShouldBlockRestart)
{
@@ -1050,20 +1074,6 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
return S_OK;
}
- virtual STDMETHODIMP OnSetUpdateBegin()
- {
- return S_OK;
- }
-
- virtual STDMETHODIMP OnSetUpdateComplete(
- __in HRESULT /*hrStatus*/,
- __in_z_opt LPCWSTR /*wzPreviousPackageId*/,
- __in_z_opt LPCWSTR /*wzNewPackageId*/
- )
- {
- return S_OK;
- }
-
virtual STDMETHODIMP OnPlanRestoreRelatedBundle(
__in_z LPCWSTR /*wzBundleId*/,
__in BOOTSTRAPPER_REQUEST_STATE /*recommendedState*/,
@@ -1127,22 +1137,6 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
return S_OK;
}
-public: //CBalBaseBootstrapperApplication
- virtual STDMETHODIMP Initialize(
- __in const BOOTSTRAPPER_CREATE_ARGS* pCreateArgs
- )
- {
- HRESULT hr = S_OK;
-
- m_display = pCreateArgs->pCommand->display;
-
- hr = BalInfoParseCommandLine(&m_BalInfoCommand, pCreateArgs->pCommand);
- BalExitOnFailure(hr, "Failed to parse command line with balutil.");
-
- LExit:
- return hr;
- }
-
protected:
//
// PromptCancel - prompts the user to close (if not forced).
@@ -1195,16 +1189,14 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
}
CBalBaseBootstrapperApplication(
- __in IBootstrapperEngine* pEngine,
__in DWORD dwRetryCount = 0,
__in DWORD dwRetryTimeout = 1000
)
{
m_cReferences = 1;
- m_display = BOOTSTRAPPER_DISPLAY_UNKNOWN;
+ m_commandDisplay = BOOTSTRAPPER_DISPLAY_UNKNOWN;
- pEngine->AddRef();
- m_pEngine = pEngine;
+ m_pEngine = NULL;
::InitializeCriticalSection(&m_csCanceled);
m_fCanceled = FALSE;
@@ -1230,12 +1222,12 @@ class CBalBaseBootstrapperApplication : public IBootstrapperApplication
CRITICAL_SECTION m_csCanceled;
BOOL m_fCanceled;
+ IBootstrapperEngine* m_pEngine;
BAL_INFO_COMMAND m_BalInfoCommand;
private:
long m_cReferences;
- BOOTSTRAPPER_DISPLAY m_display;
- IBootstrapperEngine* m_pEngine;
+ BOOTSTRAPPER_DISPLAY m_commandDisplay;
BOOL m_fRollingBack;
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h
deleted file mode 100644
index 34739ba33..000000000
--- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h
+++ /dev/null
@@ -1,1045 +0,0 @@
-#pragma once
-// 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
-
-#include "BootstrapperEngine.h"
-#include "BootstrapperApplication.h"
-#include "IBootstrapperEngine.h"
-#include "IBootstrapperApplication.h"
-
-static HRESULT BalBaseBAProcOnDetectBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTBEGIN_ARGS* pArgs,
- __inout BA_ONDETECTBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnDetectBegin(pArgs->fCached, pArgs->registrationType, pArgs->cPackages, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTCOMPLETE_ARGS* pArgs,
- __inout BA_ONDETECTCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnDetectComplete(pArgs->hrStatus, pArgs->fEligibleForCleanup);
-}
-
-static HRESULT BalBaseBAProcOnPlanBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANBEGIN_ARGS* pArgs,
- __inout BA_ONPLANBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnPlanBegin(pArgs->cPackages, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANCOMPLETE_ARGS* pArgs,
- __inout BA_ONPLANCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPlanComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnStartup(
- __in IBootstrapperApplication* pBA,
- __in BA_ONSTARTUP_ARGS* /*pArgs*/,
- __inout BA_ONSTARTUP_RESULTS* /*pResults*/
- )
-{
- return pBA->OnStartup();
-}
-
-static HRESULT BalBaseBAProcOnShutdown(
- __in IBootstrapperApplication* pBA,
- __in BA_ONSHUTDOWN_ARGS* /*pArgs*/,
- __inout BA_ONSHUTDOWN_RESULTS* pResults
- )
-{
- return pBA->OnShutdown(&pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnDetectForwardCompatibleBundle(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS* pArgs,
- __inout BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
- )
-{
- return pBA->OnDetectForwardCompatibleBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fMissingFromCache, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectUpdateBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTUPDATEBEGIN_ARGS* pArgs,
- __inout BA_ONDETECTUPDATEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnDetectUpdateBegin(pArgs->wzUpdateLocation, &pResults->fCancel, &pResults->fSkip);
-}
-
-static HRESULT BalBaseBAProcOnDetectUpdate(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTUPDATE_ARGS* pArgs,
- __inout BA_ONDETECTUPDATE_RESULTS* pResults
- )
-{
- return pBA->OnDetectUpdate(pArgs->wzUpdateLocation, pArgs->dw64Size, pArgs->wzHash, pArgs->hashAlgorithm, pArgs->wzVersion, pArgs->wzTitle, pArgs->wzSummary, pArgs->wzContentType, pArgs->wzContent, &pResults->fCancel, &pResults->fStopProcessingUpdates);
-}
-
-static HRESULT BalBaseBAProcOnDetectUpdateComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTUPDATECOMPLETE_ARGS* pArgs,
- __inout BA_ONDETECTUPDATECOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnDetectUpdateComplete(pArgs->hrStatus, &pResults->fIgnoreError);
-}
-
-static HRESULT BalBaseBAProcOnDetectRelatedBundle(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTRELATEDBUNDLE_ARGS* pArgs,
- __inout BA_ONDETECTRELATEDBUNDLE_RESULTS* pResults
- )
-{
- return pBA->OnDetectRelatedBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fMissingFromCache, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectPackageBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTPACKAGEBEGIN_ARGS* pArgs,
- __inout BA_ONDETECTPACKAGEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnDetectPackageBegin(pArgs->wzPackageId, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectCompatiblePackage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS* pArgs,
- __inout BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS* pResults
- )
-{
- return pBA->OnDetectCompatibleMsiPackage(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->wzCompatiblePackageVersion, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectRelatedMsiPackage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTRELATEDMSIPACKAGE_ARGS* pArgs,
- __inout BA_ONDETECTRELATEDMSIPACKAGE_RESULTS* pResults
- )
-{
- return pBA->OnDetectRelatedMsiPackage(pArgs->wzPackageId, pArgs->wzUpgradeCode, pArgs->wzProductCode, pArgs->fPerMachine, pArgs->wzVersion, pArgs->operation, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectPatchTarget(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTPATCHTARGET_ARGS* pArgs,
- __inout BA_ONDETECTPATCHTARGET_RESULTS* pResults
- )
-{
- return pBA->OnDetectPatchTarget(pArgs->wzPackageId, pArgs->wzProductCode, pArgs->patchState, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectMsiFeature(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTMSIFEATURE_ARGS* pArgs,
- __inout BA_ONDETECTMSIFEATURE_RESULTS* pResults
- )
-{
- return pBA->OnDetectMsiFeature(pArgs->wzPackageId, pArgs->wzFeatureId, pArgs->state, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnDetectPackageComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTPACKAGECOMPLETE_ARGS* pArgs,
- __inout BA_ONDETECTPACKAGECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnDetectPackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->state, pArgs->fCached);
-}
-
-static HRESULT BalBaseBAProcOnPlanRelatedBundle(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANRELATEDBUNDLE_ARGS* pArgs,
- __inout BA_ONPLANRELATEDBUNDLE_RESULTS* pResults
- )
-{
- return pBA->OnPlanRelatedBundle(pArgs->wzBundleId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanRollbackBoundary(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANROLLBACKBOUNDARY_ARGS* pArgs,
- __inout BA_ONPLANROLLBACKBOUNDARY_RESULTS* pResults
- )
-{
- return pBA->OnPlanRollbackBoundary(pArgs->wzRollbackBoundaryId, pArgs->fRecommendedTransaction, &pResults->fTransaction, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanPackageBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANPACKAGEBEGIN_ARGS* pArgs,
- __inout BA_ONPLANPACKAGEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnPlanPackageBegin(pArgs->wzPackageId, pArgs->state, pArgs->fCached, pArgs->installCondition, pArgs->repairCondition, pArgs->recommendedState, pArgs->recommendedCacheType, &pResults->requestedState, &pResults->requestedCacheType, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanCompatibleMsiPackageBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS* pArgs,
- __inout BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnPlanCompatibleMsiPackageBegin(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->wzCompatiblePackageVersion, pArgs->fRecommendedRemove, &pResults->fRequestRemove, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanCompatibleMsiPackageComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS* pArgs,
- __inout BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPlanCompatibleMsiPackageComplete(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->hrStatus, pArgs->fRequestedRemove);
-}
-
-static HRESULT BalBaseBAProcOnPlanPatchTarget(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANPATCHTARGET_ARGS* pArgs,
- __inout BA_ONPLANPATCHTARGET_RESULTS* pResults
- )
-{
- return pBA->OnPlanPatchTarget(pArgs->wzPackageId, pArgs->wzProductCode, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanMsiFeature(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANMSIFEATURE_ARGS* pArgs,
- __inout BA_ONPLANMSIFEATURE_RESULTS* pResults
- )
-{
- return pBA->OnPlanMsiFeature(pArgs->wzPackageId, pArgs->wzFeatureId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanPackageComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANPACKAGECOMPLETE_ARGS* pArgs,
- __inout BA_ONPLANPACKAGECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPlanPackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->requested);
-}
-
-static HRESULT BalBaseBAProcOnPlannedCompatiblePackage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANNEDCOMPATIBLEPACKAGE_ARGS* pArgs,
- __inout BA_ONPLANNEDCOMPATIBLEPACKAGE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPlannedCompatiblePackage(pArgs->wzPackageId, pArgs->wzCompatiblePackageId, pArgs->fRemove);
-}
-
-static HRESULT BalBaseBAProcOnPlannedPackage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANNEDPACKAGE_ARGS* pArgs,
- __inout BA_ONPLANNEDPACKAGE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPlannedPackage(pArgs->wzPackageId, pArgs->execute, pArgs->rollback, pArgs->fPlannedCache, pArgs->fPlannedUncache);
-}
-
-static HRESULT BalBaseBAProcOnApplyBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONAPPLYBEGIN_ARGS* pArgs,
- __inout BA_ONAPPLYBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnApplyBegin(pArgs->dwPhaseCount, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnElevateBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONELEVATEBEGIN_ARGS* /*pArgs*/,
- __inout BA_ONELEVATEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnElevateBegin(&pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnElevateComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONELEVATECOMPLETE_ARGS* pArgs,
- __inout BA_ONELEVATECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnElevateComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnProgress(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPROGRESS_ARGS* pArgs,
- __inout BA_ONPROGRESS_RESULTS* pResults
- )
-{
- return pBA->OnProgress(pArgs->dwProgressPercentage, pArgs->dwOverallPercentage, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnError(
- __in IBootstrapperApplication* pBA,
- __in BA_ONERROR_ARGS* pArgs,
- __inout BA_ONERROR_RESULTS* pResults
- )
-{
- return pBA->OnError(pArgs->errorType, pArgs->wzPackageId, pArgs->dwCode, pArgs->wzError, pArgs->dwUIHint, pArgs->cData, pArgs->rgwzData, pArgs->nRecommendation, &pResults->nResult);
-}
-
-static HRESULT BalBaseBAProcOnRegisterBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONREGISTERBEGIN_ARGS* pArgs,
- __inout BA_ONREGISTERBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnRegisterBegin(pArgs->recommendedRegistrationType, &pResults->fCancel, &pResults->registrationType);
-}
-
-static HRESULT BalBaseBAProcOnRegisterComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONREGISTERCOMPLETE_ARGS* pArgs,
- __inout BA_ONREGISTERCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnRegisterComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnCacheBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEBEGIN_ARGS* /*pArgs*/,
- __inout BA_ONCACHEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCacheBegin(&pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCachePackageBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEPACKAGEBEGIN_ARGS* pArgs,
- __inout BA_ONCACHEPACKAGEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCachePackageBegin(pArgs->wzPackageId, pArgs->cCachePayloads, pArgs->dw64PackageCacheSize, pArgs->fVital, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheAcquireBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEACQUIREBEGIN_ARGS* pArgs,
- __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCacheAcquireBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzSource, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->action, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheAcquireProgress(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEACQUIREPROGRESS_ARGS* pArgs,
- __inout BA_ONCACHEACQUIREPROGRESS_RESULTS* pResults
- )
-{
- return pBA->OnCacheAcquireProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheAcquireResolving(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs,
- __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults
- )
-{
- return pBA->OnCacheAcquireResolving(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->rgSearchPaths, pArgs->cSearchPaths, pArgs->fFoundLocal, pArgs->dwRecommendedSearchPath, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->dwChosenSearchPath, &pResults->action, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheAcquireComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEACQUIRECOMPLETE_ARGS* pArgs,
- __inout BA_ONCACHEACQUIRECOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnCacheAcquireComplete(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnCacheVerifyBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEVERIFYBEGIN_ARGS* pArgs,
- __inout BA_ONCACHEVERIFYBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCacheVerifyBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheVerifyProgress(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEVERIFYPROGRESS_ARGS* pArgs,
- __inout BA_ONCACHEVERIFYPROGRESS_RESULTS* pResults
- )
-{
- return pBA->OnCacheVerifyProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, pArgs->verifyStep, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheVerifyComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEVERIFYCOMPLETE_ARGS* pArgs,
- __inout BA_ONCACHEVERIFYCOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnCacheVerifyComplete(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnCachePackageComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEPACKAGECOMPLETE_ARGS* pArgs,
- __inout BA_ONCACHEPACKAGECOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnCachePackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnCacheComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHECOMPLETE_ARGS* pArgs,
- __inout BA_ONCACHECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnCacheComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnExecuteBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEBEGIN_ARGS* pArgs,
- __inout BA_ONEXECUTEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnExecuteBegin(pArgs->cExecutingPackages, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnExecutePackageBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEPACKAGEBEGIN_ARGS* pArgs,
- __inout BA_ONEXECUTEPACKAGEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnExecutePackageBegin(pArgs->wzPackageId, pArgs->fExecute, pArgs->action, pArgs->uiLevel, pArgs->fDisableExternalUiHandler, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnExecutePatchTarget(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEPATCHTARGET_ARGS* pArgs,
- __inout BA_ONEXECUTEPATCHTARGET_RESULTS* pResults
- )
-{
- return pBA->OnExecutePatchTarget(pArgs->wzPackageId, pArgs->wzTargetProductCode, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnExecuteProgress(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEPROGRESS_ARGS* pArgs,
- __inout BA_ONEXECUTEPROGRESS_RESULTS* pResults
- )
-{
- return pBA->OnExecuteProgress(pArgs->wzPackageId, pArgs->dwProgressPercentage, pArgs->dwOverallPercentage, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnExecuteMsiMessage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEMSIMESSAGE_ARGS* pArgs,
- __inout BA_ONEXECUTEMSIMESSAGE_RESULTS* pResults
- )
-{
- return pBA->OnExecuteMsiMessage(pArgs->wzPackageId, pArgs->messageType, pArgs->dwUIHint, pArgs->wzMessage, pArgs->cData, pArgs->rgwzData, pArgs->nRecommendation, &pResults->nResult);
-}
-
-static HRESULT BalBaseBAProcOnExecuteFilesInUse(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEFILESINUSE_ARGS* pArgs,
- __inout BA_ONEXECUTEFILESINUSE_RESULTS* pResults
- )
-{
- return pBA->OnExecuteFilesInUse(pArgs->wzPackageId, pArgs->cFiles, pArgs->rgwzFiles, pArgs->nRecommendation, pArgs->source, &pResults->nResult);
-}
-
-static HRESULT BalBaseBAProcOnExecutePackageComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEPACKAGECOMPLETE_ARGS* pArgs,
- __inout BA_ONEXECUTEPACKAGECOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnExecutePackageComplete(pArgs->wzPackageId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnExecuteProcessCancel(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTEPROCESSCANCEL_ARGS* pArgs,
- __inout BA_ONEXECUTEPROCESSCANCEL_RESULTS* pResults
- )
-{
- return pBA->OnExecuteProcessCancel(pArgs->wzPackageId, pArgs->dwProcessId, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnExecuteComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONEXECUTECOMPLETE_ARGS* pArgs,
- __inout BA_ONEXECUTECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnExecuteComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnUnregisterBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONUNREGISTERBEGIN_ARGS* pArgs,
- __inout BA_ONUNREGISTERBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnUnregisterBegin(pArgs->recommendedRegistrationType, &pResults->registrationType);
-}
-
-static HRESULT BalBaseBAProcOnUnregisterComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONUNREGISTERCOMPLETE_ARGS* pArgs,
- __inout BA_ONUNREGISTERCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnUnregisterComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnApplyComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONAPPLYCOMPLETE_ARGS* pArgs,
- __inout BA_ONAPPLYCOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnApplyComplete(pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnLaunchApprovedExeBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS* /*pArgs*/,
- __inout BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnLaunchApprovedExeBegin(&pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnLaunchApprovedExeComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS* pArgs,
- __inout BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnLaunchApprovedExeComplete(pArgs->hrStatus, pArgs->dwProcessId);
-}
-
-static HRESULT BalBaseBAProcOnPlanMsiPackage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANMSIPACKAGE_ARGS* pArgs,
- __inout BA_ONPLANMSIPACKAGE_RESULTS* pResults
- )
-{
- return pBA->OnPlanMsiPackage(pArgs->wzPackageId, pArgs->fExecute, pArgs->action, pArgs->recommendedFileVersioning, &pResults->fCancel, &pResults->actionMsiProperty, &pResults->uiLevel, &pResults->fDisableExternalUiHandler, &pResults->fileVersioning);
-}
-
-static HRESULT BalBaseBAProcOnBeginMsiTransactionBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONBEGINMSITRANSACTIONBEGIN_ARGS* pArgs,
- __inout BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnBeginMsiTransactionBegin(pArgs->wzTransactionId, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnBeginMsiTransactionComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS* pArgs,
- __inout BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnBeginMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnCommitMsiTransactionBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS* pArgs,
- __inout BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCommitMsiTransactionBegin(pArgs->wzTransactionId, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCommitMsiTransactionComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS* pArgs,
- __inout BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnCommitMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnRollbackMsiTransactionBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS* pArgs,
- __inout BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS* /*pResults*/
- )
-{
- return pBA->OnRollbackMsiTransactionBegin(pArgs->wzTransactionId);
-}
-
-static HRESULT BalBaseBAProcOnRollbackMsiTransactionComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS* pArgs,
- __inout BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS* pResults
- )
-{
- return pBA->OnRollbackMsiTransactionComplete(pArgs->wzTransactionId, pArgs->hrStatus, pArgs->restart, pArgs->recommendation, &pResults->action);
-}
-
-static HRESULT BalBaseBAProcOnPauseAutomaticUpdatesBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS* /*pArgs*/,
- __inout BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPauseAutomaticUpdatesBegin();
-}
-
-static HRESULT BalBaseBAProcOnPauseAutomaticUpdatesComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS* pArgs,
- __inout BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnPauseAutomaticUpdatesComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnSystemRestorePointBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS* /*pArgs*/,
- __inout BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS* /*pResults*/
- )
-{
- return pBA->OnSystemRestorePointBegin();
-}
-
-static HRESULT BalBaseBAProcOnSystemRestorePointComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS* pArgs,
- __inout BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnSystemRestorePointComplete(pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnPlanForwardCompatibleBundle(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS* pArgs,
- __inout BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
- )
-{
- return pBA->OnPlanForwardCompatibleBundle(pArgs->wzBundleId, pArgs->relationType, pArgs->wzBundleTag, pArgs->fPerMachine, pArgs->wzVersion, pArgs->fRecommendedIgnoreBundle, &pResults->fCancel, &pResults->fIgnoreBundle);
-}
-
-static HRESULT BalBaseBAProcOnCacheContainerOrPayloadVerifyBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS* pArgs,
- __inout BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCacheContainerOrPayloadVerifyBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheContainerOrPayloadVerifyProgress(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS* pArgs,
- __inout BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS* pResults
- )
-{
- return pBA->OnCacheContainerOrPayloadVerifyProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCacheContainerOrPayloadVerifyComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS* pArgs,
- __inout BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnCacheContainerOrPayloadVerifyComplete(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnCachePayloadExtractBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS* pArgs,
- __inout BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS* pResults
- )
-{
- return pBA->OnCachePayloadExtractBegin(pArgs->wzContainerId, pArgs->wzPayloadId, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCachePayloadExtractProgress(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS* pArgs,
- __inout BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS* pResults
- )
-{
- return pBA->OnCachePayloadExtractProgress(pArgs->wzContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCachePayloadExtractComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS* pArgs,
- __inout BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnCachePayloadExtractComplete(pArgs->wzContainerId, pArgs->wzPayloadId, pArgs->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnSetUpdateBegin(
- __in IBootstrapperApplication* pBA,
- __in BA_ONSETUPDATEBEGIN_ARGS* /*pArgs*/,
- __inout BA_ONSETUPDATEBEGIN_RESULTS* /*pResults*/
- )
-{
- return pBA->OnSetUpdateBegin();
-}
-
-static HRESULT BalBaseBAProcOnSetUpdateComplete(
- __in IBootstrapperApplication* pBA,
- __in BA_ONSETUPDATECOMPLETE_ARGS* pArgs,
- __inout BA_ONSETUPDATECOMPLETE_RESULTS* /*pResults*/
- )
-{
- return pBA->OnSetUpdateComplete(pArgs->hrStatus, pArgs->wzPreviousPackageId, pArgs->wzNewPackageId);
-}
-
-static HRESULT BalBaseBAProcOnPlanRestoreRelatedBundle(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANRESTORERELATEDBUNDLE_ARGS* pArgs,
- __inout BA_ONPLANRESTORERELATEDBUNDLE_RESULTS* pResults
- )
-{
- return pBA->OnPlanRestoreRelatedBundle(pArgs->wzBundleId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnPlanRelatedBundleType(
- __in IBootstrapperApplication* pBA,
- __in BA_ONPLANRELATEDBUNDLETYPE_ARGS* pArgs,
- __inout BA_ONPLANRELATEDBUNDLETYPE_RESULTS* pResults
- )
-{
- return pBA->OnPlanRelatedBundleType(pArgs->wzBundleId, pArgs->recommendedType, &pResults->requestedType, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnApplyDowngrade(
- __in IBootstrapperApplication* pBA,
- __in BA_ONAPPLYDOWNGRADE_ARGS* pArgs,
- __inout BA_ONAPPLYDOWNGRADE_RESULTS* pResults
- )
-{
- return pBA->OnApplyDowngrade(pArgs->hrRecommended, &pResults->hrStatus);
-}
-
-static HRESULT BalBaseBAProcOnDetectRelatedBundlePackage(
- __in IBootstrapperApplication* pBA,
- __in BA_ONDETECTRELATEDBUNDLEPACKAGE_ARGS* pArgs,
- __inout BA_ONDETECTRELATEDBUNDLEPACKAGE_RESULTS* pResults
- )
-{
- return pBA->OnDetectRelatedBundlePackage(pArgs->wzPackageId, pArgs->wzBundleId, pArgs->relationType, pArgs->fPerMachine, pArgs->wzVersion, &pResults->fCancel);
-}
-
-static HRESULT BalBaseBAProcOnCachePackageNonVitalValidationFailure(
- __in IBootstrapperApplication* pBA,
- __in BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_ARGS* pArgs,
- __inout BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_RESULTS* pResults
- )
-{
- return pBA->OnCachePackageNonVitalValidationFailure(pArgs->wzPackageId, pArgs->hrStatus, pArgs->recommendation, &pResults->action);
-}
-
-/*******************************************************************
-BalBaseBootstrapperApplicationProc - requires pvContext to be of type IBootstrapperApplication.
- Provides a default mapping between the new message based BA interface and
- the old COM-based BA interface.
-
-*******************************************************************/
-static HRESULT WINAPI BalBaseBootstrapperApplicationProc(
- __in BOOTSTRAPPER_APPLICATION_MESSAGE message,
- __in const LPVOID pvArgs,
- __inout LPVOID pvResults,
- __in_opt LPVOID pvContext
- )
-{
- IBootstrapperApplication* pBA = reinterpret_cast(pvContext);
- HRESULT hr = pBA->BAProc(message, pvArgs, pvResults, pvContext);
-
- if (E_NOTIMPL == hr)
- {
- switch (message)
- {
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN:
- hr = BalBaseBAProcOnDetectBegin(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE:
- hr = BalBaseBAProcOnDetectComplete(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN:
- hr = BalBaseBAProcOnPlanBegin(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE:
- hr = BalBaseBAProcOnPlanComplete(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP:
- hr = BalBaseBAProcOnStartup(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN:
- hr = BalBaseBAProcOnShutdown(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE:
- hr = BalBaseBAProcOnDetectForwardCompatibleBundle(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN:
- hr = BalBaseBAProcOnDetectUpdateBegin(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE:
- hr = BalBaseBAProcOnDetectUpdate(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
- break;
- case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE:
- hr = BalBaseBAProcOnDetectUpdateComplete(pBA, reinterpret_cast