aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h')
-rw-r--r--src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h430
1 files changed, 430 insertions, 0 deletions
diff --git a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
new file mode 100644
index 00000000..0dcaba75
--- /dev/null
+++ b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
@@ -0,0 +1,430 @@
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)
6extern "C" {
7#endif
8
9#define IDERROR -1
10#define IDNOACTION 0
11
12#ifndef FACILITY_WIX
13#define FACILITY_WIX 500
14#endif
15
16static const HRESULT E_SUSPECTED_AV_INTERFERENCE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIX, 2000);
17
18// Note that ordering of the enumeration values is important.
19// Some code paths use < or > comparisions and simply reording values will break those comparisons.
20enum BOOTSTRAPPER_ACTION
21{
22 BOOTSTRAPPER_ACTION_UNKNOWN,
23 BOOTSTRAPPER_ACTION_HELP,
24 BOOTSTRAPPER_ACTION_LAYOUT,
25 BOOTSTRAPPER_ACTION_UNINSTALL,
26 BOOTSTRAPPER_ACTION_CACHE,
27 BOOTSTRAPPER_ACTION_INSTALL,
28 BOOTSTRAPPER_ACTION_MODIFY,
29 BOOTSTRAPPER_ACTION_REPAIR,
30 BOOTSTRAPPER_ACTION_UPDATE_REPLACE,
31 BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED,
32};
33
34enum BOOTSTRAPPER_ACTION_STATE
35{
36 BOOTSTRAPPER_ACTION_STATE_NONE,
37 BOOTSTRAPPER_ACTION_STATE_UNINSTALL,
38 BOOTSTRAPPER_ACTION_STATE_INSTALL,
39 BOOTSTRAPPER_ACTION_STATE_ADMIN_INSTALL,
40 BOOTSTRAPPER_ACTION_STATE_MODIFY,
41 BOOTSTRAPPER_ACTION_STATE_REPAIR,
42 BOOTSTRAPPER_ACTION_STATE_MINOR_UPGRADE,
43 BOOTSTRAPPER_ACTION_STATE_MAJOR_UPGRADE,
44 BOOTSTRAPPER_ACTION_STATE_PATCH,
45};
46
47enum BOOTSTRAPPER_PACKAGE_STATE
48{
49 BOOTSTRAPPER_PACKAGE_STATE_UNKNOWN,
50 BOOTSTRAPPER_PACKAGE_STATE_OBSOLETE,
51 BOOTSTRAPPER_PACKAGE_STATE_ABSENT,
52 BOOTSTRAPPER_PACKAGE_STATE_CACHED,
53 BOOTSTRAPPER_PACKAGE_STATE_PRESENT,
54 BOOTSTRAPPER_PACKAGE_STATE_SUPERSEDED,
55};
56
57enum BOOTSTRAPPER_REQUEST_STATE
58{
59 BOOTSTRAPPER_REQUEST_STATE_NONE,
60 BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT,
61 BOOTSTRAPPER_REQUEST_STATE_ABSENT,
62 BOOTSTRAPPER_REQUEST_STATE_CACHE,
63 BOOTSTRAPPER_REQUEST_STATE_PRESENT,
64 BOOTSTRAPPER_REQUEST_STATE_REPAIR,
65};
66
67enum BOOTSTRAPPER_FEATURE_STATE
68{
69 BOOTSTRAPPER_FEATURE_STATE_UNKNOWN,
70 BOOTSTRAPPER_FEATURE_STATE_ABSENT,
71 BOOTSTRAPPER_FEATURE_STATE_ADVERTISED,
72 BOOTSTRAPPER_FEATURE_STATE_LOCAL,
73 BOOTSTRAPPER_FEATURE_STATE_SOURCE,
74};
75
76enum BOOTSTRAPPER_FEATURE_ACTION
77{
78 BOOTSTRAPPER_FEATURE_ACTION_NONE,
79 BOOTSTRAPPER_FEATURE_ACTION_ADDLOCAL,
80 BOOTSTRAPPER_FEATURE_ACTION_ADDSOURCE,
81 BOOTSTRAPPER_FEATURE_ACTION_ADDDEFAULT,
82 BOOTSTRAPPER_FEATURE_ACTION_REINSTALL,
83 BOOTSTRAPPER_FEATURE_ACTION_ADVERTISE,
84 BOOTSTRAPPER_FEATURE_ACTION_REMOVE,
85};
86
87enum BOOTSTRAPPER_LOG_LEVEL
88{
89 BOOTSTRAPPER_LOG_LEVEL_NONE, // turns off report (only valid for XXXSetLevel())
90 BOOTSTRAPPER_LOG_LEVEL_STANDARD, // written if reporting is on
91 BOOTSTRAPPER_LOG_LEVEL_VERBOSE, // written only if verbose reporting is on
92 BOOTSTRAPPER_LOG_LEVEL_DEBUG, // reporting useful when debugging code
93 BOOTSTRAPPER_LOG_LEVEL_ERROR, // always gets reported, but can never be specified
94};
95
96enum BOOTSTRAPPER_UPDATE_HASH_TYPE
97{
98 BOOTSTRAPPER_UPDATE_HASH_TYPE_NONE,
99 BOOTSTRAPPER_UPDATE_HASH_TYPE_SHA1,
100};
101
102enum BOOTSTRAPPER_ENGINE_MESSAGE
103{
104 BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT,
105 BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC,
106 BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING,
107 BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION,
108 BOOTSTRAPPER_ENGINE_MESSAGE_FORMATSTRING,
109 BOOTSTRAPPER_ENGINE_MESSAGE_ESCAPESTRING,
110 BOOTSTRAPPER_ENGINE_MESSAGE_EVALUATECONDITION,
111 BOOTSTRAPPER_ENGINE_MESSAGE_LOG,
112 BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDERROR,
113 BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDPROGRESS,
114 BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATE,
115 BOOTSTRAPPER_ENGINE_MESSAGE_SETLOCALSOURCE,
116 BOOTSTRAPPER_ENGINE_MESSAGE_SETDOWNLOADSOURCE,
117 BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLENUMERIC,
118 BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLESTRING,
119 BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLEVERSION,
120 BOOTSTRAPPER_ENGINE_MESSAGE_CLOSESPLASHSCREEN,
121 BOOTSTRAPPER_ENGINE_MESSAGE_DETECT,
122 BOOTSTRAPPER_ENGINE_MESSAGE_PLAN,
123 BOOTSTRAPPER_ENGINE_MESSAGE_ELEVATE,
124 BOOTSTRAPPER_ENGINE_MESSAGE_APPLY,
125 BOOTSTRAPPER_ENGINE_MESSAGE_QUIT,
126 BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE,
127};
128
129typedef struct _BAENGINE_APPLY_ARGS
130{
131 DWORD cbSize;
132 HWND hwndParent;
133} BAENGINE_APPLY_ARGS;
134
135typedef struct _BAENGINE_APPLY_RESULTS
136{
137 DWORD cbSize;
138} BAENGINE_APPLY_RESULTS;
139
140typedef struct _BAENGINE_CLOSESPLASHSCREEN_ARGS
141{
142 DWORD cbSize;
143} BAENGINE_CLOSESPLASHSCREEN_ARGS;
144
145typedef struct _BAENGINE_CLOSESPLASHSCREEN_RESULTS
146{
147 DWORD cbSize;
148} BAENGINE_CLOSESPLASHSCREEN_RESULTS;
149
150typedef struct _BAENGINE_DETECT_ARGS
151{
152 DWORD cbSize;
153 HWND hwndParent;
154} BAENGINE_DETECT_ARGS;
155
156typedef struct _BAENGINE_DETECT_RESULTS
157{
158 DWORD cbSize;
159} BAENGINE_DETECT_RESULTS;
160
161typedef struct _BAENGINE_ELEVATE_ARGS
162{
163 DWORD cbSize;
164 HWND hwndParent;
165} BAENGINE_ELEVATE_ARGS;
166
167typedef struct _BAENGINE_ELEVATE_RESULTS
168{
169 DWORD cbSize;
170} BAENGINE_ELEVATE_RESULTS;
171
172typedef struct _BAENGINE_ESCAPESTRING_ARGS
173{
174 DWORD cbSize;
175 LPCWSTR wzIn;
176} BAENGINE_ESCAPESTRING_ARGS;
177
178typedef struct _BAENGINE_ESCAPESTRING_RESULTS
179{
180 DWORD cbSize;
181 LPWSTR wzOut;
182 // Should be initialized to the size of wzOut.
183 DWORD cchOut;
184} BAENGINE_ESCAPESTRING_RESULTS;
185
186typedef struct _BAENGINE_EVALUATECONDITION_ARGS
187{
188 DWORD cbSize;
189 LPCWSTR wzCondition;
190} BAENGINE_EVALUATECONDITION_ARGS;
191
192typedef struct _BAENGINE_EVALUATECONDITION_RESULTS
193{
194 DWORD cbSize;
195 BOOL f;
196} BAENGINE_EVALUATECONDITION_RESULTS;
197
198typedef struct _BAENGINE_FORMATSTRING_ARGS
199{
200 DWORD cbSize;
201 LPCWSTR wzIn;
202} BAENGINE_FORMATSTRING_ARGS;
203
204typedef struct _BAENGINE_FORMATSTRING_RESULTS
205{
206 DWORD cbSize;
207 // The contents of wzOut may be sensitive, should keep encrypted and SecureZeroFree.
208 LPWSTR wzOut;
209 // Should be initialized to the size of wzOut.
210 DWORD cchOut;
211} BAENGINE_FORMATSTRING_RESULTS;
212
213typedef struct _BAENGINE_GETPACKAGECOUNT_ARGS
214{
215 DWORD cbSize;
216} BAENGINE_GETPACKAGECOUNT_ARGS;
217
218typedef struct _BAENGINE_GETPACKAGECOUNT_RESULTS
219{
220 DWORD cbSize;
221 DWORD cPackages;
222} BAENGINE_GETPACKAGECOUNT_RESULTS;
223
224typedef struct _BAENGINE_GETVARIABLENUMERIC_ARGS
225{
226 DWORD cbSize;
227 LPCWSTR wzVariable;
228} BAENGINE_GETVARIABLENUMERIC_ARGS;
229
230typedef struct _BAENGINE_GETVARIABLENUMERIC_RESULTS
231{
232 DWORD cbSize;
233 // The contents of llValue may be sensitive, if variable is hidden should keep value encrypted and SecureZeroMemory.
234 LONGLONG llValue;
235} BAENGINE_GETVARIABLENUMERIC_RESULTS;
236
237typedef struct _BAENGINE_GETVARIABLESTRING_ARGS
238{
239 DWORD cbSize;
240 LPCWSTR wzVariable;
241} BAENGINE_GETVARIABLESTRING_ARGS;
242
243typedef struct _BAENGINE_GETVARIABLESTRING_RESULTS
244{
245 DWORD cbSize;
246 // The contents of wzValue may be sensitive, if variable is hidden should keep value encrypted and SecureZeroFree.
247 LPWSTR wzValue;
248 // Should be initialized to the size of wzValue.
249 DWORD cchValue;
250} BAENGINE_GETVARIABLESTRING_RESULTS;
251
252typedef struct _BAENGINE_GETVARIABLEVERSION_ARGS
253{
254 DWORD cbSize;
255 LPCWSTR wzVariable;
256} BAENGINE_GETVARIABLEVERSION_ARGS;
257
258typedef struct _BAENGINE_GETVARIABLEVERSION_RESULTS
259{
260 DWORD cbSize;
261 // The contents of qwValue may be sensitive, if variable is hidden should keep value encrypted and SecureZeroMemory.
262 DWORD64 qwValue;
263} BAENGINE_GETVARIABLEVERSION_RESULTS;
264
265typedef struct _BAENGINE_LAUNCHAPPROVEDEXE_ARGS
266{
267 DWORD cbSize;
268 HWND hwndParent;
269 LPCWSTR wzApprovedExeForElevationId;
270 LPCWSTR wzArguments;
271 DWORD dwWaitForInputIdleTimeout;
272} BAENGINE_LAUNCHAPPROVEDEXE_ARGS;
273
274typedef struct _BAENGINE_LAUNCHAPPROVEDEXE_RESULTS
275{
276 DWORD cbSize;
277} BAENGINE_LAUNCHAPPROVEDEXE_RESULTS;
278
279typedef struct _BAENGINE_LOG_ARGS
280{
281 DWORD cbSize;
282 BOOTSTRAPPER_LOG_LEVEL level;
283 LPCWSTR wzMessage;
284} BAENGINE_LOG_ARGS;
285
286typedef struct _BAENGINE_LOG_RESULTS
287{
288 DWORD cbSize;
289} BAENGINE_LOG_RESULTS;
290
291typedef struct _BAENGINE_PLAN_ARGS
292{
293 DWORD cbSize;
294 BOOTSTRAPPER_ACTION action;
295} BAENGINE_PLAN_ARGS;
296
297typedef struct _BAENGINE_PLAN_RESULTS
298{
299 DWORD cbSize;
300} BAENGINE_PLAN_RESULTS;
301
302typedef struct _BAENGINE_QUIT_ARGS
303{
304 DWORD cbSize;
305 DWORD dwExitCode;
306} BAENGINE_QUIT_ARGS;
307
308typedef struct _BAENGINE_QUIT_RESULTS
309{
310 DWORD cbSize;
311} BAENGINE_QUIT_RESULTS;
312
313typedef struct _BAENGINE_SENDEMBEDDEDERROR_ARGS
314{
315 DWORD cbSize;
316 DWORD dwErrorCode;
317 LPCWSTR wzMessage;
318 DWORD dwUIHint;
319} BAENGINE_SENDEMBEDDEDERROR_ARGS;
320
321typedef struct _BAENGINE_SENDEMBEDDEDERROR_RESULTS
322{
323 DWORD cbSize;
324 int nResult;
325} BAENGINE_SENDEMBEDDEDERROR_RESULTS;
326
327typedef struct _BAENGINE_SENDEMBEDDEDPROGRESS_ARGS
328{
329 DWORD cbSize;
330 DWORD dwProgressPercentage;
331 DWORD dwOverallProgressPercentage;
332} BAENGINE_SENDEMBEDDEDPROGRESS_ARGS;
333
334typedef struct _BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS
335{
336 DWORD cbSize;
337 int nResult;
338} BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS;
339
340typedef struct _BAENGINE_SETDOWNLOADSOURCE_ARGS
341{
342 DWORD cbSize;
343 LPCWSTR wzPackageOrContainerId;
344 LPCWSTR wzPayloadId;
345 LPCWSTR wzUrl;
346 LPCWSTR wzUser;
347 LPCWSTR wzPassword;
348} BAENGINE_SETDOWNLOADSOURCE_ARGS;
349
350typedef struct _BAENGINE_SETDOWNLOADSOURCE_RESULTS
351{
352 DWORD cbSize;
353} BAENGINE_SETDOWNLOADSOURCE_RESULTS;
354
355typedef struct _BAENGINE_SETLOCALSOURCE_ARGS
356{
357 DWORD cbSize;
358 LPCWSTR wzPackageOrContainerId;
359 LPCWSTR wzPayloadId;
360 LPCWSTR wzPath;
361} BAENGINE_SETLOCALSOURCE_ARGS;
362
363typedef struct _BAENGINE_SETLOCALSOURCE_RESULTS
364{
365 DWORD cbSize;
366} BAENGINE_SETLOCALSOURCE_RESULTS;
367
368typedef struct _BAENGINE_SETUPDATE_ARGS
369{
370 DWORD cbSize;
371 LPCWSTR wzLocalSource;
372 LPCWSTR wzDownloadSource;
373 DWORD64 qwSize;
374 BOOTSTRAPPER_UPDATE_HASH_TYPE hashType;
375 BYTE* rgbHash;
376 DWORD cbHash;
377} BAENGINE_SETUPDATE_ARGS;
378
379typedef struct _BAENGINE_SETUPDATE_RESULTS
380{
381 DWORD cbSize;
382} BAENGINE_SETUPDATE_RESULTS;
383
384typedef struct _BAENGINE_SETVARIABLENUMERIC_ARGS
385{
386 DWORD cbSize;
387 LPCWSTR wzVariable;
388 LONGLONG llValue;
389} BAENGINE_SETVARIABLENUMERIC_ARGS;
390
391typedef struct _BAENGINE_SETVARIABLENUMERIC_RESULTS
392{
393 DWORD cbSize;
394} BAENGINE_SETVARIABLENUMERIC_RESULTS;
395
396typedef struct _BAENGINE_SETVARIABLESTRING_ARGS
397{
398 DWORD cbSize;
399 LPCWSTR wzVariable;
400 LPCWSTR wzValue;
401} BAENGINE_SETVARIABLESTRING_ARGS;
402
403typedef struct _BAENGINE_SETVARIABLESTRING_RESULTS
404{
405 DWORD cbSize;
406} BAENGINE_SETVARIABLESTRING_RESULTS;
407
408typedef struct _BAENGINE_SETVARIABLEVERSION_ARGS
409{
410 DWORD cbSize;
411 LPCWSTR wzVariable;
412 DWORD64 qwValue;
413} BAENGINE_SETVARIABLEVERSION_ARGS;
414
415typedef struct _BAENGINE_SETVARIABLEVERSION_RESULTS
416{
417 DWORD cbSize;
418} BAENGINE_SETVARIABLEVERSION_RESULTS;
419
420
421extern "C" typedef HRESULT(WINAPI *PFN_BOOTSTRAPPER_ENGINE_PROC)(
422 __in BOOTSTRAPPER_ENGINE_MESSAGE message,
423 __in const LPVOID pvArgs,
424 __inout LPVOID pvResults,
425 __in_opt LPVOID pvContext
426 );
427
428#if defined(__cplusplus)
429}
430#endif