aboutsummaryrefslogtreecommitdiff
path: root/src/bextutil/inc/bextutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bextutil/inc/bextutil.h')
-rw-r--r--src/bextutil/inc/bextutil.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/bextutil/inc/bextutil.h b/src/bextutil/inc/bextutil.h
new file mode 100644
index 00000000..0472f854
--- /dev/null
+++ b/src/bextutil/inc/bextutil.h
@@ -0,0 +1,76 @@
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 BextExitOnFailure(x, f, ...) if (FAILED(x)) { BextLogError(x, f, __VA_ARGS__); ExitTrace(x, f, __VA_ARGS__); goto LExit; }
13#define BextExitOnRootFailure(x, f, ...) if (FAILED(x)) { BextLogError(x, f, __VA_ARGS__); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, f, __VA_ARGS__); goto LExit; }
14#define BextExitOnNullWithLastError(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__); ExitTrace(x, f, __VA_ARGS__); goto LExit; }
15
16const LPCWSTR BUNDLE_EXTENSION_MANIFEST_FILENAME = L"BundleExtensionData.xml";
17
18
19/*******************************************************************
20 BextInitialize - remembers the engine interface to enable logging and
21 other functions.
22
23********************************************************************/
24DAPI_(void) BextInitialize(
25 __in IBundleExtensionEngine* pEngine
26 );
27
28/*******************************************************************
29 BextInitializeFromCreateArgs - convenience function to call BextBundleExtensionEngineCreate
30 then pass it along to BextInitialize.
31
32********************************************************************/
33DAPI_(HRESULT) BextInitializeFromCreateArgs(
34 __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs,
35 __out IBundleExtensionEngine** ppEngine
36 );
37
38/*******************************************************************
39 BextUninitialize - cleans up utility layer internals.
40
41********************************************************************/
42DAPI_(void) BextUninitialize();
43
44/*******************************************************************
45 BextGetBundleExtensionDataNode - gets the requested BundleExtension node.
46
47********************************************************************/
48DAPI_(HRESULT) BextGetBundleExtensionDataNode(
49 __in IXMLDOMDocument* pixdManifest,
50 __in LPCWSTR wzExtensionId,
51 __out IXMLDOMNode** ppixnBundleExtension
52 );
53
54/*******************************************************************
55 BextLog - logs a message with the engine.
56
57********************************************************************/
58DAPIV_(HRESULT) BextLog(
59 __in BUNDLE_EXTENSION_LOG_LEVEL level,
60 __in_z __format_string LPCSTR szFormat,
61 ...
62 );
63
64/*******************************************************************
65 BextLogError - logs an error message with the engine.
66
67********************************************************************/
68DAPIV_(HRESULT) BextLogError(
69 __in HRESULT hr,
70 __in_z __format_string LPCSTR szFormat,
71 ...
72 );
73
74#ifdef __cplusplus
75}
76#endif