summaryrefslogtreecommitdiff
path: root/src/api/burn/bextutil/inc/bextutil.h
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-04-22 05:46:03 -0700
committerRob Mensching <rob@firegiant.com>2021-04-29 16:41:44 -0700
commitc00516901e6b67e398396b14fe7682d0376f8643 (patch)
treeb0d62089a1c5700c7f2c3e3790750bf2d8ea33c0 /src/api/burn/bextutil/inc/bextutil.h
parent8eb98efd2175d9ece2e4639d43081667af9a4990 (diff)
downloadwix-c00516901e6b67e398396b14fe7682d0376f8643.tar.gz
wix-c00516901e6b67e398396b14fe7682d0376f8643.tar.bz2
wix-c00516901e6b67e398396b14fe7682d0376f8643.zip
Move balutil into API/burn
Diffstat (limited to 'src/api/burn/bextutil/inc/bextutil.h')
-rw-r--r--src/api/burn/bextutil/inc/bextutil.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/api/burn/bextutil/inc/bextutil.h b/src/api/burn/bextutil/inc/bextutil.h
new file mode 100644
index 00000000..ac9c0062
--- /dev/null
+++ b/src/api/burn/bextutil/inc/bextutil.h
@@ -0,0 +1,106 @@
1#pragma once
2// 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.
3
4
5#include "dutil.h"
6
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#define BextExitOnFailureSource(d, x, f, ...) if (FAILED(x)) { BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
13#define BextExitOnRootFailureSource(d, x, f, ...) if (FAILED(x)) { BextLogError(x, f, __VA_ARGS__); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
14#define BextExitOnLastErrorSource(d, x, f, ...) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } }
15#define BextExitOnNullSource(d, p, x, e, f, ...) if (NULL == p) { x = e; BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
16#define BextExitOnNullWithLastErrorSource(d, p, x, f, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
17#define BextExitWithLastErrorSource(d, x, f, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } BextLogError(x, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
18
19#define BextExitOnFailure(x, f, ...) BextExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
20#define BextExitOnRootFailure(x, f, ...) BextExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
21#define BextExitOnLastError(x, f, ...) BextExitOnLastErrorSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
22#define BextExitOnNull(p, x, e, f, ...) BextExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, f, __VA_ARGS__)
23#define BextExitOnNullWithLastError(p, x, f, ...) BextExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, f, __VA_ARGS__)
24#define BextExitWithLastError(x, f, ...) BextExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, f, __VA_ARGS__)
25
26const LPCWSTR BUNDLE_EXTENSION_MANIFEST_FILENAME = L"BundleExtensionData.xml";
27
28
29/*******************************************************************
30 BextInitialize - remembers the engine interface to enable logging and
31 other functions.
32
33********************************************************************/
34DAPI_(void) BextInitialize(
35 __in IBundleExtensionEngine* pEngine
36 );
37
38/*******************************************************************
39 BextInitializeFromCreateArgs - convenience function to call BextBundleExtensionEngineCreate
40 then pass it along to BextInitialize.
41
42********************************************************************/
43DAPI_(HRESULT) BextInitializeFromCreateArgs(
44 __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs,
45 __out IBundleExtensionEngine** ppEngine
46 );
47
48/*******************************************************************
49 BextUninitialize - cleans up utility layer internals.
50
51********************************************************************/
52DAPI_(void) BextUninitialize();
53
54/*******************************************************************
55 BextGetBundleExtensionDataNode - gets the requested BundleExtension node.
56
57********************************************************************/
58DAPI_(HRESULT) BextGetBundleExtensionDataNode(
59 __in IXMLDOMDocument* pixdManifest,
60 __in LPCWSTR wzExtensionId,
61 __out IXMLDOMNode** ppixnBundleExtension
62 );
63
64/*******************************************************************
65 BextLog - logs a message with the engine.
66
67********************************************************************/
68DAPIV_(HRESULT) BextLog(
69 __in BUNDLE_EXTENSION_LOG_LEVEL level,
70 __in_z __format_string LPCSTR szFormat,
71 ...
72 );
73
74/*******************************************************************
75 BextLogArgs - logs a message with the engine.
76
77********************************************************************/
78DAPI_(HRESULT) BextLogArgs(
79 __in BUNDLE_EXTENSION_LOG_LEVEL level,
80 __in_z __format_string LPCSTR szFormat,
81 __in va_list args
82 );
83
84/*******************************************************************
85 BextLogError - logs an error message with the engine.
86
87********************************************************************/
88DAPIV_(HRESULT) BextLogError(
89 __in HRESULT hr,
90 __in_z __format_string LPCSTR szFormat,
91 ...
92 );
93
94/*******************************************************************
95 BextLogErrorArgs - logs an error message with the engine.
96
97********************************************************************/
98DAPI_(HRESULT) BextLogErrorArgs(
99 __in HRESULT hr,
100 __in_z __format_string LPCSTR szFormat,
101 __in va_list args
102 );
103
104#ifdef __cplusplus
105}
106#endif