From 41b928f2af6441a274828265a646df2350c903cd Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 6 Mar 2024 10:20:29 -0800 Subject: [PATCH] WIP - BA header simplification --- .../{batypes.h => BootstrapperApplication.h} | 9 +++++ .../{baenginetypes.h => BootstrapperEngine.h} | 0 src/api/burn/balutil/balutil.cpp | 34 +++++++++---------- src/api/burn/balutil/inc/BalBaseBAFunctions.h | 2 +- .../inc/BalBaseBootstrapperApplication.h | 1 - src/api/burn/balutil/inc/IBAFunctions.h | 1 + .../balutil/inc/IBootstrapperApplication.h | 4 +-- .../burn/balutil/inc/IBootstrapperEngine.h | 2 +- src/api/burn/balutil/inc/balutil.h | 17 +++++----- src/api/burn/balutil/precomp.h | 7 ---- src/api/burn/mbanative/mbanative.def | 2 +- src/api/burn/mbanative/precomp.h | 4 --- src/api/burn/test/BalUtilUnitTest/precomp.h | 5 --- .../{bootstrapperapplication.h => ba.h} | 0 src/burn/engine/engine.vcxproj | 6 ++-- src/burn/engine/precomp.h | 6 ++-- src/burn/test/BurnUnitTest/precomp.h | 5 ++- src/ext/Bal/Samples/bafunctions/precomp.h | 1 - src/ext/Bal/stdbas/precomp.h | 1 - .../Bal/test/examples/TestEngine/precomp.h | 4 +-- src/ext/Bal/wixiuiba/precomp.h | 4 --- src/ext/Bal/wixprqba/precomp.h | 1 - src/ext/Bal/wixstdba/precomp.h | 1 - 23 files changed, 50 insertions(+), 67 deletions(-) rename src/api/burn/WixToolset.BootstrapperCore.Native/inc/{batypes.h => BootstrapperApplication.h} (99%) rename src/api/burn/WixToolset.BootstrapperCore.Native/inc/{baenginetypes.h => BootstrapperEngine.h} (100%) rename src/burn/engine/{bootstrapperapplication.h => ba.h} (100%) diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/batypes.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h similarity index 99% rename from src/api/burn/WixToolset.BootstrapperCore.Native/inc/batypes.h rename to src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index 0116364c9..79b1df800 100644 --- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/batypes.h +++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h @@ -1,6 +1,11 @@ #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 "BootstrapperEngine.h" + +#if defined(__cplusplus) +extern "C" { +#endif const LPCWSTR BOOTSTRAPPER_APPLICATION_COMMANDLINE_SWITCH_API_VERSION = L"burn.ba.apiver"; const LPCWSTR BOOTSTRAPPER_APPLICATION_COMMANDLINE_SWITCH_PIPE_NAME = L"burn.ba.pipe"; @@ -1595,3 +1600,7 @@ extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_CREATE)( ); #endif + +#if defined(__cplusplus) +} +#endif diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/baenginetypes.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h similarity index 100% rename from src/api/burn/WixToolset.BootstrapperCore.Native/inc/baenginetypes.h rename to src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h diff --git a/src/api/burn/balutil/balutil.cpp b/src/api/burn/balutil/balutil.cpp index a77ff7d0e..7f774b6cc 100644 --- a/src/api/burn/balutil/balutil.cpp +++ b/src/api/burn/balutil/balutil.cpp @@ -38,21 +38,6 @@ static void MsgProc( // prototypes -DAPI_(void) BalInitialize( - __in IBootstrapperEngine* pEngine - ) -{ - pEngine->AddRef(); - - ReleaseObject(vpEngine); - vpEngine = pEngine; -} - -DAPI_(void) BalUninitialize() -{ - ReleaseNullObject(vpEngine); -} - DAPI_(HRESULT) BootstrapperApplicationRun( __in IBootstrapperApplication* pApplication ) @@ -86,7 +71,7 @@ DAPI_(HRESULT) BootstrapperApplicationRun( BalInitialize(pEngine); fInitializedBal = TRUE; - BootstrapperApplicationDebuggerCheck(); + BalDebuggerCheck(); hr = MsgPump(hBAPipe, pApplication, pEngine); BalExitOnFailure(hr, "Failed while pumping messages."); @@ -111,7 +96,22 @@ DAPI_(HRESULT) BootstrapperApplicationRun( return hr; } -DAPI_(VOID) BootstrapperApplicationDebuggerCheck() +DAPI_(void) BalInitialize( + __in IBootstrapperEngine* pEngine + ) +{ + pEngine->AddRef(); + + ReleaseObject(vpEngine); + vpEngine = pEngine; +} + +DAPI_(void) BalUninitialize() +{ + ReleaseNullObject(vpEngine); +} + +DAPI_(VOID) BalDebuggerCheck() { HRESULT hr = S_OK; HKEY hk = NULL; diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index 33b71324a..df0b70064 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include "IBAFunctions.h" diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h index 30c75fb62..09f1f7a27 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h @@ -3,7 +3,6 @@ #include #include -#include "IBootstrapperEngine.h" #include "IBootstrapperApplication.h" #include "balutil.h" diff --git a/src/api/burn/balutil/inc/IBAFunctions.h b/src/api/burn/balutil/inc/IBAFunctions.h index b0afabb30..42b64f9bb 100644 --- a/src/api/burn/balutil/inc/IBAFunctions.h +++ b/src/api/burn/balutil/inc/IBAFunctions.h @@ -3,6 +3,7 @@ #include "IBootstrapperApplication.h" +#include "BAFunctions.h" DECLARE_INTERFACE_IID_(IBAFunctions, IBootstrapperApplication, "0FB445ED-17BD-49C7-BE19-479776F8AE96") { diff --git a/src/api/burn/balutil/inc/IBootstrapperApplication.h b/src/api/burn/balutil/inc/IBootstrapperApplication.h index 6eb32ee6b..3f57f0956 100644 --- a/src/api/burn/balutil/inc/IBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/IBootstrapperApplication.h @@ -1,8 +1,8 @@ #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 DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-AB06-099D717C67FE") { diff --git a/src/api/burn/balutil/inc/IBootstrapperEngine.h b/src/api/burn/balutil/inc/IBootstrapperEngine.h index 3c1afb77e..ef3b9812b 100644 --- a/src/api/burn/balutil/inc/IBootstrapperEngine.h +++ b/src/api/burn/balutil/inc/IBootstrapperEngine.h @@ -1,7 +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 +#include "BootstrapperEngine.h" DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-81512C29C2FB") { diff --git a/src/api/burn/balutil/inc/balutil.h b/src/api/burn/balutil/inc/balutil.h index 4f8cb23db..d77b35999 100644 --- a/src/api/burn/balutil/inc/balutil.h +++ b/src/api/burn/balutil/inc/balutil.h @@ -42,15 +42,6 @@ static const HRESULT E_WIXSTDBA_CONDITION_FAILED = MAKE_HRESULT(SEVERITY_ERROR, static const HRESULT E_PREREQBA_INFINITE_LOOP = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 1002); -/******************************************************************* - BootstrapperApplicationDebuggerCheck - allows bootstrapper application to - explicitly check whether a debugger should be attached to the boostrapper - application. - - Note: Automatically called in BootstrapperApplicationRun(). -********************************************************************/ -DAPI_(VOID) BootstrapperApplicationDebuggerCheck(); - /******************************************************************* BootstrapperApplicationRun - runs the IBootstrapperApplication until the application quits. @@ -60,6 +51,14 @@ DAPI_(HRESULT) BootstrapperApplicationRun( __in IBootstrapperApplication* pApplication ); +/******************************************************************* + BalDebuggerCheck - allows bootstrapper application to explicitly check + whether a debugger should be attached to the boostrapper application. + + Note: Automatically called in BootstrapperApplicationRun(). +********************************************************************/ +DAPI_(VOID) BalDebuggerCheck(); + /******************************************************************* BalInitialize - remembers the engine interface to enable logging and other functions. diff --git a/src/api/burn/balutil/precomp.h b/src/api/burn/balutil/precomp.h index ace4f3ec1..68e07a44f 100644 --- a/src/api/burn/balutil/precomp.h +++ b/src/api/burn/balutil/precomp.h @@ -30,13 +30,6 @@ #include #include -#include -#include - -#include "IBootstrapperEngine.h" -#include "IBootstrapperApplication.h" - -#include "BAFunctions.h" #include "IBAFunctions.h" #include "balutil.h" diff --git a/src/api/burn/mbanative/mbanative.def b/src/api/burn/mbanative/mbanative.def index bd0136999..37876be05 100644 --- a/src/api/burn/mbanative/mbanative.def +++ b/src/api/burn/mbanative/mbanative.def @@ -8,7 +8,7 @@ EXPORTS BalGetVersionVariableFromEngine BalGetRelatedBundleVariableFromEngine BalVariableExistsFromEngine - BootstrapperApplicationDebuggerCheck + BalDebuggerCheck BootstrapperApplicationRun StrFree VerCompareParsedVersions diff --git a/src/api/burn/mbanative/precomp.h b/src/api/burn/mbanative/precomp.h index 622f341a2..81f875afb 100644 --- a/src/api/burn/mbanative/precomp.h +++ b/src/api/burn/mbanative/precomp.h @@ -8,9 +8,5 @@ #include #include -// #include -// #include - -#include #include #include diff --git a/src/api/burn/test/BalUtilUnitTest/precomp.h b/src/api/burn/test/BalUtilUnitTest/precomp.h index 57487bc54..4cdd262c4 100644 --- a/src/api/burn/test/BalUtilUnitTest/precomp.h +++ b/src/api/burn/test/BalUtilUnitTest/precomp.h @@ -15,11 +15,6 @@ #include #include -#include -#include - -#include -#include #include #include #include diff --git a/src/burn/engine/bootstrapperapplication.h b/src/burn/engine/ba.h similarity index 100% rename from src/burn/engine/bootstrapperapplication.h rename to src/burn/engine/ba.h diff --git a/src/burn/engine/engine.vcxproj b/src/burn/engine/engine.vcxproj index 7a2447f87..a897140de 100644 --- a/src/burn/engine/engine.vcxproj +++ b/src/burn/engine/engine.vcxproj @@ -102,12 +102,12 @@ - - + + + - diff --git a/src/burn/engine/precomp.h b/src/burn/engine/precomp.h index 1150b2a0a..24a01140a 100644 --- a/src/burn/engine/precomp.h +++ b/src/burn/engine/precomp.h @@ -61,8 +61,8 @@ #include #include -#include "baenginetypes.h" -#include "batypes.h" +#include "BootstrapperApplication.h" + #include "BundleExtensionEngine.h" #include "BundleExtension.h" @@ -77,7 +77,7 @@ #include "cabextract.h" #include "burnextension.h" #include "search.h" -#include "bootstrapperapplication.h" +#include "ba.h" #include "userexperience.h" #include "package.h" #include "update.h" diff --git a/src/burn/test/BurnUnitTest/precomp.h b/src/burn/test/BurnUnitTest/precomp.h index 82fedf109..1b2974293 100644 --- a/src/burn/test/BurnUnitTest/precomp.h +++ b/src/burn/test/BurnUnitTest/precomp.h @@ -37,8 +37,7 @@ #include #include -#include "baenginetypes.h" -#include "batypes.h" +#include "BootstrapperApplication.h" #include "BundleExtensionEngine.h" #include "BundleExtension.h" @@ -53,7 +52,7 @@ #include "cabextract.h" #include "burnextension.h" #include "search.h" -#include "bootstrapperapplication.h" +#include "ba.h" #include "userexperience.h" #include "package.h" #include "update.h" diff --git a/src/ext/Bal/Samples/bafunctions/precomp.h b/src/ext/Bal/Samples/bafunctions/precomp.h index cda11a40d..542ac6063 100644 --- a/src/ext/Bal/Samples/bafunctions/precomp.h +++ b/src/ext/Bal/Samples/bafunctions/precomp.h @@ -34,7 +34,6 @@ //#include "xmlutil.h" #include "regutil.h" -//#include "IBootstrapperEngine.h" //#include "IBootstrapperApplication.h" #include "BalBaseBootstrapperApplication.h" diff --git a/src/ext/Bal/stdbas/precomp.h b/src/ext/Bal/stdbas/precomp.h index 7f1380358..00d0d03f7 100644 --- a/src/ext/Bal/stdbas/precomp.h +++ b/src/ext/Bal/stdbas/precomp.h @@ -36,7 +36,6 @@ #include #include -#include #include #include diff --git a/src/ext/Bal/test/examples/TestEngine/precomp.h b/src/ext/Bal/test/examples/TestEngine/precomp.h index e9ba3f983..2beba0b99 100644 --- a/src/ext/Bal/test/examples/TestEngine/precomp.h +++ b/src/ext/Bal/test/examples/TestEngine/precomp.h @@ -11,8 +11,8 @@ #include "pathutil.h" #include "strutil.h" -#include -#include +// #include +// #include #include "TestEngine.h" #include "ReloadEngine.h" diff --git a/src/ext/Bal/wixiuiba/precomp.h b/src/ext/Bal/wixiuiba/precomp.h index cb6730fd8..782c0b1bc 100644 --- a/src/ext/Bal/wixiuiba/precomp.h +++ b/src/ext/Bal/wixiuiba/precomp.h @@ -15,10 +15,6 @@ #include #include -#include -#include - -#include #include #include diff --git a/src/ext/Bal/wixprqba/precomp.h b/src/ext/Bal/wixprqba/precomp.h index 8844d1504..a47f411b3 100644 --- a/src/ext/Bal/wixprqba/precomp.h +++ b/src/ext/Bal/wixprqba/precomp.h @@ -35,7 +35,6 @@ #include #include -#include #include #include diff --git a/src/ext/Bal/wixstdba/precomp.h b/src/ext/Bal/wixstdba/precomp.h index 8844d1504..a47f411b3 100644 --- a/src/ext/Bal/wixstdba/precomp.h +++ b/src/ext/Bal/wixstdba/precomp.h @@ -35,7 +35,6 @@ #include #include -#include #include #include