aboutsummaryrefslogtreecommitdiff
path: root/src/api/burn/test/BalUtilUnitTest/TestBootstrapperApplication.cpp
blob: 13d22e7200088c7fc023d44436a53ef54fb732fc (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
// 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"
#include "BalBaseBootstrapperApplicationProc.h"

class CTestBootstrapperApplication : public CBalBaseBootstrapperApplication
{
public:
    CTestBootstrapperApplication(
        __in IBootstrapperEngine* pEngine,
        __in const BOOTSTRAPPER_CREATE_ARGS* pArgs
        ) : CBalBaseBootstrapperApplication(pEngine, pArgs)
    {
    }
};

HRESULT CreateBootstrapperApplication(
    __in IBootstrapperEngine* pEngine,
    __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
    __inout BOOTSTRAPPER_CREATE_RESULTS* pResults,
    __out IBootstrapperApplication** ppApplication
    )
{
    HRESULT hr = S_OK;
    CTestBootstrapperApplication* pApplication = NULL;

    pApplication = new CTestBootstrapperApplication(pEngine, pArgs);
    ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new test bootstrapper application object.");

    pResults->pfnBootstrapperApplicationProc = BalBaseBootstrapperApplicationProc;
    pResults->pvBootstrapperApplicationProcContext = pApplication;
    *ppApplication = pApplication;
    pApplication = NULL;

LExit:
    ReleaseObject(pApplication);
    return hr;
}