From 5baa1dfe8ba2a3bd4728bca118fe1de225f848d4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 7 Mar 2024 09:41:29 -0800 Subject: Rename "bundle extension" to "bootstrapper extension" for more consistency Also renames WixToolet.BextUtil nupkg to WixToolset.BootstrapperExtensionApi. --- .../bextutil/inc/BextBaseBootstrapperExtension.h | 115 +++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/api/burn/bextutil/inc/BextBaseBootstrapperExtension.h (limited to 'src/api/burn/bextutil/inc/BextBaseBootstrapperExtension.h') diff --git a/src/api/burn/bextutil/inc/BextBaseBootstrapperExtension.h b/src/api/burn/bextutil/inc/BextBaseBootstrapperExtension.h new file mode 100644 index 00000000..83ba23a6 --- /dev/null +++ b/src/api/burn/bextutil/inc/BextBaseBootstrapperExtension.h @@ -0,0 +1,115 @@ +// 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 "bextutil.h" + +class CBextBaseBootstrapperExtension : public IBootstrapperExtension +{ +public: // IUnknown + virtual STDMETHODIMP QueryInterface( + __in REFIID riid, + __out LPVOID *ppvObject + ) + { + if (!ppvObject) + { + return E_INVALIDARG; + } + + *ppvObject = NULL; + + if (::IsEqualIID(__uuidof(IBootstrapperExtension), riid)) + { + *ppvObject = static_cast(this); + } + else if (::IsEqualIID(IID_IUnknown, riid)) + { + *ppvObject = static_cast(this); + } + else // no interface for requested iid + { + return E_NOINTERFACE; + } + + AddRef(); + return S_OK; + } + + virtual STDMETHODIMP_(ULONG) AddRef() + { + return ::InterlockedIncrement(&this->m_cReferences); + } + + virtual STDMETHODIMP_(ULONG) Release() + { + long l = ::InterlockedDecrement(&this->m_cReferences); + if (0 < l) + { + return l; + } + + delete this; + return 0; + } + +public: // IBootstrapperExtension + virtual STDMETHODIMP Search( + __in LPCWSTR /*wzId*/, + __in LPCWSTR /*wzVariable*/ + ) + { + return E_NOTIMPL; + } + + virtual STDMETHODIMP BootstrapperExtensionProc( + __in BOOTSTRAPPER_EXTENSION_MESSAGE /*message*/, + __in const LPVOID /*pvArgs*/, + __inout LPVOID /*pvResults*/, + __in_opt LPVOID /*pvContext*/ + ) + { + return E_NOTIMPL; + } + +public: //CBextBaseBootstrapperExtension + virtual STDMETHODIMP Initialize( + __in const BOOTSTRAPPER_EXTENSION_CREATE_ARGS* pCreateArgs + ) + { + HRESULT hr = S_OK; + + hr = StrAllocString(&m_sczBootstrapperExtensionDataPath, pCreateArgs->wzBootstrapperExtensionDataPath, 0); + ExitOnFailure(hr, "Failed to copy BootstrapperExtensionDataPath."); + + LExit: + return hr; + } + +protected: + + CBextBaseBootstrapperExtension( + __in IBootstrapperExtensionEngine* pEngine + ) + { + m_cReferences = 1; + + pEngine->AddRef(); + m_pEngine = pEngine; + + m_sczBootstrapperExtensionDataPath = NULL; + } + + virtual ~CBextBaseBootstrapperExtension() + { + ReleaseNullObject(m_pEngine); + ReleaseStr(m_sczBootstrapperExtensionDataPath); + } + +protected: + IBootstrapperExtensionEngine* m_pEngine; + LPWSTR m_sczBootstrapperExtensionDataPath; + +private: + long m_cReferences; +}; -- cgit v1.2.3-55-g6feb