aboutsummaryrefslogtreecommitdiff
path: root/src/wixstdba/wixstdba.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2018-12-31 23:52:58 -0600
committerSean Hall <r.sean.hall@gmail.com>2018-12-31 23:52:58 -0600
commit2c568de11510b453f499827919964badef22304e (patch)
treedd342fa59ad9b986e375c4128726b505ae95ad67 /src/wixstdba/wixstdba.cpp
parentcd23c2cba4239f32abf9743ecec9fef58136e0e8 (diff)
downloadwix-2c568de11510b453f499827919964badef22304e.tar.gz
wix-2c568de11510b453f499827919964badef22304e.tar.bz2
wix-2c568de11510b453f499827919964badef22304e.zip
Import code from old v4 repo
Diffstat (limited to 'src/wixstdba/wixstdba.cpp')
-rw-r--r--src/wixstdba/wixstdba.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/wixstdba/wixstdba.cpp b/src/wixstdba/wixstdba.cpp
new file mode 100644
index 00000000..f47c1f4e
--- /dev/null
+++ b/src/wixstdba/wixstdba.cpp
@@ -0,0 +1,78 @@
1// 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.
2
3#include "precomp.h"
4
5static HINSTANCE vhInstance = NULL;
6
7extern "C" BOOL WINAPI DllMain(
8 IN HINSTANCE hInstance,
9 IN DWORD dwReason,
10 IN LPVOID /* pvReserved */
11 )
12{
13 switch(dwReason)
14 {
15 case DLL_PROCESS_ATTACH:
16 ::DisableThreadLibraryCalls(hInstance);
17 vhInstance = hInstance;
18 break;
19
20 case DLL_PROCESS_DETACH:
21 vhInstance = NULL;
22 break;
23 }
24
25 return TRUE;
26}
27
28
29extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
30 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
31 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
32 )
33{
34 HRESULT hr = S_OK;
35 IBootstrapperEngine* pEngine = NULL;
36
37 hr = BalInitializeFromCreateArgs(pArgs, &pEngine);
38 ExitOnFailure(hr, "Failed to initialize Bal.");
39
40 hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pArgs, pResults);
41 BalExitOnFailure(hr, "Failed to create bootstrapper application interface.");
42
43LExit:
44 ReleaseObject(pEngine);
45
46 return hr;
47}
48
49
50extern "C" void WINAPI BootstrapperApplicationDestroy()
51{
52 BalUninitialize();
53}
54
55
56extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate(
57 __in HRESULT hrHostInitialization,
58 __in IBootstrapperEngine* pEngine,
59 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
60 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
61 )
62{
63 HRESULT hr = S_OK;
64
65 BalInitialize(pEngine);
66
67 hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults);
68 BalExitOnFailure(hr, "Failed to create managed prerequisite bootstrapper application interface.");
69
70LExit:
71 return hr;
72}
73
74
75extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy()
76{
77 BalUninitialize();
78}