diff options
author | Rob Mensching <rob@firegiant.com> | 2024-01-11 18:26:20 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2024-03-06 18:03:38 -0800 |
commit | 0d3d54992104288e9ee0c834d0b96e8502fd2d42 (patch) | |
tree | 9efa49c4983cd2ba1becab64bd1f2faccac88acf /src/burn/engine/EngineForApplication.cpp | |
parent | 2824298d9dd817a47527c920363556b54ead5d5d (diff) | |
download | wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.tar.gz wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.tar.bz2 wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.zip |
Move the BootstrapperApplication out of proc
Diffstat (limited to 'src/burn/engine/EngineForApplication.cpp')
-rw-r--r-- | src/burn/engine/EngineForApplication.cpp | 548 |
1 files changed, 0 insertions, 548 deletions
diff --git a/src/burn/engine/EngineForApplication.cpp b/src/burn/engine/EngineForApplication.cpp deleted file mode 100644 index eb77cc50..00000000 --- a/src/burn/engine/EngineForApplication.cpp +++ /dev/null | |||
@@ -1,548 +0,0 @@ | |||
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 | |||
6 | static HRESULT BAEngineGetPackageCount( | ||
7 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
8 | __in const LPVOID pvArgs, | ||
9 | __inout LPVOID pvResults | ||
10 | ) | ||
11 | { | ||
12 | HRESULT hr = S_OK; | ||
13 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETPACKAGECOUNT_ARGS, pArgs); | ||
14 | ValidateMessageResults(hr, pvResults, BAENGINE_GETPACKAGECOUNT_RESULTS, pResults); | ||
15 | |||
16 | ExternalEngineGetPackageCount(pContext->pEngineState, &pResults->cPackages); | ||
17 | |||
18 | LExit: | ||
19 | return hr; | ||
20 | } | ||
21 | |||
22 | static HRESULT BAEngineGetVariableNumeric( | ||
23 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
24 | __in const LPVOID pvArgs, | ||
25 | __inout LPVOID pvResults | ||
26 | ) | ||
27 | { | ||
28 | HRESULT hr = S_OK; | ||
29 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETVARIABLENUMERIC_ARGS, pArgs); | ||
30 | ValidateMessageResults(hr, pvResults, BAENGINE_GETVARIABLENUMERIC_RESULTS, pResults); | ||
31 | |||
32 | hr = ExternalEngineGetVariableNumeric(pContext->pEngineState, pArgs->wzVariable, &pResults->llValue); | ||
33 | |||
34 | LExit: | ||
35 | return hr; | ||
36 | } | ||
37 | |||
38 | static HRESULT BAEngineGetVariableString( | ||
39 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
40 | __in const LPVOID pvArgs, | ||
41 | __inout LPVOID pvResults | ||
42 | ) | ||
43 | { | ||
44 | HRESULT hr = S_OK; | ||
45 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETVARIABLESTRING_ARGS, pArgs); | ||
46 | ValidateMessageResults(hr, pvResults, BAENGINE_GETVARIABLESTRING_RESULTS, pResults); | ||
47 | |||
48 | hr = ExternalEngineGetVariableString(pContext->pEngineState, pArgs->wzVariable, pResults->wzValue, &pResults->cchValue); | ||
49 | |||
50 | LExit: | ||
51 | return hr; | ||
52 | } | ||
53 | |||
54 | static HRESULT BAEngineGetVariableVersion( | ||
55 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
56 | __in const LPVOID pvArgs, | ||
57 | __inout LPVOID pvResults | ||
58 | ) | ||
59 | { | ||
60 | HRESULT hr = S_OK; | ||
61 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETVARIABLEVERSION_ARGS, pArgs); | ||
62 | ValidateMessageResults(hr, pvResults, BAENGINE_GETVARIABLEVERSION_RESULTS, pResults); | ||
63 | |||
64 | hr = ExternalEngineGetVariableVersion(pContext->pEngineState, pArgs->wzVariable, pResults->wzValue, &pResults->cchValue); | ||
65 | |||
66 | LExit: | ||
67 | return hr; | ||
68 | } | ||
69 | |||
70 | static HRESULT BAEngineFormatString( | ||
71 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
72 | __in const LPVOID pvArgs, | ||
73 | __inout LPVOID pvResults | ||
74 | ) | ||
75 | { | ||
76 | HRESULT hr = S_OK; | ||
77 | ValidateMessageArgs(hr, pvArgs, BAENGINE_FORMATSTRING_ARGS, pArgs); | ||
78 | ValidateMessageResults(hr, pvResults, BAENGINE_FORMATSTRING_RESULTS, pResults); | ||
79 | |||
80 | hr = ExternalEngineFormatString(pContext->pEngineState, pArgs->wzIn, pResults->wzOut, &pResults->cchOut); | ||
81 | |||
82 | LExit: | ||
83 | return hr; | ||
84 | } | ||
85 | |||
86 | static HRESULT BAEngineEscapeString( | ||
87 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | ||
88 | __in const LPVOID pvArgs, | ||
89 | __inout LPVOID pvResults | ||
90 | ) | ||
91 | { | ||
92 | HRESULT hr = S_OK; | ||
93 | ValidateMessageArgs(hr, pvArgs, BAENGINE_ESCAPESTRING_ARGS, pArgs); | ||
94 | ValidateMessageResults(hr, pvResults, BAENGINE_ESCAPESTRING_RESULTS, pResults); | ||
95 | |||
96 | hr = ExternalEngineEscapeString(pArgs->wzIn, pResults->wzOut, &pResults->cchOut); | ||
97 | |||
98 | LExit: | ||
99 | return hr; | ||
100 | } | ||
101 | |||
102 | static HRESULT BAEngineEvaluateCondition( | ||
103 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
104 | __in const LPVOID pvArgs, | ||
105 | __inout LPVOID pvResults | ||
106 | ) | ||
107 | { | ||
108 | HRESULT hr = S_OK; | ||
109 | ValidateMessageArgs(hr, pvArgs, BAENGINE_EVALUATECONDITION_ARGS, pArgs); | ||
110 | ValidateMessageResults(hr, pvResults, BAENGINE_EVALUATECONDITION_RESULTS, pResults); | ||
111 | |||
112 | hr = ExternalEngineEvaluateCondition(pContext->pEngineState, pArgs->wzCondition, &pResults->f); | ||
113 | |||
114 | LExit: | ||
115 | return hr; | ||
116 | } | ||
117 | |||
118 | static HRESULT BAEngineLog( | ||
119 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | ||
120 | __in const LPVOID pvArgs, | ||
121 | __inout LPVOID pvResults | ||
122 | ) | ||
123 | { | ||
124 | HRESULT hr = S_OK; | ||
125 | REPORT_LEVEL rl = REPORT_NONE; | ||
126 | ValidateMessageArgs(hr, pvArgs, BAENGINE_LOG_ARGS, pArgs); | ||
127 | ValidateMessageResults(hr, pvResults, BAENGINE_LOG_RESULTS, pResults); | ||
128 | |||
129 | switch (pArgs->level) | ||
130 | { | ||
131 | case BOOTSTRAPPER_LOG_LEVEL_STANDARD: | ||
132 | rl = REPORT_STANDARD; | ||
133 | break; | ||
134 | |||
135 | case BOOTSTRAPPER_LOG_LEVEL_VERBOSE: | ||
136 | rl = REPORT_VERBOSE; | ||
137 | break; | ||
138 | |||
139 | case BOOTSTRAPPER_LOG_LEVEL_DEBUG: | ||
140 | rl = REPORT_DEBUG; | ||
141 | break; | ||
142 | |||
143 | case BOOTSTRAPPER_LOG_LEVEL_ERROR: | ||
144 | rl = REPORT_ERROR; | ||
145 | break; | ||
146 | |||
147 | default: | ||
148 | ExitFunction1(hr = E_INVALIDARG); | ||
149 | } | ||
150 | |||
151 | hr = ExternalEngineLog(rl, pArgs->wzMessage); | ||
152 | ExitOnFailure(hr, "Failed to log BA message."); | ||
153 | |||
154 | LExit: | ||
155 | return hr; | ||
156 | } | ||
157 | |||
158 | static HRESULT BAEngineSendEmbeddedError( | ||
159 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
160 | __in const LPVOID pvArgs, | ||
161 | __inout LPVOID pvResults | ||
162 | ) | ||
163 | { | ||
164 | HRESULT hr = S_OK; | ||
165 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SENDEMBEDDEDERROR_ARGS, pArgs); | ||
166 | ValidateMessageResults(hr, pvResults, BAENGINE_SENDEMBEDDEDERROR_RESULTS, pResults); | ||
167 | |||
168 | hr = ExternalEngineSendEmbeddedError(pContext->pEngineState, pArgs->dwErrorCode, pArgs->wzMessage, pArgs->dwUIHint, &pResults->nResult); | ||
169 | |||
170 | LExit: | ||
171 | return hr; | ||
172 | } | ||
173 | |||
174 | static HRESULT BAEngineSendEmbeddedProgress( | ||
175 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
176 | __in const LPVOID pvArgs, | ||
177 | __inout LPVOID pvResults | ||
178 | ) | ||
179 | { | ||
180 | HRESULT hr = S_OK; | ||
181 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SENDEMBEDDEDPROGRESS_ARGS, pArgs); | ||
182 | ValidateMessageResults(hr, pvResults, BAENGINE_SENDEMBEDDEDPROGRESS_RESULTS, pResults); | ||
183 | |||
184 | hr = ExternalEngineSendEmbeddedProgress(pContext->pEngineState, pArgs->dwProgressPercentage, pArgs->dwOverallProgressPercentage, &pResults->nResult); | ||
185 | |||
186 | LExit: | ||
187 | return hr; | ||
188 | } | ||
189 | |||
190 | static HRESULT BAEngineSetUpdate( | ||
191 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
192 | __in const LPVOID pvArgs, | ||
193 | __inout LPVOID pvResults | ||
194 | ) | ||
195 | { | ||
196 | HRESULT hr = S_OK; | ||
197 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETUPDATE_ARGS, pArgs); | ||
198 | ValidateMessageResults(hr, pvResults, BAENGINE_SETUPDATE_RESULTS, pResults); | ||
199 | |||
200 | hr = ExternalEngineSetUpdate(pContext->pEngineState, pArgs->wzLocalSource, pArgs->wzDownloadSource, pArgs->qwSize, pArgs->hashType, pArgs->wzHash); | ||
201 | |||
202 | LExit: | ||
203 | return hr; | ||
204 | } | ||
205 | |||
206 | static HRESULT BAEngineSetLocalSource( | ||
207 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
208 | __in const LPVOID pvArgs, | ||
209 | __inout LPVOID pvResults | ||
210 | ) | ||
211 | { | ||
212 | HRESULT hr = S_OK; | ||
213 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETLOCALSOURCE_ARGS, pArgs); | ||
214 | ValidateMessageResults(hr, pvResults, BAENGINE_SETLOCALSOURCE_RESULTS, pResults); | ||
215 | |||
216 | hr = ExternalEngineSetLocalSource(pContext->pEngineState, pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzPath); | ||
217 | |||
218 | LExit: | ||
219 | return hr; | ||
220 | } | ||
221 | |||
222 | static HRESULT BAEngineSetDownloadSource( | ||
223 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
224 | __in const LPVOID pvArgs, | ||
225 | __inout LPVOID pvResults | ||
226 | ) | ||
227 | { | ||
228 | HRESULT hr = S_OK; | ||
229 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETDOWNLOADSOURCE_ARGS, pArgs); | ||
230 | ValidateMessageResults(hr, pvResults, BAENGINE_SETDOWNLOADSOURCE_RESULTS, pResults); | ||
231 | |||
232 | hr = ExternalEngineSetDownloadSource(pContext->pEngineState, pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzUrl, pArgs->wzUser, pArgs->wzPassword); | ||
233 | |||
234 | LExit: | ||
235 | return hr; | ||
236 | } | ||
237 | |||
238 | static HRESULT BAEngineSetVariableNumeric( | ||
239 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
240 | __in const LPVOID pvArgs, | ||
241 | __inout LPVOID pvResults | ||
242 | ) | ||
243 | { | ||
244 | HRESULT hr = S_OK; | ||
245 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETVARIABLENUMERIC_ARGS, pArgs); | ||
246 | ValidateMessageResults(hr, pvResults, BAENGINE_SETVARIABLENUMERIC_RESULTS, pResults); | ||
247 | |||
248 | hr = ExternalEngineSetVariableNumeric(pContext->pEngineState, pArgs->wzVariable, pArgs->llValue); | ||
249 | |||
250 | LExit: | ||
251 | return hr; | ||
252 | } | ||
253 | |||
254 | static HRESULT BAEngineSetVariableString( | ||
255 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
256 | __in const LPVOID pvArgs, | ||
257 | __inout LPVOID pvResults | ||
258 | ) | ||
259 | { | ||
260 | HRESULT hr = S_OK; | ||
261 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETVARIABLESTRING_ARGS, pArgs); | ||
262 | ValidateMessageResults(hr, pvResults, BAENGINE_SETVARIABLESTRING_RESULTS, pResults); | ||
263 | |||
264 | hr = ExternalEngineSetVariableString(pContext->pEngineState, pArgs->wzVariable, pArgs->wzValue, pArgs->fFormatted); | ||
265 | |||
266 | LExit: | ||
267 | return hr; | ||
268 | } | ||
269 | |||
270 | static HRESULT BAEngineSetVariableVersion( | ||
271 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
272 | __in const LPVOID pvArgs, | ||
273 | __inout LPVOID pvResults | ||
274 | ) | ||
275 | { | ||
276 | HRESULT hr = S_OK; | ||
277 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETVARIABLEVERSION_ARGS, pArgs); | ||
278 | ValidateMessageResults(hr, pvResults, BAENGINE_SETVARIABLEVERSION_RESULTS, pResults); | ||
279 | |||
280 | hr = ExternalEngineSetVariableVersion(pContext->pEngineState, pArgs->wzVariable, pArgs->wzValue); | ||
281 | |||
282 | LExit: | ||
283 | return hr; | ||
284 | } | ||
285 | |||
286 | static HRESULT BAEngineCloseSplashScreen( | ||
287 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
288 | __in const LPVOID pvArgs, | ||
289 | __inout LPVOID pvResults | ||
290 | ) | ||
291 | { | ||
292 | HRESULT hr = S_OK; | ||
293 | ValidateMessageArgs(hr, pvArgs, BAENGINE_CLOSESPLASHSCREEN_ARGS, pArgs); | ||
294 | ValidateMessageResults(hr, pvResults, BAENGINE_CLOSESPLASHSCREEN_RESULTS, pResults); | ||
295 | |||
296 | ExternalEngineCloseSplashScreen(pContext->pEngineState); | ||
297 | |||
298 | LExit: | ||
299 | return hr; | ||
300 | } | ||
301 | |||
302 | static HRESULT BAEngineCompareVersions( | ||
303 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | ||
304 | __in const LPVOID pvArgs, | ||
305 | __inout LPVOID pvResults | ||
306 | ) | ||
307 | { | ||
308 | HRESULT hr = S_OK; | ||
309 | ValidateMessageArgs(hr, pvArgs, BAENGINE_COMPAREVERSIONS_ARGS, pArgs); | ||
310 | ValidateMessageResults(hr, pvResults, BAENGINE_COMPAREVERSIONS_RESULTS, pResults); | ||
311 | |||
312 | hr = ExternalEngineCompareVersions(pArgs->wzVersion1, pArgs->wzVersion2, &pResults->nResult); | ||
313 | |||
314 | LExit: | ||
315 | return hr; | ||
316 | } | ||
317 | |||
318 | static HRESULT BAEngineDetect( | ||
319 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
320 | __in const LPVOID pvArgs, | ||
321 | __inout LPVOID pvResults | ||
322 | ) | ||
323 | { | ||
324 | HRESULT hr = S_OK; | ||
325 | ValidateMessageArgs(hr, pvArgs, BAENGINE_DETECT_ARGS, pArgs); | ||
326 | ValidateMessageResults(hr, pvResults, BAENGINE_DETECT_RESULTS, pResults); | ||
327 | |||
328 | hr = ExternalEngineDetect(pContext, pArgs->hwndParent); | ||
329 | |||
330 | LExit: | ||
331 | return hr; | ||
332 | } | ||
333 | |||
334 | static HRESULT BAEnginePlan( | ||
335 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
336 | __in const LPVOID pvArgs, | ||
337 | __inout LPVOID pvResults | ||
338 | ) | ||
339 | { | ||
340 | HRESULT hr = S_OK; | ||
341 | ValidateMessageArgs(hr, pvArgs, BAENGINE_PLAN_ARGS, pArgs); | ||
342 | ValidateMessageResults(hr, pvResults, BAENGINE_PLAN_RESULTS, pResults); | ||
343 | |||
344 | hr = ExternalEnginePlan(pContext, pArgs->action); | ||
345 | |||
346 | LExit: | ||
347 | return hr; | ||
348 | } | ||
349 | |||
350 | static HRESULT BAEngineElevate( | ||
351 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
352 | __in const LPVOID pvArgs, | ||
353 | __inout LPVOID pvResults | ||
354 | ) | ||
355 | { | ||
356 | HRESULT hr = S_OK; | ||
357 | ValidateMessageArgs(hr, pvArgs, BAENGINE_ELEVATE_ARGS, pArgs); | ||
358 | ValidateMessageResults(hr, pvResults, BAENGINE_ELEVATE_RESULTS, pResults); | ||
359 | |||
360 | hr = ExternalEngineElevate(pContext, pArgs->hwndParent); | ||
361 | |||
362 | LExit: | ||
363 | return hr; | ||
364 | } | ||
365 | |||
366 | static HRESULT BAEngineApply( | ||
367 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
368 | __in const LPVOID pvArgs, | ||
369 | __inout LPVOID pvResults | ||
370 | ) | ||
371 | { | ||
372 | HRESULT hr = S_OK; | ||
373 | ValidateMessageArgs(hr, pvArgs, BAENGINE_APPLY_ARGS, pArgs); | ||
374 | ValidateMessageResults(hr, pvResults, BAENGINE_APPLY_RESULTS, pResults); | ||
375 | |||
376 | hr = ExternalEngineApply(pContext, pArgs->hwndParent); | ||
377 | |||
378 | LExit: | ||
379 | return hr; | ||
380 | } | ||
381 | |||
382 | static HRESULT BAEngineQuit( | ||
383 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
384 | __in const LPVOID pvArgs, | ||
385 | __inout LPVOID pvResults | ||
386 | ) | ||
387 | { | ||
388 | HRESULT hr = S_OK; | ||
389 | ValidateMessageArgs(hr, pvArgs, BAENGINE_QUIT_ARGS, pArgs); | ||
390 | ValidateMessageResults(hr, pvResults, BAENGINE_QUIT_RESULTS, pResults); | ||
391 | |||
392 | hr = ExternalEngineQuit(pContext, pArgs->dwExitCode); | ||
393 | |||
394 | LExit: | ||
395 | return hr; | ||
396 | } | ||
397 | |||
398 | static HRESULT BAEngineLaunchApprovedExe( | ||
399 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
400 | __in const LPVOID pvArgs, | ||
401 | __inout LPVOID pvResults | ||
402 | ) | ||
403 | { | ||
404 | HRESULT hr = S_OK; | ||
405 | ValidateMessageArgs(hr, pvArgs, BAENGINE_LAUNCHAPPROVEDEXE_ARGS, pArgs); | ||
406 | ValidateMessageResults(hr, pvResults, BAENGINE_LAUNCHAPPROVEDEXE_RESULTS, pResults); | ||
407 | |||
408 | hr = ExternalEngineLaunchApprovedExe(pContext, pArgs->hwndParent, pArgs->wzApprovedExeForElevationId, pArgs->wzArguments, pArgs->dwWaitForInputIdleTimeout); | ||
409 | |||
410 | LExit: | ||
411 | return hr; | ||
412 | } | ||
413 | |||
414 | static HRESULT BAEngineSetUpdateSource( | ||
415 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
416 | __in const LPVOID pvArgs, | ||
417 | __inout LPVOID pvResults | ||
418 | ) | ||
419 | { | ||
420 | HRESULT hr = S_OK; | ||
421 | ValidateMessageArgs(hr, pvArgs, BAENGINE_SETUPDATESOURCE_ARGS, pArgs); | ||
422 | ValidateMessageResults(hr, pvResults, BAENGINE_SETUPDATESOURCE_RESULTS, pResults); | ||
423 | |||
424 | hr = ExternalEngineSetUpdateSource(pContext->pEngineState, pArgs->wzUrl); | ||
425 | |||
426 | LExit: | ||
427 | return hr; | ||
428 | } | ||
429 | |||
430 | static HRESULT BAEngineGetRelatedBundleVariable( | ||
431 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | ||
432 | __in const LPVOID pvArgs, | ||
433 | __inout LPVOID pvResults | ||
434 | ) | ||
435 | { | ||
436 | HRESULT hr = S_OK; | ||
437 | ValidateMessageArgs(hr, pvArgs, BAENGINE_GETRELATEDBUNDLEVARIABLE_ARGS, pArgs); | ||
438 | ValidateMessageResults(hr, pvResults, BAENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS, pResults); | ||
439 | |||
440 | hr = ExternalEngineGetRelatedBundleVariable(pContext->pEngineState, pArgs->wzBundleId, pArgs->wzVariable, pResults->wzValue, &pResults->cchValue); | ||
441 | |||
442 | LExit: | ||
443 | return hr; | ||
444 | } | ||
445 | |||
446 | HRESULT WINAPI EngineForApplicationProc( | ||
447 | __in BOOTSTRAPPER_ENGINE_MESSAGE message, | ||
448 | __in const LPVOID pvArgs, | ||
449 | __inout LPVOID pvResults, | ||
450 | __in_opt LPVOID pvContext | ||
451 | ) | ||
452 | { | ||
453 | HRESULT hr = S_OK; | ||
454 | BOOTSTRAPPER_ENGINE_CONTEXT* pContext = reinterpret_cast<BOOTSTRAPPER_ENGINE_CONTEXT*>(pvContext); | ||
455 | |||
456 | if (!pContext || !pvArgs || !pvResults) | ||
457 | { | ||
458 | ExitFunction1(hr = E_INVALIDARG); | ||
459 | } | ||
460 | |||
461 | switch (message) | ||
462 | { | ||
463 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETPACKAGECOUNT: | ||
464 | hr = BAEngineGetPackageCount(pContext, pvArgs, pvResults); | ||
465 | break; | ||
466 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLENUMERIC: | ||
467 | hr = BAEngineGetVariableNumeric(pContext, pvArgs, pvResults); | ||
468 | break; | ||
469 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLESTRING: | ||
470 | hr = BAEngineGetVariableString(pContext, pvArgs, pvResults); | ||
471 | break; | ||
472 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETVARIABLEVERSION: | ||
473 | hr = BAEngineGetVariableVersion(pContext, pvArgs, pvResults); | ||
474 | break; | ||
475 | case BOOTSTRAPPER_ENGINE_MESSAGE_FORMATSTRING: | ||
476 | hr = BAEngineFormatString(pContext, pvArgs, pvResults); | ||
477 | break; | ||
478 | case BOOTSTRAPPER_ENGINE_MESSAGE_ESCAPESTRING: | ||
479 | hr = BAEngineEscapeString(pContext, pvArgs, pvResults); | ||
480 | break; | ||
481 | case BOOTSTRAPPER_ENGINE_MESSAGE_EVALUATECONDITION: | ||
482 | hr = BAEngineEvaluateCondition(pContext, pvArgs, pvResults); | ||
483 | break; | ||
484 | case BOOTSTRAPPER_ENGINE_MESSAGE_LOG: | ||
485 | hr = BAEngineLog(pContext, pvArgs, pvResults); | ||
486 | break; | ||
487 | case BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDERROR: | ||
488 | hr = BAEngineSendEmbeddedError(pContext, pvArgs, pvResults); | ||
489 | break; | ||
490 | case BOOTSTRAPPER_ENGINE_MESSAGE_SENDEMBEDDEDPROGRESS: | ||
491 | hr = BAEngineSendEmbeddedProgress(pContext, pvArgs, pvResults); | ||
492 | break; | ||
493 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATE: | ||
494 | hr = BAEngineSetUpdate(pContext, pvArgs, pvResults); | ||
495 | break; | ||
496 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETLOCALSOURCE: | ||
497 | hr = BAEngineSetLocalSource(pContext, pvArgs, pvResults); | ||
498 | break; | ||
499 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETDOWNLOADSOURCE: | ||
500 | hr = BAEngineSetDownloadSource(pContext, pvArgs, pvResults); | ||
501 | break; | ||
502 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLENUMERIC: | ||
503 | hr = BAEngineSetVariableNumeric(pContext, pvArgs, pvResults); | ||
504 | break; | ||
505 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLESTRING: | ||
506 | hr = BAEngineSetVariableString(pContext, pvArgs, pvResults); | ||
507 | break; | ||
508 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETVARIABLEVERSION: | ||
509 | hr = BAEngineSetVariableVersion(pContext, pvArgs, pvResults); | ||
510 | break; | ||
511 | case BOOTSTRAPPER_ENGINE_MESSAGE_CLOSESPLASHSCREEN: | ||
512 | hr = BAEngineCloseSplashScreen(pContext, pvArgs, pvResults); | ||
513 | break; | ||
514 | case BOOTSTRAPPER_ENGINE_MESSAGE_DETECT: | ||
515 | hr = BAEngineDetect(pContext, pvArgs, pvResults); | ||
516 | break; | ||
517 | case BOOTSTRAPPER_ENGINE_MESSAGE_PLAN: | ||
518 | hr = BAEnginePlan(pContext, pvArgs, pvResults); | ||
519 | break; | ||
520 | case BOOTSTRAPPER_ENGINE_MESSAGE_ELEVATE: | ||
521 | hr = BAEngineElevate(pContext, pvArgs, pvResults); | ||
522 | break; | ||
523 | case BOOTSTRAPPER_ENGINE_MESSAGE_APPLY: | ||
524 | hr = BAEngineApply(pContext, pvArgs, pvResults); | ||
525 | break; | ||
526 | case BOOTSTRAPPER_ENGINE_MESSAGE_QUIT: | ||
527 | hr = BAEngineQuit(pContext, pvArgs, pvResults); | ||
528 | break; | ||
529 | case BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE: | ||
530 | hr = BAEngineLaunchApprovedExe(pContext, pvArgs, pvResults); | ||
531 | break; | ||
532 | case BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATESOURCE: | ||
533 | hr = BAEngineSetUpdateSource(pContext, pvArgs, pvResults); | ||
534 | break; | ||
535 | case BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS: | ||
536 | hr = BAEngineCompareVersions(pContext, pvArgs, pvResults); | ||
537 | break; | ||
538 | case BOOTSTRAPPER_ENGINE_MESSAGE_GETRELATEDBUNDLEVARIABLE: | ||
539 | hr = BAEngineGetRelatedBundleVariable(pContext, pvArgs, pvResults); | ||
540 | break; | ||
541 | default: | ||
542 | hr = E_NOTIMPL; | ||
543 | break; | ||
544 | } | ||
545 | |||
546 | LExit: | ||
547 | return hr; | ||
548 | } | ||