diff options
Diffstat (limited to 'src/ext/Util/be/utilbe.cpp')
-rw-r--r-- | src/ext/Util/be/utilbe.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/ext/Util/be/utilbe.cpp b/src/ext/Util/be/utilbe.cpp new file mode 100644 index 00000000..d9816dc7 --- /dev/null +++ b/src/ext/Util/be/utilbe.cpp | |||
@@ -0,0 +1,41 @@ | |||
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 | #include "BextBaseBundleExtensionProc.h" | ||
5 | |||
6 | static IBundleExtension* vpBundleExtension = NULL; | ||
7 | |||
8 | // function definitions | ||
9 | |||
10 | extern "C" HRESULT WINAPI BundleExtensionCreate( | ||
11 | __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs, | ||
12 | __inout BUNDLE_EXTENSION_CREATE_RESULTS* pResults | ||
13 | ) | ||
14 | { | ||
15 | HRESULT hr = S_OK; | ||
16 | IBundleExtensionEngine* pEngine = NULL; | ||
17 | |||
18 | hr = XmlInitialize(); | ||
19 | ExitOnFailure(hr, "Failed to initialize XML."); | ||
20 | |||
21 | hr = BextInitializeFromCreateArgs(pArgs, &pEngine); | ||
22 | ExitOnFailure(hr, "Failed to initialize bext"); | ||
23 | |||
24 | hr = UtilBundleExtensionCreate(pEngine, pArgs, &vpBundleExtension); | ||
25 | BextExitOnFailure(hr, "Failed to create WixUtilBundleExtension"); | ||
26 | |||
27 | pResults->pfnBundleExtensionProc = BextBaseBundleExtensionProc; | ||
28 | pResults->pvBundleExtensionProcContext = vpBundleExtension; | ||
29 | |||
30 | LExit: | ||
31 | ReleaseObject(pEngine); | ||
32 | |||
33 | return hr; | ||
34 | } | ||
35 | |||
36 | extern "C" void WINAPI BundleExtensionDestroy() | ||
37 | { | ||
38 | BextUninitialize(); | ||
39 | ReleaseNullObject(vpBundleExtension); | ||
40 | XmlUninitialize(); | ||
41 | } \ No newline at end of file | ||