diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-10-06 16:37:14 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-10-10 11:40:02 -0500 |
commit | 21a0685ef69e9d634600622b19ea970c6f58ef03 (patch) | |
tree | 5d37e316803f06d97d4aefd3df8ab45f3f7e7257 /src/ext/NetFx/be/netfxbe.cpp | |
parent | 3c11c1389f67824fb1f368cedacbaf566645e56f (diff) | |
download | wix-21a0685ef69e9d634600622b19ea970c6f58ef03.tar.gz wix-21a0685ef69e9d634600622b19ea970c6f58ef03.tar.bz2 wix-21a0685ef69e9d634600622b19ea970c6f58ef03.zip |
Add Netfx bundle extension and netfx:DotNetCoreSearch.
Remove built-in .NET Core packages since they update too quickly.
Fixes 6257
Diffstat (limited to 'src/ext/NetFx/be/netfxbe.cpp')
-rw-r--r-- | src/ext/NetFx/be/netfxbe.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/ext/NetFx/be/netfxbe.cpp b/src/ext/NetFx/be/netfxbe.cpp new file mode 100644 index 00000000..3a34cea3 --- /dev/null +++ b/src/ext/NetFx/be/netfxbe.cpp | |||
@@ -0,0 +1,62 @@ | |||
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 HINSTANCE vhInstance = NULL; | ||
7 | static IBundleExtension* vpBundleExtension = NULL; | ||
8 | |||
9 | // function definitions | ||
10 | |||
11 | extern "C" BOOL WINAPI DllMain( | ||
12 | __in HINSTANCE hInstance, | ||
13 | __in DWORD dwReason, | ||
14 | __in LPVOID /*pvReserved*/ | ||
15 | ) | ||
16 | { | ||
17 | switch(dwReason) | ||
18 | { | ||
19 | case DLL_PROCESS_ATTACH: | ||
20 | vhInstance = hInstance; | ||
21 | break; | ||
22 | |||
23 | case DLL_PROCESS_DETACH: | ||
24 | vhInstance = NULL; | ||
25 | break; | ||
26 | } | ||
27 | |||
28 | return TRUE; | ||
29 | } | ||
30 | |||
31 | extern "C" HRESULT WINAPI BundleExtensionCreate( | ||
32 | __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs, | ||
33 | __inout BUNDLE_EXTENSION_CREATE_RESULTS* pResults | ||
34 | ) | ||
35 | { | ||
36 | HRESULT hr = S_OK; | ||
37 | IBundleExtensionEngine* pEngine = NULL; | ||
38 | |||
39 | hr = XmlInitialize(); | ||
40 | ExitOnFailure(hr, "Failed to initialize XML."); | ||
41 | |||
42 | hr = BextInitializeFromCreateArgs(pArgs, &pEngine); | ||
43 | ExitOnFailure(hr, "Failed to initialize bext"); | ||
44 | |||
45 | hr = NetfxBundleExtensionCreate(vhInstance, pEngine, pArgs, &vpBundleExtension); | ||
46 | BextExitOnFailure(hr, "Failed to create WixNetfxBundleExtension"); | ||
47 | |||
48 | pResults->pfnBundleExtensionProc = BextBaseBundleExtensionProc; | ||
49 | pResults->pvBundleExtensionProcContext = vpBundleExtension; | ||
50 | |||
51 | LExit: | ||
52 | ReleaseObject(pEngine); | ||
53 | |||
54 | return hr; | ||
55 | } | ||
56 | |||
57 | extern "C" void WINAPI BundleExtensionDestroy() | ||
58 | { | ||
59 | BextUninitialize(); | ||
60 | ReleaseNullObject(vpBundleExtension); | ||
61 | XmlUninitialize(); | ||
62 | } | ||