Skip to content

Commit

Permalink
Simplify BootstrapperApplication header files
Browse files Browse the repository at this point in the history
Take this breaking change opportunity to simplify the header files used by
BA devs.
  • Loading branch information
robmen committed Mar 21, 2024
1 parent a2b75eb commit 90cdebb
Show file tree
Hide file tree
Showing 34 changed files with 75 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<file src="v143\x86\mbanative.dll" target="runtimes\win-x86\native" />

<file src="$projectFolder$\..\balutil\inc\*" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperApplication.h" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperEngine.h" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperApplicationTypes.h" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperEngineTypes.h" target="build\native\include" />
<file src="v141\x86\balutil.lib" target="build\native\v14\x86" />
<file src="v141\x64\balutil.lib" target="build\native\v14\x64" />
<file src="v141\ARM64\balutil.lib" target="build\native\v14\ARM64" />
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/balutil/balutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void MsgProc(

// prototypes

DAPI_(HRESULT) BootstrapperApplicationRun(
EXTERN_C HRESULT __stdcall BootstrapperApplicationRun(
__in IBootstrapperApplication* pApplication
)
{
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/balutil/balutil.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<ClCompile Include="msg.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="inc\BalBaseBootstrapperApplication.h" />
<ClInclude Include="inc\BootstrapperApplicationBase.h" />
<ClInclude Include="inc\balcondition.h" />
<ClInclude Include="inc\balinfo.h" />
<ClInclude Include="inc\balretry.h" />
Expand Down
21 changes: 21 additions & 0 deletions src/api/burn/balutil/inc/BootstrapperApplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#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 "IBootstrapperApplication.h"

#if defined(__cplusplus)
extern "C" {
#endif

/*******************************************************************
BootstrapperApplicationRun - runs the IBootstrapperApplication until
the application quits.
********************************************************************/
HRESULT __stdcall BootstrapperApplicationRun(
__in IBootstrapperApplication* pApplication
);

#if defined(__cplusplus)
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include "balinfo.h"
#include "balretry.h"

#define CBalBaseBootstrapperApplication CBootstrapperApplication
#define CBalBaseBootstrapperApplication CBootstrapperApplicationBase

class CBootstrapperApplication : public IBootstrapperApplication
class CBootstrapperApplicationBase : public IBootstrapperApplication
{
public: // IUnknown
virtual STDMETHODIMP QueryInterface(
Expand Down Expand Up @@ -1187,7 +1187,7 @@ class CBootstrapperApplication : public IBootstrapperApplication
return m_fCanceled;
}

CBalBaseBootstrapperApplication(
CBootstrapperApplicationBase(
__in DWORD dwRetryCount = 0,
__in DWORD dwRetryTimeout = 1000
)
Expand All @@ -1208,7 +1208,7 @@ class CBootstrapperApplication : public IBootstrapperApplication
BalRetryInitialize(dwRetryCount, dwRetryTimeout);
}

virtual ~CBalBaseBootstrapperApplication()
virtual ~CBootstrapperApplicationBase()
{
BalInfoUninitializeCommandLine(&m_BalInfoCommand);
BalRetryUninitialize();
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 <BootstrapperApplication.h>
#include <IBootstrapperEngine.h>
#include "BootstrapperApplicationTypes.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 "BootstrapperEngine.h"
#include "BootstrapperEngineTypes.h"

DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-81512C29C2FB")
{
Expand Down
9 changes: 0 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);


/*******************************************************************
BootstrapperApplicationRun - runs the IBootstrapperApplication until
the application quits.
********************************************************************/
DAPI_(HRESULT) BootstrapperApplicationRun(
__in IBootstrapperApplication* pApplication
);

/*******************************************************************
BalDebuggerCheck - allows bootstrapper application to explicitly check
whether a debugger should be attached to the boostrapper application.
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/balutil/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <thmutil.h>
#include <xmlutil.h>

#include "IBootstrapperApplication.h"
#include "BootstrapperApplication.h"

#include "balutil.h"
#include "BalBootstrapperEngine.h"
Expand Down
4 changes: 2 additions & 2 deletions src/api/burn/bextutil/bextutil.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<file src="$projectFolder$\build\$id$.props" target="build\" />
<file src="$projectFolder$\..\..\..\internal\images\wix.png" />
<file src="$projectFolder$\inc\*" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperExtension.h" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperExtensionEngine.h" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperExtensionTypes.h" target="build\native\include" />
<file src="$projectFolder$\..\inc\BootstrapperExtensionEngineTypes.h" target="build\native\include" />
<file src="..\..\v141\x86\bextutil.lib" target="build\native\v14\x86" />
<file src="..\..\v141\x64\bextutil.lib" target="build\native\v14\x64" />
<file src="..\..\v141\ARM64\bextutil.lib" target="build\native\v14\ARM64" />
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/bextutil/inc/IBootstrapperExtension.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 <BootstrapperExtension.h>
#include "BootstrapperExtensionTypes.h"

DECLARE_INTERFACE_IID_(IBootstrapperExtension, IUnknown, "93123C9D-796B-4FCD-A507-6EDEF9A925FD")
{
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/bextutil/inc/IBootstrapperExtensionEngine.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 <BootstrapperExtensionEngine.h>
#include "BootstrapperExtensionEngineTypes.h"

DECLARE_INTERFACE_IID_(IBootstrapperExtensionEngine, IUnknown, "9D027A39-F6B6-42CC-9737-C185089EB263")
{
Expand Down
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 "BootstrapperEngine.h"
#include "BootstrapperEngineTypes.h"

#if defined(__cplusplus)
extern "C" {
Expand Down Expand Up @@ -1535,57 +1535,6 @@ struct BA_ONUNREGISTERCOMPLETE_RESULTS
DWORD dwApiVersion;
};

#ifdef TODO_DELETE

extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_PROC)(
__in BOOTSTRAPPER_APPLICATION_MESSAGE message,
__in const LPVOID pvArgs,
__inout LPVOID pvResults,
__in_opt LPVOID pvContext
);

struct BOOTSTRAPPER_DESTROY_ARGS
{
DWORD dwApiVersion;
BOOL fReload;
};

struct BOOTSTRAPPER_DESTROY_RESULTS
{
DWORD dwApiVersion;
BOOL fDisableUnloading; // indicates the BA dll must not be unloaded after BootstrapperApplicationDestroy.
};

extern "C" typedef void (WINAPI *PFN_BOOTSTRAPPER_APPLICATION_DESTROY)(
__in const BOOTSTRAPPER_DESTROY_ARGS* pArgs,
__inout BOOTSTRAPPER_DESTROY_RESULTS* pResults
);



struct BOOTSTRAPPER_CREATE_ARGS
{
DWORD dwApiVersion;
DWORD64 qwEngineAPIVersion;
PFN_BOOTSTRAPPER_ENGINE_PROC pfnBootstrapperEngineProc;
LPVOID pvBootstrapperEngineProcContext;
BOOTSTRAPPER_COMMAND* pCommand;
};

struct BOOTSTRAPPER_CREATE_RESULTS
{
DWORD dwApiVersion;
PFN_BOOTSTRAPPER_APPLICATION_PROC pfnBootstrapperApplicationProc;
LPVOID pvBootstrapperApplicationProcContext;
};

extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_APPLICATION_CREATE)(
__in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
__inout BOOTSTRAPPER_CREATE_RESULTS* pResults
);

#endif

#if defined(__cplusplus)
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,6 @@ typedef struct _BAENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS
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
// );

#if defined(__cplusplus)
}
#endif
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 <BootstrapperExtensionEngine.h>
#include "BootstrapperExtensionEngineTypes.h"

#if defined(__cplusplus)
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// 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"
#include "BalBaseBootstrapperApplication.h"

class CTestBootstrapperApplication : public CBalBaseBootstrapperApplication
class CTestBootstrapperApplication : public CBootstrapperApplicationBase
{
public:
CTestBootstrapperApplication() : CBalBaseBootstrapperApplication()
CTestBootstrapperApplication() : CBootstrapperApplicationBase()
{
}
};
Expand Down
4 changes: 1 addition & 3 deletions src/api/burn/test/BalUtilUnitTest/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#include <dutil.h>
#include <dictutil.h>

#include <IBootstrapperApplication.h>
#include <balutil.h>
#include <balretry.h>
#include <BootstrapperApplicationBase.h>

#include "TestBootstrapperApplication.h"

Expand Down
8 changes: 4 additions & 4 deletions src/burn/engine/engine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
<ItemGroup>
<ClInclude Include="apply.h" />
<ClInclude Include="approvedexe.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperApplication.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperEngine.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperExtension.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperExtensionEngine.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperApplicationTypes.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperEngineTypes.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperExtensionTypes.h" />
<ClInclude Include="..\..\api\burn\inc\BootstrapperExtensionEngineTypes.h" />
<ClInclude Include="ba.h" />
<ClInclude Include="bacallback.h" />
<ClInclude Include="bundlepackageengine.h" />
Expand Down
4 changes: 2 additions & 2 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 "BootstrapperApplication.h"
#include "BootstrapperExtension.h"
#include "BootstrapperApplicationTypes.h"
#include "BootstrapperExtensionTypes.h"

#include "platform.h"
#include "variant.h"
Expand Down
4 changes: 2 additions & 2 deletions src/burn/test/BurnUnitTest/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include <deputil.h>
#include <butil.h>

#include "BootstrapperApplication.h"
#include "BootstrapperExtension.h"
#include "BootstrapperApplicationTypes.h"
#include "BootstrapperExtensionTypes.h"

#include "platform.h"
#include "variant.h"
Expand Down
7 changes: 1 addition & 6 deletions src/ext/Bal/Samples/bafunctions/precomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
//#include "xmlutil.h"
#include "regutil.h"

//#include "IBootstrapperApplication.h"

#include "BalBaseBootstrapperApplication.h"
//#include "balinfo.h"
//#include "balcondition.h"
#include "balutil.h"
#include "BootstrapperApplicationBase.h"

#include "BAFunctions.h"
#include "IBAFunctions.h"
Expand Down
9 changes: 4 additions & 5 deletions src/ext/Bal/stdbas/WixInternalUIBootstrapperApplication.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// 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"
#include "BalBaseBootstrapperApplication.h"

static const LPCWSTR WIXIUIBA_WINDOW_CLASS = L"WixInternalUIBA";

Expand All @@ -15,18 +14,18 @@ enum WM_WIXIUIBA
};


class CWixInternalUIBootstrapperApplication : public CBalBaseBootstrapperApplication
class CWixInternalUIBootstrapperApplication : public CBootstrapperApplicationBase
{
public: // IBootstrapperApplication
STDMETHODIMP OnCreate(
virtual STDMETHODIMP OnCreate(
__in IBootstrapperEngine* pEngine,
__in BOOTSTRAPPER_COMMAND* pCommand
)
{
HRESULT hr = S_OK;

hr = __super::OnCreate(pEngine, pCommand);
BalExitOnFailure(hr, "CBalBaseBootstrapperApplication initialization failed.");
BalExitOnFailure(hr, "CBootstrapperApplicationBase initialization failed.");

m_commandAction = pCommand->action;
m_commandDisplay = pCommand->display;
Expand Down Expand Up @@ -794,7 +793,7 @@ class CWixInternalUIBootstrapperApplication : public CBalBaseBootstrapperApplica
//
CWixInternalUIBootstrapperApplication(
__in HMODULE hModule
) : CBalBaseBootstrapperApplication(3, 3000)
) : CBootstrapperApplicationBase(3, 3000)
{
m_hModule = hModule;
m_commandAction = BOOTSTRAPPER_ACTION_UNKNOWN;
Expand Down
Loading

0 comments on commit 90cdebb

Please sign in to comment.