main
h 191 lines 4.95 KB
Raw
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 #if defined(__cplusplus)
6 extern "C" {
7 #endif
8
9
10 // constants
11
12 const LPCWSTR VARIABLE_DATE = L"Date";
13 const LPCWSTR VARIABLE_LOGONUSER = L"LogonUser";
14 const LPCWSTR VARIABLE_INSTALLERNAME = L"InstallerName";
15 const LPCWSTR VARIABLE_INSTALLERVERSION = L"InstallerVersion";
16 const LPCWSTR VARIABLE_INSTALLERINFORMATIONALVERSION = L"InstallerInformationalVersion";
17 const LPCWSTR VARIABLE_REBOOTPENDING = L"RebootPending";
18
19
20 // typedefs
21
22 typedef HRESULT (*PFN_INITIALIZEVARIABLE)(
23 __in DWORD_PTR dwpData,
24 __inout BURN_VARIANT* pValue
25 );
26
27
28 // constants
29
30 enum BURN_VARIABLE_INTERNAL_TYPE
31 {
32 BURN_VARIABLE_INTERNAL_TYPE_NORMAL, // the BA can set this variable.
33 BURN_VARIABLE_INTERNAL_TYPE_OVERRIDABLE_BUILTIN, // the BA can't set this variable, but the unelevated process can serialize it to the elevated process.
34 BURN_VARIABLE_INTERNAL_TYPE_BUILTIN, // the BA can't set this variable, and the unelevated process can't serialize it to the elevated process.
35 };
36
37
38 // structs
39
40 typedef struct _BURN_VARIABLE
41 {
42 LPWSTR sczName;
43 BURN_VARIANT Value;
44 BOOL fHidden;
45 BOOL fPersisted;
46
47 // used for late initialization of built-in variables
48 BURN_VARIABLE_INTERNAL_TYPE internalType;
49 PFN_INITIALIZEVARIABLE pfnInitialize;
50 DWORD_PTR dwpInitializeData;
51 } BURN_VARIABLE;
52
53 typedef struct _BURN_VARIABLES
54 {
55 CRITICAL_SECTION csAccess;
56 DWORD dwMaxVariables;
57 DWORD cVariables;
58 BURN_VARIABLE* rgVariables;
59 } BURN_VARIABLES;
60
61
62 // function declarations
63
64 HRESULT VariableInitialize(
65 __in BURN_VARIABLES* pVariables
66 );
67 HRESULT VariablesParseFromXml(
68 __in BURN_VARIABLES* pVariables,
69 __in IXMLDOMNode* pixnBundle
70 );
71 void VariablesUninitialize(
72 __in BURN_VARIABLES* pVariables
73 );
74 void VariablesDump(
75 __in BURN_VARIABLES* pVariables
76 );
77 HRESULT VariableGetNumeric(
78 __in BURN_VARIABLES* pVariables,
79 __in_z LPCWSTR wzVariable,
80 __out LONGLONG* pllValue
81 );
82 HRESULT VariableGetString(
83 __in BURN_VARIABLES* pVariables,
84 __in_z LPCWSTR wzVariable,
85 __out_z LPWSTR* psczValue
86 );
87 HRESULT VariableGetVersion(
88 __in BURN_VARIABLES* pVariables,
89 __in_z LPCWSTR wzVariable,
90 __in VERUTIL_VERSION** ppValue
91 );
92 HRESULT VariableGetVariant(
93 __in BURN_VARIABLES* pVariables,
94 __in_z LPCWSTR wzVariable,
95 __in BURN_VARIANT* pValue
96 );
97 HRESULT VariableGetFormatted(
98 __in BURN_VARIABLES* pVariables,
99 __in_z LPCWSTR wzVariable,
100 __out_z LPWSTR* psczValue,
101 __out BOOL* pfContainsHiddenVariable
102 );
103 HRESULT VariableSetNumeric(
104 __in BURN_VARIABLES* pVariables,
105 __in_z LPCWSTR wzVariable,
106 __in LONGLONG llValue,
107 __in BOOL fOverwriteBuiltIn
108 );
109 HRESULT VariableSetString(
110 __in BURN_VARIABLES* pVariables,
111 __in_z LPCWSTR wzVariable,
112 __in_z_opt LPCWSTR wzValue,
113 __in BOOL fOverwriteBuiltIn,
114 __in BOOL fFormatted
115 );
116 HRESULT VariableSetVersion(
117 __in BURN_VARIABLES* pVariables,
118 __in_z LPCWSTR wzVariable,
119 __in VERUTIL_VERSION* pValue,
120 __in BOOL fOverwriteBuiltIn
121 );
122 HRESULT VariableSetVariant(
123 __in BURN_VARIABLES* pVariables,
124 __in_z LPCWSTR wzVariable,
125 __in BURN_VARIANT* pVariant
126 );
127 HRESULT VariableFormatString(
128 __in BURN_VARIABLES* pVariables,
129 __in_z LPCWSTR wzIn,
130 __out_z_opt LPWSTR* psczOut,
131 __out_opt SIZE_T* pcchOut
132 );
133 HRESULT VariableFormatStringObfuscated(
134 __in BURN_VARIABLES* pVariables,
135 __in_z LPCWSTR wzIn,
136 __out_z_opt LPWSTR* psczOut,
137 __out_opt SIZE_T* pcchOut
138 );
139 HRESULT VariableEscapeString(
140 __in_z LPCWSTR wzIn,
141 __out_z LPWSTR* psczOut
142 );
143 HRESULT VariableSerialize(
144 __in BURN_VARIABLES* pVariables,
145 __in BOOL fPersisting,
146 __inout BYTE** ppbBuffer,
147 __inout SIZE_T* piBuffer
148 );
149 HRESULT VariableDeserialize(
150 __in BURN_VARIABLES* pVariables,
151 __in BOOL fWasPersisted,
152 __in_bcount(cbBuffer) BYTE* pbBuffer,
153 __in SIZE_T cbBuffer,
154 __inout SIZE_T* piBuffer
155 );
156 HRESULT VariableStrAlloc(
157 __in BOOL fZeroOnRealloc,
158 __deref_out_ecount_part(cch, 0) LPWSTR* ppwz,
159 __in DWORD_PTR cch
160 );
161 HRESULT VariableStrAllocString(
162 __in BOOL fZeroOnRealloc,
163 __deref_out_ecount_z(cchSource + 1) LPWSTR* ppwz,
164 __in_z LPCWSTR wzSource,
165 __in DWORD_PTR cchSource
166 );
167 HRESULT VariableStrAllocConcat(
168 __in BOOL fZeroOnRealloc,
169 __deref_out_z LPWSTR* ppwz,
170 __in_z LPCWSTR wzSource,
171 __in DWORD_PTR cchSource
172 );
173 HRESULT __cdecl VariableStrAllocFormatted(
174 __in BOOL fZeroOnRealloc,
175 __deref_out_z LPWSTR* ppwz,
176 __in __format_string LPCWSTR wzFormat,
177 ...
178 );
179 HRESULT VariableIsHidden(
180 __in BURN_VARIABLES* pVariables,
181 __in_z LPCWSTR wzVariable,
182 __out BOOL* pfHidden
183 );
184 BOOL VariableIsHiddenCommandLine(
185 __in BURN_VARIABLES* pVariables,
186 __in_z LPCWSTR wzVariable
187 );
188
189 #if defined(__cplusplus)
190 }
191 #endif