diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-11 07:48:19 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-11 07:48:19 -0700 |
| commit | 32112ecd939d36cd14603f09283f825dea4f07c8 (patch) | |
| tree | 462ab108952a0c67f9140dfeaf0b4fa079f87199 /src/ext/Bal/Samples/bafunctions/bafunctions.cpp | |
| parent | 0923aba915ca2450cc87e3e2c6c0e4e3d2b28294 (diff) | |
| parent | ba7bab476501c16e437b0aee71c1be02c3dda176 (diff) | |
| download | wix-32112ecd939d36cd14603f09283f825dea4f07c8.tar.gz wix-32112ecd939d36cd14603f09283f825dea4f07c8.tar.bz2 wix-32112ecd939d36cd14603f09283f825dea4f07c8.zip | |
Merge Bal.wixext
Diffstat (limited to 'src/ext/Bal/Samples/bafunctions/bafunctions.cpp')
| -rw-r--r-- | src/ext/Bal/Samples/bafunctions/bafunctions.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/ext/Bal/Samples/bafunctions/bafunctions.cpp b/src/ext/Bal/Samples/bafunctions/bafunctions.cpp new file mode 100644 index 00000000..b20f4230 --- /dev/null +++ b/src/ext/Bal/Samples/bafunctions/bafunctions.cpp | |||
| @@ -0,0 +1,46 @@ | |||
| 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 | |||
| 5 | static HINSTANCE vhInstance = NULL; | ||
| 6 | |||
| 7 | extern "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 | extern "C" HRESULT WINAPI BAFunctionsCreate( | ||
| 29 | __in const BA_FUNCTIONS_CREATE_ARGS* pArgs, | ||
| 30 | __inout BA_FUNCTIONS_CREATE_RESULTS* pResults | ||
| 31 | ) | ||
| 32 | { | ||
| 33 | HRESULT hr = S_OK; | ||
| 34 | |||
| 35 | hr = CreateBAFunctions(vhInstance, pArgs, pResults); | ||
| 36 | BalExitOnFailure(hr, "Failed to create BAFunctions interface."); | ||
| 37 | |||
| 38 | LExit: | ||
| 39 | return hr; | ||
| 40 | } | ||
| 41 | |||
| 42 | extern "C" void WINAPI BAFunctionsDestroy( | ||
| 43 | ) | ||
| 44 | { | ||
| 45 | BalUninitialize(); | ||
| 46 | } | ||
