aboutsummaryrefslogtreecommitdiff
path: root/src/api/burn/bextutil/inc/BextBaseBootstrapperExtensionProc.h
blob: 4f96399c54003f3c8b050e86e814e0e5f4da6c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#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 <windows.h>

#include <IBootstrapperExtensionEngine.h>
#include <IBootstrapperExtension.h>

static HRESULT BextBaseBEProcSearch(
    __in IBootstrapperExtension* pBE,
    __in BOOTSTRAPPER_EXTENSION_SEARCH_ARGS* pArgs,
    __inout BOOTSTRAPPER_EXTENSION_SEARCH_RESULTS* /*pResults*/
    )
{
    return pBE->Search(pArgs->wzId, pArgs->wzVariable);
}

/*******************************************************************
BextBaseBootstrapperExtensionProc - requires pvContext to be of type IBootstrapperExtension.
                              Provides a default mapping between the message based
                              BootstrapperExtension interface and the COM-based BootstrapperExtension interface.

*******************************************************************/
static HRESULT WINAPI BextBaseBootstrapperExtensionProc(
    __in BOOTSTRAPPER_EXTENSION_MESSAGE message,
    __in const LPVOID pvArgs,
    __inout LPVOID pvResults,
    __in_opt LPVOID pvContext
    )
{
    IBootstrapperExtension* pBE = reinterpret_cast<IBootstrapperExtension*>(pvContext);
    HRESULT hr = pBE->BootstrapperExtensionProc(message, pvArgs, pvResults, pvContext);

    if (E_NOTIMPL == hr)
    {
        switch (message)
        {
        case BOOTSTRAPPER_EXTENSION_MESSAGE_SEARCH:
            hr = BextBaseBEProcSearch(pBE, reinterpret_cast<BOOTSTRAPPER_EXTENSION_SEARCH_ARGS*>(pvArgs), reinterpret_cast<BOOTSTRAPPER_EXTENSION_SEARCH_RESULTS*>(pvResults));
            break;
        }
    }

    return hr;
}