aboutsummaryrefslogtreecommitdiff
path: root/src/api/burn/test/BalUtilUnitTest/TestBAFunctions.cpp
blob: 927a8d105ae32a10396d0786232f00340e4f1e47 (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
// 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 "BalBaseBAFunctions.h"
#include "BalBaseBAFunctionsProc.h"

class CTestBAFunctions : public CBalBaseBAFunctions
{
public:
    CTestBAFunctions(
        __in HMODULE hModule,
        __in IBootstrapperEngine* pEngine,
        __in const BA_FUNCTIONS_CREATE_ARGS* pArgs
        ) : CBalBaseBAFunctions(hModule, pEngine, pArgs)
    {
    }
};

HRESULT CreateBAFunctions(
    __in HMODULE hModule,
    __in IBootstrapperEngine* pEngine,
    __in const BA_FUNCTIONS_CREATE_ARGS* pArgs,
    __in BA_FUNCTIONS_CREATE_RESULTS* pResults,
    __out IBAFunctions** ppApplication
    )
{
    HRESULT hr = S_OK;
    CTestBAFunctions* pApplication = NULL;

    pApplication = new CTestBAFunctions(hModule, pEngine, pArgs);
    ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new test bafunctions object.");

    pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc;
    pResults->pvBAFunctionsProcContext = pApplication;
    *ppApplication = pApplication;
    pApplication = NULL;

LExit:
    ReleaseObject(pApplication);
    return hr;
}