Skip to content

Commit

Permalink
WIP - BA header simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
robmen committed Mar 6, 2024
1 parent 7135a3b commit 4065d80
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -1595,3 +1600,7 @@ extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_CREATE)(
);

#endif

#if defined(__cplusplus)
}
#endif
34 changes: 17 additions & 17 deletions src/api/burn/balutil/balutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -86,7 +71,7 @@ DAPI_(HRESULT) BootstrapperApplicationRun(
BalInitialize(pEngine);
fInitializedBal = TRUE;

BootstrapperApplicationDebuggerCheck();
BalDebuggerCheck();

hr = MsgPump(hBAPipe, pApplication, pEngine);
BalExitOnFailure(hr, "Failed while pumping messages.");
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/balutil/inc/BalBaseBAFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <windows.h>
#include <msiquery.h>

#include <batypes.h>
#include <BootstrapperApplication.h>

#include "IBAFunctions.h"

Expand Down
1 change: 0 additions & 1 deletion src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <windows.h>
#include <msiquery.h>

#include "IBootstrapperEngine.h"
#include "IBootstrapperApplication.h"

#include "balutil.h"
Expand Down
1 change: 1 addition & 0 deletions src/api/burn/balutil/inc/IBAFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


#include "IBootstrapperApplication.h"
#include "BAFunctions.h"

DECLARE_INTERFACE_IID_(IBAFunctions, IBootstrapperApplication, "0FB445ED-17BD-49C7-BE19-479776F8AE96")
{
Expand Down
4 changes: 2 additions & 2 deletions src/api/burn/balutil/inc/IBootstrapperApplication.h
Original file line number Diff line number Diff line change
@@ -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 <batypes.h>

#include <BootstrapperApplication.h>
#include <IBootstrapperEngine.h>

DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-AB06-099D717C67FE")
{
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/balutil/inc/IBootstrapperEngine.h
Original file line number Diff line number Diff line change
@@ -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 <baenginetypes.h>
#include "BootstrapperEngine.h"

DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-81512C29C2FB")
{
Expand Down
17 changes: 8 additions & 9 deletions src/api/burn/balutil/inc/balutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
7 changes: 0 additions & 7 deletions src/api/burn/balutil/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
#include <thmutil.h>
#include <xmlutil.h>

#include <baenginetypes.h>
#include <batypes.h>

#include "IBootstrapperEngine.h"
#include "IBootstrapperApplication.h"

#include "BAFunctions.h"
#include "IBAFunctions.h"

#include "balutil.h"
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/mbanative/mbanative.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ EXPORTS
BalGetVersionVariableFromEngine
BalGetRelatedBundleVariableFromEngine
BalVariableExistsFromEngine
BootstrapperApplicationDebuggerCheck
BalDebuggerCheck
BootstrapperApplicationRun
StrFree
VerCompareParsedVersions
Expand Down
4 changes: 0 additions & 4 deletions src/api/burn/mbanative/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@
#include <dutil.h>
#include <verutil.h>

// #include <BootstrapperEngine.h>
// #include <BootstrapperApplication.h>

#include <IBootstrapperEngine.h>
#include <IBootstrapperApplication.h>
#include <balutil.h>
5 changes: 0 additions & 5 deletions src/api/burn/test/BalUtilUnitTest/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
#include <dutil.h>
#include <dictutil.h>

#include <baenginetypes.h>
#include <batypes.h>

#include <BAFunctions.h>
#include <IBootstrapperEngine.h>
#include <IBootstrapperApplication.h>
#include <IBAFunctions.h>
#include <balutil.h>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/burn/engine/engine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@
<ItemGroup>
<ClInclude Include="apply.h" />
<ClInclude Include="approvedexe.h" />
<ClInclude Include="..\..\api\burn\WixToolset.BootstrapperCore.Native\inc\batypes.h" />
<ClInclude Include="..\..\api\burn\WixToolset.BootstrapperCore.Native\inc\baenginetypes.h" />
<ClInclude Include="..\..\api\burn\WixToolset.BootstrapperCore.Native\inc\BootstrapperApplication.h" />
<ClInclude Include="..\..\api\burn\WixToolset.BootstrapperCore.Native\inc\BootstrapperEngine.h" />
<ClInclude Include="..\..\api\burn\WixToolset.BootstrapperCore.Native\inc\BundleExtension.h" />
<ClInclude Include="..\..\api\burn\WixToolset.BootstrapperCore.Native\inc\BundleExtensionEngine.h" />
<ClInclude Include="ba.h" />
<ClInclude Include="bacallback.h" />
<ClInclude Include="bootstrapperapplication.h" />
<ClInclude Include="bundlepackageengine.h" />
<ClInclude Include="burnextension.h" />
<ClInclude Include="cabextract.h" />
Expand Down
6 changes: 3 additions & 3 deletions src/burn/engine/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
#include <dpiutil.h>
#include <butil.h>

#include "baenginetypes.h"
#include "batypes.h"
#include "BootstrapperApplication.h"

#include "BundleExtensionEngine.h"
#include "BundleExtension.h"

Expand All @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions src/burn/test/BurnUnitTest/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
#include <deputil.h>
#include <butil.h>

#include "baenginetypes.h"
#include "batypes.h"
#include "BootstrapperApplication.h"
#include "BundleExtensionEngine.h"
#include "BundleExtension.h"

Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion src/ext/Bal/Samples/bafunctions/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
//#include "xmlutil.h"
#include "regutil.h"

//#include "IBootstrapperEngine.h"
//#include "IBootstrapperApplication.h"

#include "BalBaseBootstrapperApplication.h"
Expand Down
1 change: 0 additions & 1 deletion src/ext/Bal/stdbas/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <uriutil.h>
#include <xmlutil.h>

#include <IBootstrapperEngine.h>
#include <IBootstrapperApplication.h>

#include <balutil.h>
Expand Down
4 changes: 2 additions & 2 deletions src/ext/Bal/test/examples/TestEngine/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "pathutil.h"
#include "strutil.h"

#include <baenginetypes.h>
#include <batypes.h>
// #include <baenginetypes.h>
// #include <batypes.h>

#include "TestEngine.h"
#include "ReloadEngine.h"
Expand Down
4 changes: 0 additions & 4 deletions src/ext/Bal/wixiuiba/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
#include <strutil.h>
#include <xmlutil.h>

#include <baenginetypes.h>
#include <batypes.h>

#include <IBootstrapperEngine.h>
#include <IBootstrapperApplication.h>

#include <balutil.h>
Expand Down
1 change: 0 additions & 1 deletion src/ext/Bal/wixprqba/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <uriutil.h>
#include <xmlutil.h>

#include <IBootstrapperEngine.h>
#include <IBootstrapperApplication.h>

#include <balutil.h>
Expand Down
1 change: 0 additions & 1 deletion src/ext/Bal/wixstdba/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <uriutil.h>
#include <xmlutil.h>

#include <IBootstrapperEngine.h>
#include <IBootstrapperApplication.h>

#include <balutil.h>
Expand Down

0 comments on commit 4065d80

Please sign in to comment.