aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/userexperience.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/userexperience.cpp')
-rw-r--r--src/burn/engine/userexperience.cpp5782
1 files changed, 2863 insertions, 2919 deletions
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp
index 372ca901..99561f35 100644
--- a/src/burn/engine/userexperience.cpp
+++ b/src/burn/engine/userexperience.cpp
@@ -4,88 +4,60 @@
4 4
5// internal function declarations 5// internal function declarations
6 6
7static int FilterResult( 7// static int FilterResult(
8 __in DWORD dwAllowedResults, 8// __in DWORD dwAllowedResults,
9 __in int nResult 9// __in int nResult
10 ); 10// );
11 11
12static HRESULT FilterExecuteResult( 12// static HRESULT FilterExecuteResult(
13 __in BURN_USER_EXPERIENCE* pUserExperience, 13// __in BURN_USER_EXPERIENCE* pUserExperience,
14 __in HRESULT hrStatus, 14// __in HRESULT hrStatus,
15 __in BOOL fRollback, 15// __in BOOL fRollback,
16 __in BOOL fCancel, 16// __in BOOL fCancel,
17 __in LPCWSTR sczEventName 17// __in LPCWSTR sczEventName
18 ); 18// );
19 19
20static HRESULT SendBAMessage( 20// static HRESULT SendBAMessage(
21 __in BURN_USER_EXPERIENCE* pUserExperience, 21// __in BURN_USER_EXPERIENCE* pUserExperience,
22 __in BOOTSTRAPPER_APPLICATION_MESSAGE message, 22// __in BOOTSTRAPPER_APPLICATION_MESSAGE message,
23 __in const LPVOID pvArgs, 23// __in_bcount(cbArgs) const LPVOID pvArgs,
24 __inout LPVOID pvResults 24// __in const DWORD cbArgs,
25 ); 25// __in PIPE_RPC_RESULT* pResult
26 26// );
27static HRESULT SendBAMessageFromInactiveEngine( 27
28 __in BURN_USER_EXPERIENCE* pUserExperience, 28// static HRESULT SendBAMessageFromInactiveEngine(
29 __in BOOTSTRAPPER_APPLICATION_MESSAGE message, 29// __in BURN_USER_EXPERIENCE* pUserExperience,
30 __in const LPVOID pvArgs, 30// __in BOOTSTRAPPER_APPLICATION_MESSAGE message,
31 __inout LPVOID pvResults 31// __in const LPVOID pvArgs,
32 ); 32// __in const DWORD cbArgs,
33// __in PIPE_RPC_RESULT* pResult
34// );
33 35
34 36
35// function definitions 37// function definitions
36 38
37/******************************************************************* 39// /*******************************************************************
38 UserExperienceParseFromXml - 40// UserExperienceUninitialize -
39
40*******************************************************************/
41extern "C" HRESULT UserExperienceParseFromXml(
42 __in BURN_USER_EXPERIENCE* pUserExperience,
43 __in IXMLDOMNode* pixnBundle
44 )
45{
46 HRESULT hr = S_OK;
47 IXMLDOMNode* pixnUserExperienceNode = NULL;
48
49 // select UX node
50 hr = XmlSelectSingleNode(pixnBundle, L"UX", &pixnUserExperienceNode);
51 if (S_FALSE == hr)
52 {
53 hr = E_NOTFOUND;
54 }
55 ExitOnFailure(hr, "Failed to select user experience node.");
56
57 // parse payloads
58 hr = PayloadsParseFromXml(&pUserExperience->payloads, NULL, NULL, pixnUserExperienceNode);
59 ExitOnFailure(hr, "Failed to parse user experience payloads.");
60
61 // make sure we have at least one payload
62 if (0 == pUserExperience->payloads.cPayloads)
63 {
64 hr = E_UNEXPECTED;
65 ExitOnFailure(hr, "Too few UX payloads.");
66 }
67
68LExit:
69 ReleaseObject(pixnUserExperienceNode);
70 41
71 return hr; 42// *******************************************************************/
72} 43// extern "C" void UserExperienceUninitialize(
44// __in BURN_USER_EXPERIENCE* pUserExperience
45// )
46// {
47// if (pUserExperience->pEngineContext)
48// {
49// BAEngineFreeContext(pUserExperience->pEngineContext);
50// pUserExperience->pEngineContext = NULL;
51// }
73 52
74/******************************************************************* 53// ReleaseStr(pUserExperience->sczTempDirectory);
75 UserExperienceUninitialize - 54// PayloadsUninitialize(&pUserExperience->payloads);
76 55
77*******************************************************************/ 56// // clear struct
78extern "C" void UserExperienceUninitialize( 57// memset(pUserExperience, 0, sizeof(BURN_USER_EXPERIENCE));
79 __in BURN_USER_EXPERIENCE* pUserExperience 58// }
80 )
81{
82 ReleaseStr(pUserExperience->sczTempDirectory);
83 PayloadsUninitialize(&pUserExperience->payloads);
84
85 // clear struct
86 memset(pUserExperience, 0, sizeof(BURN_USER_EXPERIENCE));
87}
88 59
60#ifdef TODO_DELETE
89/******************************************************************* 61/*******************************************************************
90 UserExperienceLoad - 62 UserExperienceLoad -
91 63
@@ -167,2848 +139,2820 @@ extern "C" HRESULT UserExperienceUnload(
167//LExit: 139//LExit:
168 return hr; 140 return hr;
169} 141}
170 142#endif
171extern "C" HRESULT UserExperienceEnsureWorkingFolder( 143
172 __in BURN_CACHE* pCache, 144// EXTERN_C BAAPI UserExperienceOnApplyBegin(
173 __deref_out_z LPWSTR* psczUserExperienceWorkingFolder 145// __in BURN_USER_EXPERIENCE* pUserExperience,
174 ) 146// __in DWORD dwPhaseCount
175{ 147// )
176 HRESULT hr = S_OK; 148// {
177 LPWSTR sczWorkingFolder = NULL; 149// HRESULT hr = S_OK;
178 150// BA_ONAPPLYBEGIN_ARGS args = { };
179 hr = CacheEnsureBaseWorkingFolder(pCache, &sczWorkingFolder); 151// BA_ONAPPLYBEGIN_RESULTS results = { };
180 ExitOnFailure(hr, "Failed to create working folder."); 152// PIPE_RPC_RESULT result = { };
181 153
182 hr = StrAllocFormatted(psczUserExperienceWorkingFolder, L"%ls%ls\\", sczWorkingFolder, L".ba"); 154// args.cbSize = sizeof(args);
183 ExitOnFailure(hr, "Failed to calculate the bootstrapper application working path."); 155// args.dwPhaseCount = dwPhaseCount;
184 156
185 hr = DirEnsureExists(*psczUserExperienceWorkingFolder, NULL); 157// results.cbSize = sizeof(results);
186 ExitOnFailure(hr, "Failed create bootstrapper application working folder."); 158
187 159// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYBEGIN, &args, args.cbSize, &result);
188LExit: 160// ExitOnFailure(hr, "BA OnApplyBegin failed.");
189 ReleaseStr(sczWorkingFolder); 161
190 162// if (results.fCancel)
191 return hr; 163// {
192} 164// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
193 165// }
194 166
195extern "C" HRESULT UserExperienceRemove( 167// LExit:
196 __in BURN_USER_EXPERIENCE* pUserExperience 168// return hr;
197 ) 169// }
198{ 170
199 HRESULT hr = S_OK; 171// EXTERN_C BAAPI UserExperienceOnApplyComplete(
200 172// __in BURN_USER_EXPERIENCE* pUserExperience,
201 // Remove temporary UX directory 173// __in HRESULT hrStatus,
202 if (pUserExperience->sczTempDirectory) 174// __in BOOTSTRAPPER_APPLY_RESTART restart,
203 { 175// __inout BOOTSTRAPPER_APPLYCOMPLETE_ACTION* pAction
204 hr = DirEnsureDeleteEx(pUserExperience->sczTempDirectory, DIR_DELETE_FILES | DIR_DELETE_RECURSE | DIR_DELETE_SCHEDULE); 176// )
205 TraceError(hr, "Could not delete bootstrapper application folder. Some files will be left in the temp folder."); 177// {
206 } 178// HRESULT hr = S_OK;
207 179// BA_ONAPPLYCOMPLETE_ARGS args = { };
208//LExit: 180// BA_ONAPPLYCOMPLETE_RESULTS results = { };
209 return hr; 181// PIPE_RPC_RESULT result = { };
210} 182
211 183// args.cbSize = sizeof(args);
212extern "C" int UserExperienceSendError( 184// args.hrStatus = hrStatus;
213 __in BURN_USER_EXPERIENCE* pUserExperience, 185// args.restart = restart;
214 __in BOOTSTRAPPER_ERROR_TYPE errorType, 186// args.recommendation = *pAction;
215 __in_z_opt LPCWSTR wzPackageId, 187
216 __in HRESULT hrCode, 188// results.cbSize = sizeof(results);
217 __in_z_opt LPCWSTR wzError, 189// results.action = *pAction;
218 __in DWORD uiFlags, 190
219 __in int nRecommendation 191// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYCOMPLETE, &args, args.cbSize, &result);
220 ) 192// ExitOnFailure(hr, "BA OnApplyComplete failed.");
221{ 193
222 int nResult = nRecommendation; 194// *pAction = results.action;
223 DWORD dwCode = HRESULT_CODE(hrCode); 195
224 LPWSTR sczError = NULL; 196// LExit:
225 197// return hr;
226 // If no error string was provided, try to get the error string from the HRESULT. 198// }
227 if (!wzError) 199
228 { 200// EXTERN_C BAAPI UserExperienceOnApplyDowngrade(
229 if (SUCCEEDED(StrAllocFromError(&sczError, hrCode, NULL))) 201// __in BURN_USER_EXPERIENCE* pUserExperience,
230 { 202// __inout HRESULT* phrStatus
231 wzError = sczError; 203// )
232 } 204// {
233 } 205// HRESULT hr = S_OK;
234 206// BA_ONAPPLYDOWNGRADE_ARGS args = { };
235 UserExperienceOnError(pUserExperience, errorType, wzPackageId, dwCode, wzError, uiFlags, 0, NULL, &nResult); // ignore return value. 207// BA_ONAPPLYDOWNGRADE_RESULTS results = { };
236 208// PIPE_RPC_RESULT result = { };
237 ReleaseStr(sczError); 209
238 return nResult; 210// args.cbSize = sizeof(args);
239} 211// args.hrRecommended = *phrStatus;
240 212
241extern "C" void UserExperienceActivateEngine( 213// results.cbSize = sizeof(results);
242 __in BURN_USER_EXPERIENCE* pUserExperience 214// results.hrStatus = *phrStatus;
243 ) 215
244{ 216// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYDOWNGRADE, &args, args.cbSize, &result);
245 ::EnterCriticalSection(&pUserExperience->csEngineActive); 217// ExitOnFailure(hr, "BA OnApplyDowngrade failed.");
246 AssertSz(!pUserExperience->fEngineActive, "Engine should have been deactivated before activating it."); 218
247 pUserExperience->fEngineActive = TRUE; 219// *phrStatus = results.hrStatus;
248 ::LeaveCriticalSection(&pUserExperience->csEngineActive); 220
249} 221// LExit:
250 222// return hr;
251extern "C" void UserExperienceDeactivateEngine( 223// }
252 __in BURN_USER_EXPERIENCE* pUserExperience 224
253 ) 225// EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionBegin(
254{ 226// __in BURN_USER_EXPERIENCE* pUserExperience,
255 ::EnterCriticalSection(&pUserExperience->csEngineActive); 227// __in LPCWSTR wzTransactionId
256 AssertSz(pUserExperience->fEngineActive, "Engine should have been active before deactivating it."); 228// )
257 pUserExperience->fEngineActive = FALSE; 229// {
258 ::LeaveCriticalSection(&pUserExperience->csEngineActive); 230// HRESULT hr = S_OK;
259} 231// BA_ONBEGINMSITRANSACTIONBEGIN_ARGS args = { };
260 232// BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS results = { };
261extern "C" HRESULT UserExperienceEnsureEngineInactive( 233// PIPE_RPC_RESULT result = { };
262 __in BURN_USER_EXPERIENCE* pUserExperience 234
263 ) 235// args.cbSize = sizeof(args);
264{ 236// args.wzTransactionId = wzTransactionId;
265 // Make a slight optimization here by ignoring the critical section, because all callers should have needed to enter it for their operation anyway. 237
266 HRESULT hr = pUserExperience->fEngineActive ? HRESULT_FROM_WIN32(ERROR_BUSY) : S_OK; 238// results.cbSize = sizeof(results);
267 ExitOnRootFailure(hr, "Engine is active, cannot proceed."); 239
268 240// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, args.cbSize, &result);
269LExit: 241// ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed.");
270 return hr; 242
271} 243// if (results.fCancel)
272 244// {
273extern "C" void UserExperienceExecuteReset( 245// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
274 __in BURN_USER_EXPERIENCE* pUserExperience 246// }
275 ) 247
276{ 248// LExit:
277 pUserExperience->hrApplyError = S_OK; 249// return hr;
278 pUserExperience->hwndApply = NULL; 250// }
279} 251
280 252// EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionComplete(
281extern "C" void UserExperienceExecutePhaseComplete( 253// __in BURN_USER_EXPERIENCE* pUserExperience,
282 __in BURN_USER_EXPERIENCE* pUserExperience, 254// __in LPCWSTR wzTransactionId,
283 __in HRESULT hrResult 255// __in HRESULT hrStatus
284 ) 256// )
285{ 257// {
286 if (FAILED(hrResult)) 258// HRESULT hr = S_OK;
287 { 259// BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS args = { };
288 pUserExperience->hrApplyError = hrResult; 260// BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS results = { };
289 } 261// PIPE_RPC_RESULT result = { };
290} 262
291 263// args.cbSize = sizeof(args);
292EXTERN_C BAAPI UserExperienceOnApplyBegin( 264// args.wzTransactionId = wzTransactionId;
293 __in BURN_USER_EXPERIENCE* pUserExperience, 265// args.hrStatus = hrStatus;
294 __in DWORD dwPhaseCount 266
295 ) 267// results.cbSize = sizeof(results);
296{ 268
297 HRESULT hr = S_OK; 269// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE, &args, args.cbSize, &result);
298 BA_ONAPPLYBEGIN_ARGS args = { }; 270// ExitOnFailure(hr, "BA OnBeginMsiTransactionComplete failed.");
299 BA_ONAPPLYBEGIN_RESULTS results = { }; 271
300 272// LExit:
301 args.cbSize = sizeof(args); 273// return hr;
302 args.dwPhaseCount = dwPhaseCount; 274// }
303 275
304 results.cbSize = sizeof(results); 276// EXTERN_C BAAPI UserExperienceOnCacheAcquireBegin(
305 277// __in BURN_USER_EXPERIENCE* pUserExperience,
306 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYBEGIN, &args, &results); 278// __in_z_opt LPCWSTR wzPackageOrContainerId,
307 ExitOnFailure(hr, "BA OnApplyBegin failed."); 279// __in_z_opt LPCWSTR wzPayloadId,
308 280// __in_z LPWSTR* pwzSource,
309 if (results.fCancel) 281// __in_z LPWSTR* pwzDownloadUrl,
310 { 282// __in_z_opt LPCWSTR wzPayloadContainerId,
311 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 283// __out BOOTSTRAPPER_CACHE_OPERATION* pCacheOperation
312 } 284// )
313 285// {
314LExit: 286// HRESULT hr = S_OK;
315 return hr; 287// BA_ONCACHEACQUIREBEGIN_ARGS args = { };
316} 288// BA_ONCACHEACQUIREBEGIN_RESULTS results = { };
317 289// PIPE_RPC_RESULT result = { };
318EXTERN_C BAAPI UserExperienceOnApplyComplete( 290
319 __in BURN_USER_EXPERIENCE* pUserExperience, 291// *pCacheOperation = BOOTSTRAPPER_CACHE_OPERATION_NONE;
320 __in HRESULT hrStatus, 292
321 __in BOOTSTRAPPER_APPLY_RESTART restart, 293// args.cbSize = sizeof(args);
322 __inout BOOTSTRAPPER_APPLYCOMPLETE_ACTION* pAction 294// args.wzPackageOrContainerId = wzPackageOrContainerId;
323 ) 295// args.wzPayloadId = wzPayloadId;
324{ 296// args.wzSource = *pwzSource;
325 HRESULT hr = S_OK; 297// args.wzDownloadUrl = *pwzDownloadUrl;
326 BA_ONAPPLYCOMPLETE_ARGS args = { }; 298// args.wzPayloadContainerId = wzPayloadContainerId;
327 BA_ONAPPLYCOMPLETE_RESULTS results = { }; 299// args.recommendation = *pCacheOperation;
328 300
329 args.cbSize = sizeof(args); 301// results.cbSize = sizeof(results);
330 args.hrStatus = hrStatus; 302// results.action = *pCacheOperation;
331 args.restart = restart; 303
332 args.recommendation = *pAction; 304// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, &args, args.cbSize, &result);
333 305// ExitOnFailure(hr, "BA OnCacheAcquireBegin failed.");
334 results.cbSize = sizeof(results); 306
335 results.action = *pAction; 307// if (results.fCancel)
336 308// {
337 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYCOMPLETE, &args, &results); 309// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
338 ExitOnFailure(hr, "BA OnApplyComplete failed."); 310// }
339 311// else
340 *pAction = results.action; 312// {
341 313// // Verify the BA requested an action that is possible.
342LExit: 314// if (BOOTSTRAPPER_CACHE_OPERATION_DOWNLOAD == results.action && *pwzDownloadUrl && **pwzDownloadUrl ||
343 return hr; 315// BOOTSTRAPPER_CACHE_OPERATION_EXTRACT == results.action && wzPayloadContainerId ||
344} 316// BOOTSTRAPPER_CACHE_OPERATION_COPY == results.action ||
345 317// BOOTSTRAPPER_CACHE_OPERATION_NONE == results.action)
346EXTERN_C BAAPI UserExperienceOnApplyDowngrade( 318// {
347 __in BURN_USER_EXPERIENCE* pUserExperience, 319// *pCacheOperation = results.action;
348 __inout HRESULT* phrStatus 320// }
349 ) 321// }
350{ 322
351 HRESULT hr = S_OK; 323// LExit:
352 BA_ONAPPLYDOWNGRADE_ARGS args = { }; 324// return hr;
353 BA_ONAPPLYDOWNGRADE_RESULTS results = { }; 325// }
354 326
355 args.cbSize = sizeof(args); 327// EXTERN_C BAAPI UserExperienceOnCacheAcquireComplete(
356 args.hrRecommended = *phrStatus; 328// __in BURN_USER_EXPERIENCE* pUserExperience,
357 329// __in_z_opt LPCWSTR wzPackageOrContainerId,
358 results.cbSize = sizeof(results); 330// __in_z_opt LPCWSTR wzPayloadId,
359 results.hrStatus = *phrStatus; 331// __in HRESULT hrStatus,
360 332// __inout BOOL* pfRetry
361 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYDOWNGRADE, &args, &results); 333// )
362 ExitOnFailure(hr, "BA OnApplyDowngrade failed."); 334// {
363 335// HRESULT hr = S_OK;
364 *phrStatus = results.hrStatus; 336// BA_ONCACHEACQUIRECOMPLETE_ARGS args = { };
365 337// BA_ONCACHEACQUIRECOMPLETE_RESULTS results = { };
366LExit: 338// PIPE_RPC_RESULT result = { };
367 return hr; 339
368} 340// args.cbSize = sizeof(args);
369 341// args.wzPackageOrContainerId = wzPackageOrContainerId;
370EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionBegin( 342// args.wzPayloadId = wzPayloadId;
371 __in BURN_USER_EXPERIENCE* pUserExperience, 343// args.hrStatus = hrStatus;
372 __in LPCWSTR wzTransactionId 344// args.recommendation = *pfRetry ? BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_RETRY : BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_NONE;
373 ) 345
374{ 346// results.cbSize = sizeof(results);
375 HRESULT hr = S_OK; 347// results.action = args.recommendation;
376 BA_ONBEGINMSITRANSACTIONBEGIN_ARGS args = { }; 348
377 BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS results = { }; 349// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, &args, args.cbSize, &result);
378 350// ExitOnFailure(hr, "BA OnCacheAcquireComplete failed.");
379 args.cbSize = sizeof(args); 351
380 args.wzTransactionId = wzTransactionId; 352// if (FAILED(hrStatus))
381 353// {
382 results.cbSize = sizeof(results); 354// *pfRetry = BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_RETRY == results.action;
383 355// }
384 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results); 356
385 ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); 357// LExit:
386 358// return hr;
387 if (results.fCancel) 359// }
388 { 360
389 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 361// EXTERN_C BAAPI UserExperienceOnCacheAcquireProgress(
390 } 362// __in BURN_USER_EXPERIENCE* pUserExperience,
391 363// __in_z_opt LPCWSTR wzPackageOrContainerId,
392LExit: 364// __in_z_opt LPCWSTR wzPayloadId,
393 return hr; 365// __in DWORD64 dw64Progress,
394} 366// __in DWORD64 dw64Total,
395 367// __in DWORD dwOverallPercentage
396EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionComplete( 368// )
397 __in BURN_USER_EXPERIENCE* pUserExperience, 369// {
398 __in LPCWSTR wzTransactionId, 370// HRESULT hr = S_OK;
399 __in HRESULT hrStatus 371// BA_ONCACHEACQUIREPROGRESS_ARGS args = { };
400 ) 372// BA_ONCACHEACQUIREPROGRESS_RESULTS results = { };
401{ 373// PIPE_RPC_RESULT result = { };
402 HRESULT hr = S_OK; 374
403 BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS args = { }; 375// args.cbSize = sizeof(args);
404 BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS results = { }; 376// args.wzPackageOrContainerId = wzPackageOrContainerId;
405 377// args.wzPayloadId = wzPayloadId;
406 args.cbSize = sizeof(args); 378// args.dw64Progress = dw64Progress;
407 args.wzTransactionId = wzTransactionId; 379// args.dw64Total = dw64Total;
408 args.hrStatus = hrStatus; 380// args.dwOverallPercentage = dwOverallPercentage;
409 381
410 results.cbSize = sizeof(results); 382// results.cbSize = sizeof(results);
411 383
412 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE, &args, &results); 384// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, &args, args.cbSize, &result);
413 ExitOnFailure(hr, "BA OnBeginMsiTransactionComplete failed."); 385// ExitOnFailure(hr, "BA OnCacheAcquireProgress failed.");
414 386
415LExit: 387// if (results.fCancel)
416 return hr; 388// {
417} 389// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
418 390// }
419EXTERN_C BAAPI UserExperienceOnCacheAcquireBegin( 391
420 __in BURN_USER_EXPERIENCE* pUserExperience, 392// LExit:
421 __in_z_opt LPCWSTR wzPackageOrContainerId, 393// return hr;
422 __in_z_opt LPCWSTR wzPayloadId, 394// }
423 __in_z LPWSTR* pwzSource, 395
424 __in_z LPWSTR* pwzDownloadUrl, 396// EXTERN_C BAAPI UserExperienceOnCacheAcquireResolving(
425 __in_z_opt LPCWSTR wzPayloadContainerId, 397// __in BURN_USER_EXPERIENCE* pUserExperience,
426 __out BOOTSTRAPPER_CACHE_OPERATION* pCacheOperation 398// __in_z_opt LPCWSTR wzPackageOrContainerId,
427 ) 399// __in_z_opt LPCWSTR wzPayloadId,
428{ 400// __in_z LPWSTR* rgSearchPaths,
429 HRESULT hr = S_OK; 401// __in DWORD cSearchPaths,
430 BA_ONCACHEACQUIREBEGIN_ARGS args = { }; 402// __in BOOL fFoundLocal,
431 BA_ONCACHEACQUIREBEGIN_RESULTS results = { }; 403// __in DWORD* pdwChosenSearchPath,
432 *pCacheOperation = BOOTSTRAPPER_CACHE_OPERATION_NONE; 404// __in_z_opt LPWSTR* pwzDownloadUrl,
433 405// __in_z_opt LPCWSTR wzPayloadContainerId,
434 args.cbSize = sizeof(args); 406// __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pCacheOperation
435 args.wzPackageOrContainerId = wzPackageOrContainerId; 407// )
436 args.wzPayloadId = wzPayloadId; 408// {
437 args.wzSource = *pwzSource; 409// HRESULT hr = S_OK;
438 args.wzDownloadUrl = *pwzDownloadUrl; 410// BA_ONCACHEACQUIRERESOLVING_ARGS args = { };
439 args.wzPayloadContainerId = wzPayloadContainerId; 411// BA_ONCACHEACQUIRERESOLVING_RESULTS results = { };
440 args.recommendation = *pCacheOperation; 412// PIPE_RPC_RESULT result = { };
441 413
442 results.cbSize = sizeof(results); 414// args.cbSize = sizeof(args);
443 results.action = *pCacheOperation; 415// args.wzPackageOrContainerId = wzPackageOrContainerId;
444 416// args.wzPayloadId = wzPayloadId;
445 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, &args, &results); 417// args.rgSearchPaths = const_cast<LPCWSTR*>(rgSearchPaths);
446 ExitOnFailure(hr, "BA OnCacheAcquireBegin failed."); 418// args.cSearchPaths = cSearchPaths;
447 419// args.fFoundLocal = fFoundLocal;
448 if (results.fCancel) 420// args.dwRecommendedSearchPath = *pdwChosenSearchPath;
449 { 421// args.wzDownloadUrl = *pwzDownloadUrl;
450 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 422// args.recommendation = *pCacheOperation;
451 } 423
452 else 424// results.cbSize = sizeof(results);
453 { 425// results.dwChosenSearchPath = *pdwChosenSearchPath;
454 // Verify the BA requested an action that is possible. 426// results.action = *pCacheOperation;
455 if (BOOTSTRAPPER_CACHE_OPERATION_DOWNLOAD == results.action && *pwzDownloadUrl && **pwzDownloadUrl || 427
456 BOOTSTRAPPER_CACHE_OPERATION_EXTRACT == results.action && wzPayloadContainerId || 428// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING, &args, args.cbSize, &result);
457 BOOTSTRAPPER_CACHE_OPERATION_COPY == results.action || 429// ExitOnFailure(hr, "BA OnCacheAcquireResolving failed.");
458 BOOTSTRAPPER_CACHE_OPERATION_NONE == results.action) 430
459 { 431// if (results.fCancel)
460 *pCacheOperation = results.action; 432// {
461 } 433// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
462 } 434// }
463 435// else
464LExit: 436// {
465 return hr; 437// // Verify the BA requested an action that is possible.
466} 438// if (BOOTSTRAPPER_CACHE_RESOLVE_DOWNLOAD == results.action && *pwzDownloadUrl && **pwzDownloadUrl ||
467 439// BOOTSTRAPPER_CACHE_RESOLVE_CONTAINER == results.action && wzPayloadContainerId ||
468EXTERN_C BAAPI UserExperienceOnCacheAcquireComplete( 440// BOOTSTRAPPER_CACHE_RESOLVE_RETRY == results.action ||
469 __in BURN_USER_EXPERIENCE* pUserExperience, 441// BOOTSTRAPPER_CACHE_RESOLVE_NONE == results.action)
470 __in_z_opt LPCWSTR wzPackageOrContainerId, 442// {
471 __in_z_opt LPCWSTR wzPayloadId, 443// *pCacheOperation = results.action;
472 __in HRESULT hrStatus, 444// }
473 __inout BOOL* pfRetry 445// else if (BOOTSTRAPPER_CACHE_RESOLVE_LOCAL == results.action && results.dwChosenSearchPath < cSearchPaths)
474 ) 446// {
475{ 447// *pdwChosenSearchPath = results.dwChosenSearchPath;
476 HRESULT hr = S_OK; 448// *pCacheOperation = results.action;
477 BA_ONCACHEACQUIRECOMPLETE_ARGS args = { }; 449// }
478 BA_ONCACHEACQUIRECOMPLETE_RESULTS results = { }; 450// }
479 451
480 args.cbSize = sizeof(args); 452// LExit:
481 args.wzPackageOrContainerId = wzPackageOrContainerId; 453// return hr;
482 args.wzPayloadId = wzPayloadId; 454// }
483 args.hrStatus = hrStatus; 455
484 args.recommendation = *pfRetry ? BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_RETRY : BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_NONE; 456// EXTERN_C BAAPI UserExperienceOnCacheBegin(
485 457// __in BURN_USER_EXPERIENCE* pUserExperience
486 results.cbSize = sizeof(results); 458// )
487 results.action = args.recommendation; 459// {
488 460// HRESULT hr = S_OK;
489 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, &args, &results); 461// BA_ONCACHEBEGIN_ARGS args = { };
490 ExitOnFailure(hr, "BA OnCacheAcquireComplete failed."); 462// BA_ONCACHEBEGIN_RESULTS results = { };
491 463// PIPE_RPC_RESULT result = { };
492 if (FAILED(hrStatus)) 464
493 { 465// args.cbSize = sizeof(args);
494 *pfRetry = BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_RETRY == results.action; 466
495 } 467// results.cbSize = sizeof(results);
496 468
497LExit: 469// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEBEGIN, &args, args.cbSize, &result);
498 return hr; 470// ExitOnFailure(hr, "BA OnCacheBegin failed.");
499} 471
500 472// if (results.fCancel)
501EXTERN_C BAAPI UserExperienceOnCacheAcquireProgress( 473// {
502 __in BURN_USER_EXPERIENCE* pUserExperience, 474// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
503 __in_z_opt LPCWSTR wzPackageOrContainerId, 475// }
504 __in_z_opt LPCWSTR wzPayloadId, 476
505 __in DWORD64 dw64Progress, 477// LExit:
506 __in DWORD64 dw64Total, 478// return hr;
507 __in DWORD dwOverallPercentage 479// }
508 ) 480
509{ 481// EXTERN_C BAAPI UserExperienceOnCacheComplete(
510 HRESULT hr = S_OK; 482// __in BURN_USER_EXPERIENCE* pUserExperience,
511 BA_ONCACHEACQUIREPROGRESS_ARGS args = { }; 483// __in HRESULT hrStatus
512 BA_ONCACHEACQUIREPROGRESS_RESULTS results = { }; 484// )
513 485// {
514 args.cbSize = sizeof(args); 486// HRESULT hr = S_OK;
515 args.wzPackageOrContainerId = wzPackageOrContainerId; 487// BA_ONCACHECOMPLETE_ARGS args = { };
516 args.wzPayloadId = wzPayloadId; 488// BA_ONCACHECOMPLETE_RESULTS results = { };
517 args.dw64Progress = dw64Progress; 489// PIPE_RPC_RESULT result = { };
518 args.dw64Total = dw64Total; 490
519 args.dwOverallPercentage = dwOverallPercentage; 491// args.cbSize = sizeof(args);
520 492// args.hrStatus = hrStatus;
521 results.cbSize = sizeof(results); 493
522 494// results.cbSize = sizeof(results);
523 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, &args, &results); 495
524 ExitOnFailure(hr, "BA OnCacheAcquireProgress failed."); 496// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECOMPLETE, &args, args.cbSize, &result);
525 497// ExitOnFailure(hr, "BA OnCacheComplete failed.");
526 if (results.fCancel) 498
527 { 499// LExit:
528 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 500// return hr;
529 } 501// }
530 502
531LExit: 503// EXTERN_C BAAPI UserExperienceOnCacheContainerOrPayloadVerifyBegin(
532 return hr; 504// __in BURN_USER_EXPERIENCE* pUserExperience,
533} 505// __in_z_opt LPCWSTR wzPackageOrContainerId,
534 506// __in_z_opt LPCWSTR wzPayloadId
535EXTERN_C BAAPI UserExperienceOnCacheAcquireResolving( 507// )
536 __in BURN_USER_EXPERIENCE* pUserExperience, 508// {
537 __in_z_opt LPCWSTR wzPackageOrContainerId, 509// HRESULT hr = S_OK;
538 __in_z_opt LPCWSTR wzPayloadId, 510// BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS args = { };
539 __in_z LPWSTR* rgSearchPaths, 511// BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS results = { };
540 __in DWORD cSearchPaths, 512// PIPE_RPC_RESULT result = { };
541 __in BOOL fFoundLocal, 513
542 __in DWORD* pdwChosenSearchPath, 514// args.cbSize = sizeof(args);
543 __in_z_opt LPWSTR* pwzDownloadUrl, 515// args.wzPackageOrContainerId = wzPackageOrContainerId;
544 __in_z_opt LPCWSTR wzPayloadContainerId, 516// args.wzPayloadId = wzPayloadId;
545 __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pCacheOperation 517
546 ) 518// results.cbSize = sizeof(results);
547{ 519
548 HRESULT hr = S_OK; 520// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN, &args, args.cbSize, &result);
549 BA_ONCACHEACQUIRERESOLVING_ARGS args = { }; 521// ExitOnFailure(hr, "BA OnCacheContainerOrPayloadVerifyBegin failed.");
550 BA_ONCACHEACQUIRERESOLVING_RESULTS results = { }; 522
551 523// if (results.fCancel)
552 args.cbSize = sizeof(args); 524// {
553 args.wzPackageOrContainerId = wzPackageOrContainerId; 525// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
554 args.wzPayloadId = wzPayloadId; 526// }
555 args.rgSearchPaths = const_cast<LPCWSTR*>(rgSearchPaths); 527
556 args.cSearchPaths = cSearchPaths; 528// LExit:
557 args.fFoundLocal = fFoundLocal; 529// return hr;
558 args.dwRecommendedSearchPath = *pdwChosenSearchPath; 530// }
559 args.wzDownloadUrl = *pwzDownloadUrl; 531
560 args.recommendation = *pCacheOperation; 532// EXTERN_C BAAPI UserExperienceOnCacheContainerOrPayloadVerifyComplete(
561 533// __in BURN_USER_EXPERIENCE* pUserExperience,
562 results.cbSize = sizeof(results); 534// __in_z_opt LPCWSTR wzPackageOrContainerId,
563 results.dwChosenSearchPath = *pdwChosenSearchPath; 535// __in_z_opt LPCWSTR wzPayloadId,
564 results.action = *pCacheOperation; 536// __in HRESULT hrStatus
565 537// )
566 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING, &args, &results); 538// {
567 ExitOnFailure(hr, "BA OnCacheAcquireResolving failed."); 539// HRESULT hr = S_OK;
568 540// BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS args = { };
569 if (results.fCancel) 541// BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS results = { };
570 { 542// PIPE_RPC_RESULT result = { };
571 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 543
572 } 544// args.cbSize = sizeof(args);
573 else 545// args.wzPackageOrContainerId = wzPackageOrContainerId;
574 { 546// args.wzPayloadId = wzPayloadId;
575 // Verify the BA requested an action that is possible. 547// args.hrStatus = hrStatus;
576 if (BOOTSTRAPPER_CACHE_RESOLVE_DOWNLOAD == results.action && *pwzDownloadUrl && **pwzDownloadUrl || 548
577 BOOTSTRAPPER_CACHE_RESOLVE_CONTAINER == results.action && wzPayloadContainerId || 549// results.cbSize = sizeof(results);
578 BOOTSTRAPPER_CACHE_RESOLVE_RETRY == results.action || 550
579 BOOTSTRAPPER_CACHE_RESOLVE_NONE == results.action) 551// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE, &args, args.cbSize, &result);
580 { 552// ExitOnFailure(hr, "BA OnCacheContainerOrPayloadVerifyComplete failed.");
581 *pCacheOperation = results.action; 553
582 } 554// LExit:
583 else if (BOOTSTRAPPER_CACHE_RESOLVE_LOCAL == results.action && results.dwChosenSearchPath < cSearchPaths) 555// return hr;
584 { 556// }
585 *pdwChosenSearchPath = results.dwChosenSearchPath; 557
586 *pCacheOperation = results.action; 558// EXTERN_C BAAPI UserExperienceOnCacheContainerOrPayloadVerifyProgress(
587 } 559// __in BURN_USER_EXPERIENCE* pUserExperience,
588 } 560// __in_z_opt LPCWSTR wzPackageOrContainerId,
589 561// __in_z_opt LPCWSTR wzPayloadId,
590LExit: 562// __in DWORD64 dw64Progress,
591 return hr; 563// __in DWORD64 dw64Total,
592} 564// __in DWORD dwOverallPercentage
593 565// )
594EXTERN_C BAAPI UserExperienceOnCacheBegin( 566// {
595 __in BURN_USER_EXPERIENCE* pUserExperience 567// HRESULT hr = S_OK;
596 ) 568// BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS args = { };
597{ 569// BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS results = { };
598 HRESULT hr = S_OK; 570// PIPE_RPC_RESULT result = { };
599 BA_ONCACHEBEGIN_ARGS args = { }; 571
600 BA_ONCACHEBEGIN_RESULTS results = { }; 572// args.cbSize = sizeof(args);
601 573// args.wzPackageOrContainerId = wzPackageOrContainerId;
602 args.cbSize = sizeof(args); 574// args.wzPayloadId = wzPayloadId;
603 575// args.dw64Progress = dw64Progress;
604 results.cbSize = sizeof(results); 576// args.dw64Total = dw64Total;
605 577// args.dwOverallPercentage = dwOverallPercentage;
606 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEBEGIN, &args, &results); 578
607 ExitOnFailure(hr, "BA OnCacheBegin failed."); 579// results.cbSize = sizeof(results);
608 580
609 if (results.fCancel) 581// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS, &args, args.cbSize, &result);
610 { 582// ExitOnFailure(hr, "BA OnCacheContainerOrPayloadVerifyProgress failed.");
611 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 583
612 } 584// if (results.fCancel)
613 585// {
614LExit: 586// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
615 return hr; 587// }
616} 588
617 589// LExit:
618EXTERN_C BAAPI UserExperienceOnCacheComplete( 590// return hr;
619 __in BURN_USER_EXPERIENCE* pUserExperience, 591// }
620 __in HRESULT hrStatus 592
621 ) 593// EXTERN_C BAAPI UserExperienceOnCachePackageBegin(
622{ 594// __in BURN_USER_EXPERIENCE* pUserExperience,
623 HRESULT hr = S_OK; 595// __in_z LPCWSTR wzPackageId,
624 BA_ONCACHECOMPLETE_ARGS args = { }; 596// __in DWORD cCachePayloads,
625 BA_ONCACHECOMPLETE_RESULTS results = { }; 597// __in DWORD64 dw64PackageCacheSize,
626 598// __in BOOL fVital
627 args.cbSize = sizeof(args); 599// )
628 args.hrStatus = hrStatus; 600// {
629 601// HRESULT hr = S_OK;
630 results.cbSize = sizeof(results); 602// BA_ONCACHEPACKAGEBEGIN_ARGS args = { };
631 603// BA_ONCACHEPACKAGEBEGIN_RESULTS results = { };
632 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECOMPLETE, &args, &results); 604// PIPE_RPC_RESULT result = { };
633 ExitOnFailure(hr, "BA OnCacheComplete failed."); 605
634 606// args.cbSize = sizeof(args);
635LExit: 607// args.wzPackageId = wzPackageId;
636 return hr; 608// args.cCachePayloads = cCachePayloads;
637} 609// args.dw64PackageCacheSize = dw64PackageCacheSize;
638 610// args.fVital = fVital;
639EXTERN_C BAAPI UserExperienceOnCacheContainerOrPayloadVerifyBegin( 611
640 __in BURN_USER_EXPERIENCE* pUserExperience, 612// results.cbSize = sizeof(results);
641 __in_z_opt LPCWSTR wzPackageOrContainerId, 613
642 __in_z_opt LPCWSTR wzPayloadId 614// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, &args, args.cbSize, &result);
643 ) 615// ExitOnFailure(hr, "BA OnCachePackageBegin failed.");
644{ 616
645 HRESULT hr = S_OK; 617// if (results.fCancel)
646 BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS args = { }; 618// {
647 BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS results = { }; 619// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
648 620// }
649 args.cbSize = sizeof(args); 621
650 args.wzPackageOrContainerId = wzPackageOrContainerId; 622// LExit:
651 args.wzPayloadId = wzPayloadId; 623// return hr;
652 624// }
653 results.cbSize = sizeof(results); 625
654 626// EXTERN_C BAAPI UserExperienceOnCachePackageComplete(
655 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN, &args, &results); 627// __in BURN_USER_EXPERIENCE* pUserExperience,
656 ExitOnFailure(hr, "BA OnCacheContainerOrPayloadVerifyBegin failed."); 628// __in_z LPCWSTR wzPackageId,
657 629// __in HRESULT hrStatus,
658 if (results.fCancel) 630// __inout BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION* pAction
659 { 631// )
660 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 632// {
661 } 633// HRESULT hr = S_OK;
662 634// BA_ONCACHEPACKAGECOMPLETE_ARGS args = { };
663LExit: 635// BA_ONCACHEPACKAGECOMPLETE_RESULTS results = { };
664 return hr; 636// PIPE_RPC_RESULT result = { };
665} 637
666 638// args.cbSize = sizeof(args);
667EXTERN_C BAAPI UserExperienceOnCacheContainerOrPayloadVerifyComplete( 639// args.wzPackageId = wzPackageId;
668 __in BURN_USER_EXPERIENCE* pUserExperience, 640// args.hrStatus = hrStatus;
669 __in_z_opt LPCWSTR wzPackageOrContainerId, 641// args.recommendation = *pAction;
670 __in_z_opt LPCWSTR wzPayloadId, 642
671 __in HRESULT hrStatus 643// results.cbSize = sizeof(results);
672 ) 644// results.action = *pAction;
673{ 645
674 HRESULT hr = S_OK; 646// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGECOMPLETE, &args, args.cbSize, &result);
675 BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS args = { }; 647// ExitOnFailure(hr, "BA OnCachePackageComplete failed.");
676 BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS results = { }; 648
677 649// if (FAILED(hrStatus))
678 args.cbSize = sizeof(args); 650// {
679 args.wzPackageOrContainerId = wzPackageOrContainerId; 651// *pAction = results.action;
680 args.wzPayloadId = wzPayloadId; 652// }
681 args.hrStatus = hrStatus; 653
682 654// LExit:
683 results.cbSize = sizeof(results); 655// return hr;
684 656// }
685 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE, &args, &results); 657
686 ExitOnFailure(hr, "BA OnCacheContainerOrPayloadVerifyComplete failed."); 658// EXTERN_C BAAPI UserExperienceOnCachePackageNonVitalValidationFailure(
687 659// __in BURN_USER_EXPERIENCE* pUserExperience,
688LExit: 660// __in_z LPCWSTR wzPackageId,
689 return hr; 661// __in HRESULT hrStatus,
690} 662// __inout BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION* pAction
691 663// )
692EXTERN_C BAAPI UserExperienceOnCacheContainerOrPayloadVerifyProgress( 664// {
693 __in BURN_USER_EXPERIENCE* pUserExperience, 665// HRESULT hr = S_OK;
694 __in_z_opt LPCWSTR wzPackageOrContainerId, 666// BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_ARGS args = { };
695 __in_z_opt LPCWSTR wzPayloadId, 667// BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_RESULTS results = { };
696 __in DWORD64 dw64Progress, 668// PIPE_RPC_RESULT result = { };
697 __in DWORD64 dw64Total, 669
698 __in DWORD dwOverallPercentage 670// args.cbSize = sizeof(args);
699 ) 671// args.wzPackageId = wzPackageId;
700{ 672// args.hrStatus = hrStatus;
701 HRESULT hr = S_OK; 673// args.recommendation = *pAction;
702 BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS args = { }; 674
703 BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS results = { }; 675// results.cbSize = sizeof(results);
704 676// results.action = *pAction;
705 args.cbSize = sizeof(args); 677
706 args.wzPackageOrContainerId = wzPackageOrContainerId; 678// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGENONVITALVALIDATIONFAILURE, &args, args.cbSize, &result);
707 args.wzPayloadId = wzPayloadId; 679// ExitOnFailure(hr, "BA OnCachePackageNonVitalValidationFailure failed.");
708 args.dw64Progress = dw64Progress; 680
709 args.dw64Total = dw64Total; 681// switch (results.action)
710 args.dwOverallPercentage = dwOverallPercentage; 682// {
711 683// case BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION_NONE: __fallthrough;
712 results.cbSize = sizeof(results); 684// case BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION_ACQUIRE:
713 685// *pAction = results.action;
714 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS, &args, &results); 686// break;
715 ExitOnFailure(hr, "BA OnCacheContainerOrPayloadVerifyProgress failed."); 687// }
716 688
717 if (results.fCancel) 689// LExit:
718 { 690// return hr;
719 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 691// }
720 } 692
721 693// EXTERN_C BAAPI UserExperienceOnCachePayloadExtractBegin(
722LExit: 694// __in BURN_USER_EXPERIENCE* pUserExperience,
723 return hr; 695// __in_z_opt LPCWSTR wzContainerId,
724} 696// __in_z_opt LPCWSTR wzPayloadId
725 697// )
726EXTERN_C BAAPI UserExperienceOnCachePackageBegin( 698// {
727 __in BURN_USER_EXPERIENCE* pUserExperience, 699// HRESULT hr = S_OK;
728 __in_z LPCWSTR wzPackageId, 700// BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS args = { };
729 __in DWORD cCachePayloads, 701// BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS results = { };
730 __in DWORD64 dw64PackageCacheSize, 702// PIPE_RPC_RESULT result = { };
731 __in BOOL fVital 703
732 ) 704// args.cbSize = sizeof(args);
733{ 705// args.wzContainerId = wzContainerId;
734 HRESULT hr = S_OK; 706// args.wzPayloadId = wzPayloadId;
735 BA_ONCACHEPACKAGEBEGIN_ARGS args = { }; 707
736 BA_ONCACHEPACKAGEBEGIN_RESULTS results = { }; 708// results.cbSize = sizeof(results);
737 709
738 args.cbSize = sizeof(args); 710// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, &args, args.cbSize, &result);
739 args.wzPackageId = wzPackageId; 711// ExitOnFailure(hr, "BA OnCachePayloadExtractBegin failed.");
740 args.cCachePayloads = cCachePayloads; 712
741 args.dw64PackageCacheSize = dw64PackageCacheSize; 713// if (results.fCancel)
742 args.fVital = fVital; 714// {
743 715// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
744 results.cbSize = sizeof(results); 716// }
745 717
746 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, &args, &results); 718// LExit:
747 ExitOnFailure(hr, "BA OnCachePackageBegin failed."); 719// return hr;
748 720// }
749 if (results.fCancel) 721
750 { 722// EXTERN_C BAAPI UserExperienceOnCachePayloadExtractComplete(
751 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 723// __in BURN_USER_EXPERIENCE* pUserExperience,
752 } 724// __in_z_opt LPCWSTR wzContainerId,
753 725// __in_z_opt LPCWSTR wzPayloadId,
754LExit: 726// __in HRESULT hrStatus
755 return hr; 727// )
756} 728// {
757 729// HRESULT hr = S_OK;
758EXTERN_C BAAPI UserExperienceOnCachePackageComplete( 730// BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS args = { };
759 __in BURN_USER_EXPERIENCE* pUserExperience, 731// BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS results = { };
760 __in_z LPCWSTR wzPackageId, 732// PIPE_RPC_RESULT result = { };
761 __in HRESULT hrStatus, 733
762 __inout BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION* pAction 734// args.cbSize = sizeof(args);
763 ) 735// args.wzContainerId = wzContainerId;
764{ 736// args.wzPayloadId = wzPayloadId;
765 HRESULT hr = S_OK; 737// args.hrStatus = hrStatus;
766 BA_ONCACHEPACKAGECOMPLETE_ARGS args = { }; 738
767 BA_ONCACHEPACKAGECOMPLETE_RESULTS results = { }; 739// results.cbSize = sizeof(results);
768 740
769 args.cbSize = sizeof(args); 741// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, &args, args.cbSize, &result);
770 args.wzPackageId = wzPackageId; 742// ExitOnFailure(hr, "BA OnCachePayloadExtractComplete failed.");
771 args.hrStatus = hrStatus; 743
772 args.recommendation = *pAction; 744// LExit:
773 745// return hr;
774 results.cbSize = sizeof(results); 746// }
775 results.action = *pAction; 747
776 748// EXTERN_C BAAPI UserExperienceOnCachePayloadExtractProgress(
777 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGECOMPLETE, &args, &results); 749// __in BURN_USER_EXPERIENCE* pUserExperience,
778 ExitOnFailure(hr, "BA OnCachePackageComplete failed."); 750// __in_z_opt LPCWSTR wzContainerId,
779 751// __in_z_opt LPCWSTR wzPayloadId,
780 if (FAILED(hrStatus)) 752// __in DWORD64 dw64Progress,
781 { 753// __in DWORD64 dw64Total,
782 *pAction = results.action; 754// __in DWORD dwOverallPercentage
783 } 755// )
784 756// {
785LExit: 757// HRESULT hr = S_OK;
786 return hr; 758// BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS args = { };
787} 759// BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS results = { };
788 760// PIPE_RPC_RESULT result = { };
789EXTERN_C BAAPI UserExperienceOnCachePackageNonVitalValidationFailure( 761
790 __in BURN_USER_EXPERIENCE* pUserExperience, 762// args.cbSize = sizeof(args);
791 __in_z LPCWSTR wzPackageId, 763// args.wzContainerId = wzContainerId;
792 __in HRESULT hrStatus, 764// args.wzPayloadId = wzPayloadId;
793 __inout BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION* pAction 765// args.dw64Progress = dw64Progress;
794 ) 766// args.dw64Total = dw64Total;
795{ 767// args.dwOverallPercentage = dwOverallPercentage;
796 HRESULT hr = S_OK; 768
797 BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_ARGS args = { }; 769// results.cbSize = sizeof(results);
798 BA_ONCACHEPACKAGENONVITALVALIDATIONFAILURE_RESULTS results = { }; 770
799 771// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, &args, args.cbSize, &result);
800 args.cbSize = sizeof(args); 772// ExitOnFailure(hr, "BA OnCachePayloadExtractProgress failed.");
801 args.wzPackageId = wzPackageId; 773
802 args.hrStatus = hrStatus; 774// if (results.fCancel)
803 args.recommendation = *pAction; 775// {
804 776// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
805 results.cbSize = sizeof(results); 777// }
806 results.action = *pAction; 778
807 779// LExit:
808 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGENONVITALVALIDATIONFAILURE, &args, &results); 780// return hr;
809 ExitOnFailure(hr, "BA OnCachePackageNonVitalValidationFailure failed."); 781// }
810 782
811 switch (results.action) 783// EXTERN_C BAAPI UserExperienceOnCacheVerifyBegin(
812 { 784// __in BURN_USER_EXPERIENCE* pUserExperience,
813 case BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION_NONE: __fallthrough; 785// __in_z_opt LPCWSTR wzPackageOrContainerId,
814 case BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION_ACQUIRE: 786// __in_z_opt LPCWSTR wzPayloadId
815 *pAction = results.action; 787// )
816 break; 788// {
817 } 789// HRESULT hr = S_OK;
818 790// BA_ONCACHEVERIFYBEGIN_ARGS args = { };
819LExit: 791// BA_ONCACHEVERIFYBEGIN_RESULTS results = { };
820 return hr; 792// PIPE_RPC_RESULT result = { };
821} 793
822 794// args.cbSize = sizeof(args);
823EXTERN_C BAAPI UserExperienceOnCachePayloadExtractBegin( 795// args.wzPackageOrContainerId = wzPackageOrContainerId;
824 __in BURN_USER_EXPERIENCE* pUserExperience, 796// args.wzPayloadId = wzPayloadId;
825 __in_z_opt LPCWSTR wzContainerId, 797
826 __in_z_opt LPCWSTR wzPayloadId 798// results.cbSize = sizeof(results);
827 ) 799
828{ 800// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, &args, args.cbSize, &result);
829 HRESULT hr = S_OK; 801// ExitOnFailure(hr, "BA OnCacheVerifyBegin failed.");
830 BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS args = { }; 802
831 BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS results = { }; 803// if (results.fCancel)
832 804// {
833 args.cbSize = sizeof(args); 805// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
834 args.wzContainerId = wzContainerId; 806// }
835 args.wzPayloadId = wzPayloadId; 807
836 808// LExit:
837 results.cbSize = sizeof(results); 809// return hr;
838 810// }
839 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, &args, &results); 811
840 ExitOnFailure(hr, "BA OnCachePayloadExtractBegin failed."); 812// EXTERN_C BAAPI UserExperienceOnCacheVerifyComplete(
841 813// __in BURN_USER_EXPERIENCE* pUserExperience,
842 if (results.fCancel) 814// __in_z_opt LPCWSTR wzPackageOrContainerId,
843 { 815// __in_z_opt LPCWSTR wzPayloadId,
844 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 816// __in HRESULT hrStatus,
845 } 817// __inout BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION* pAction
846 818// )
847LExit: 819// {
848 return hr; 820// HRESULT hr = S_OK;
849} 821// BA_ONCACHEVERIFYCOMPLETE_ARGS args = { };
850 822// BA_ONCACHEVERIFYCOMPLETE_RESULTS results = { };
851EXTERN_C BAAPI UserExperienceOnCachePayloadExtractComplete( 823// PIPE_RPC_RESULT result = { };
852 __in BURN_USER_EXPERIENCE* pUserExperience, 824
853 __in_z_opt LPCWSTR wzContainerId, 825// args.cbSize = sizeof(args);
854 __in_z_opt LPCWSTR wzPayloadId, 826// args.wzPackageOrContainerId = wzPackageOrContainerId;
855 __in HRESULT hrStatus 827// args.wzPayloadId = wzPayloadId;
856 ) 828// args.hrStatus = hrStatus;
857{ 829// args.recommendation = *pAction;
858 HRESULT hr = S_OK; 830
859 BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS args = { }; 831// results.cbSize = sizeof(results);
860 BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS results = { }; 832// results.action = *pAction;
861 833
862 args.cbSize = sizeof(args); 834// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, &args, args.cbSize, &result);
863 args.wzContainerId = wzContainerId; 835// ExitOnFailure(hr, "BA OnCacheVerifyComplete failed.");
864 args.wzPayloadId = wzPayloadId; 836
865 args.hrStatus = hrStatus; 837// if (FAILED(hrStatus))
866 838// {
867 results.cbSize = sizeof(results); 839// *pAction = results.action;
868 840// }
869 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, &args, &results); 841
870 ExitOnFailure(hr, "BA OnCachePayloadExtractComplete failed."); 842// LExit:
871 843// return hr;
872LExit: 844// }
873 return hr; 845
874} 846// EXTERN_C BAAPI UserExperienceOnCacheVerifyProgress(
875 847// __in BURN_USER_EXPERIENCE* pUserExperience,
876EXTERN_C BAAPI UserExperienceOnCachePayloadExtractProgress( 848// __in_z_opt LPCWSTR wzPackageOrContainerId,
877 __in BURN_USER_EXPERIENCE* pUserExperience, 849// __in_z_opt LPCWSTR wzPayloadId,
878 __in_z_opt LPCWSTR wzContainerId, 850// __in DWORD64 dw64Progress,
879 __in_z_opt LPCWSTR wzPayloadId, 851// __in DWORD64 dw64Total,
880 __in DWORD64 dw64Progress, 852// __in DWORD dwOverallPercentage,
881 __in DWORD64 dw64Total, 853// __in BOOTSTRAPPER_CACHE_VERIFY_STEP verifyStep
882 __in DWORD dwOverallPercentage 854// )
883 ) 855// {
884{ 856// HRESULT hr = S_OK;
885 HRESULT hr = S_OK; 857// BA_ONCACHEVERIFYPROGRESS_ARGS args = { };
886 BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS args = { }; 858// BA_ONCACHEVERIFYPROGRESS_RESULTS results = { };
887 BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS results = { }; 859// PIPE_RPC_RESULT result = { };
888 860
889 args.cbSize = sizeof(args); 861// args.cbSize = sizeof(args);
890 args.wzContainerId = wzContainerId; 862// args.wzPackageOrContainerId = wzPackageOrContainerId;
891 args.wzPayloadId = wzPayloadId; 863// args.wzPayloadId = wzPayloadId;
892 args.dw64Progress = dw64Progress; 864// args.dw64Progress = dw64Progress;
893 args.dw64Total = dw64Total; 865// args.dw64Total = dw64Total;
894 args.dwOverallPercentage = dwOverallPercentage; 866// args.dwOverallPercentage = dwOverallPercentage;
895 867// args.verifyStep = verifyStep;
896 results.cbSize = sizeof(results); 868
897 869// results.cbSize = sizeof(results);
898 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, &args, &results); 870
899 ExitOnFailure(hr, "BA OnCachePayloadExtractProgress failed."); 871// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYPROGRESS, &args, args.cbSize, &result);
900 872// ExitOnFailure(hr, "BA OnCacheVerifyProgress failed.");
901 if (results.fCancel) 873
902 { 874// if (results.fCancel)
903 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 875// {
904 } 876// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
905 877// }
906LExit: 878
907 return hr; 879// LExit:
908} 880// return hr;
909 881// }
910EXTERN_C BAAPI UserExperienceOnCacheVerifyBegin( 882
911 __in BURN_USER_EXPERIENCE* pUserExperience, 883// EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionBegin(
912 __in_z_opt LPCWSTR wzPackageOrContainerId, 884// __in BURN_USER_EXPERIENCE* pUserExperience,
913 __in_z_opt LPCWSTR wzPayloadId 885// __in LPCWSTR wzTransactionId
914 ) 886// )
915{ 887// {
916 HRESULT hr = S_OK; 888// HRESULT hr = S_OK;
917 BA_ONCACHEVERIFYBEGIN_ARGS args = { }; 889// BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS args = { };
918 BA_ONCACHEVERIFYBEGIN_RESULTS results = { }; 890// BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS results = { };
919 891// PIPE_RPC_RESULT result = { };
920 args.cbSize = sizeof(args); 892
921 args.wzPackageOrContainerId = wzPackageOrContainerId; 893// args.cbSize = sizeof(args);
922 args.wzPayloadId = wzPayloadId; 894// args.wzTransactionId = wzTransactionId;
923 895
924 results.cbSize = sizeof(results); 896// results.cbSize = sizeof(results);
925 897
926 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, &args, &results); 898// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, args.cbSize, &result);
927 ExitOnFailure(hr, "BA OnCacheVerifyBegin failed."); 899// ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed.");
928 900
929 if (results.fCancel) 901// if (results.fCancel)
930 { 902// {
931 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 903// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
932 } 904// }
933 905
934LExit: 906// LExit:
935 return hr; 907// return hr;
936} 908// }
937 909
938EXTERN_C BAAPI UserExperienceOnCacheVerifyComplete( 910// EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete(
939 __in BURN_USER_EXPERIENCE* pUserExperience, 911// __in BURN_USER_EXPERIENCE* pUserExperience,
940 __in_z_opt LPCWSTR wzPackageOrContainerId, 912// __in LPCWSTR wzTransactionId,
941 __in_z_opt LPCWSTR wzPayloadId, 913// __in HRESULT hrStatus,
942 __in HRESULT hrStatus, 914// __in BOOTSTRAPPER_APPLY_RESTART restart,
943 __inout BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION* pAction 915// __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction
944 ) 916// )
945{ 917// {
946 HRESULT hr = S_OK; 918// HRESULT hr = S_OK;
947 BA_ONCACHEVERIFYCOMPLETE_ARGS args = { }; 919// BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS args = { };
948 BA_ONCACHEVERIFYCOMPLETE_RESULTS results = { }; 920// BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS results = { };
949 921// PIPE_RPC_RESULT result = { };
950 args.cbSize = sizeof(args); 922
951 args.wzPackageOrContainerId = wzPackageOrContainerId; 923// args.cbSize = sizeof(args);
952 args.wzPayloadId = wzPayloadId; 924// args.wzTransactionId = wzTransactionId;
953 args.hrStatus = hrStatus; 925// args.hrStatus = hrStatus;
954 args.recommendation = *pAction; 926// args.restart = restart;
955 927// args.recommendation = *pAction;
956 results.cbSize = sizeof(results); 928
957 results.action = *pAction; 929// results.cbSize = sizeof(results);
958 930// results.action = *pAction;
959 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, &args, &results); 931
960 ExitOnFailure(hr, "BA OnCacheVerifyComplete failed."); 932// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, args.cbSize, &result);
961 933// ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed.");
962 if (FAILED(hrStatus)) 934
963 { 935// *pAction = results.action;
964 *pAction = results.action; 936
965 } 937// LExit:
966 938// return hr;
967LExit: 939// }
968 return hr; 940
969} 941// EXTERN_C BAAPI UserExperienceOnDetectBegin(
970 942// __in BURN_USER_EXPERIENCE* pUserExperience,
971EXTERN_C BAAPI UserExperienceOnCacheVerifyProgress( 943// __in BOOL fCached,
972 __in BURN_USER_EXPERIENCE* pUserExperience, 944// __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType,
973 __in_z_opt LPCWSTR wzPackageOrContainerId, 945// __in DWORD cPackages
974 __in_z_opt LPCWSTR wzPayloadId, 946// )
975 __in DWORD64 dw64Progress, 947// {
976 __in DWORD64 dw64Total, 948// HRESULT hr = S_OK;
977 __in DWORD dwOverallPercentage, 949// BA_ONDETECTBEGIN_ARGS args = { };
978 __in BOOTSTRAPPER_CACHE_VERIFY_STEP verifyStep 950// BA_ONDETECTBEGIN_RESULTS results = { };
979 ) 951// PIPE_RPC_RESULT result = { };
980{ 952
981 HRESULT hr = S_OK; 953// args.cbSize = sizeof(args);
982 BA_ONCACHEVERIFYPROGRESS_ARGS args = { }; 954// args.cPackages = cPackages;
983 BA_ONCACHEVERIFYPROGRESS_RESULTS results = { }; 955// args.registrationType = registrationType;
984 956// args.fCached = fCached;
985 args.cbSize = sizeof(args); 957
986 args.wzPackageOrContainerId = wzPackageOrContainerId; 958// results.cbSize = sizeof(results);
987 args.wzPayloadId = wzPayloadId; 959
988 args.dw64Progress = dw64Progress; 960// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN, &args, args.cbSize, &result);
989 args.dw64Total = dw64Total; 961// ExitOnFailure(hr, "BA OnDetectBegin failed.");
990 args.dwOverallPercentage = dwOverallPercentage; 962
991 args.verifyStep = verifyStep; 963// if (results.fCancel)
992 964// {
993 results.cbSize = sizeof(results); 965// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
994 966// }
995 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYPROGRESS, &args, &results); 967
996 ExitOnFailure(hr, "BA OnCacheVerifyProgress failed."); 968// LExit:
997 969// return hr;
998 if (results.fCancel) 970// }
999 { 971
1000 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 972// EXTERN_C BAAPI UserExperienceOnDetectCompatibleMsiPackage(
1001 } 973// __in BURN_USER_EXPERIENCE* pUserExperience,
1002 974// __in_z LPCWSTR wzPackageId,
1003LExit: 975// __in_z LPCWSTR wzCompatiblePackageId,
1004 return hr; 976// __in VERUTIL_VERSION* pCompatiblePackageVersion
1005} 977// )
1006 978// {
1007EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionBegin( 979// HRESULT hr = S_OK;
1008 __in BURN_USER_EXPERIENCE* pUserExperience, 980// BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS args = { };
1009 __in LPCWSTR wzTransactionId 981// BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS results = { };
1010 ) 982// PIPE_RPC_RESULT result = { };
1011{ 983
1012 HRESULT hr = S_OK; 984// args.cbSize = sizeof(args);
1013 BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS args = { }; 985// args.wzPackageId = wzPackageId;
1014 BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS results = { }; 986// args.wzCompatiblePackageId = wzCompatiblePackageId;
1015 987// args.wzCompatiblePackageVersion = pCompatiblePackageVersion->sczVersion;
1016 args.cbSize = sizeof(args); 988
1017 args.wzTransactionId = wzTransactionId; 989// results.cbSize = sizeof(results);
1018 990
1019 results.cbSize = sizeof(results); 991// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE, &args, args.cbSize, &result);
1020 992// ExitOnFailure(hr, "BA OnDetectCompatibleMsiPackage failed.");
1021 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results); 993
1022 ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); 994// if (results.fCancel)
1023 995// {
1024 if (results.fCancel) 996// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1025 { 997// }
1026 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 998
1027 } 999// LExit:
1028 1000// return hr;
1029LExit: 1001// }
1030 return hr; 1002
1031} 1003// EXTERN_C BAAPI UserExperienceOnDetectComplete(
1032 1004// __in BURN_USER_EXPERIENCE* pUserExperience,
1033EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( 1005// __in HRESULT hrStatus,
1034 __in BURN_USER_EXPERIENCE* pUserExperience, 1006// __in BOOL fEligibleForCleanup
1035 __in LPCWSTR wzTransactionId, 1007// )
1036 __in HRESULT hrStatus, 1008// {
1037 __in BOOTSTRAPPER_APPLY_RESTART restart, 1009// HRESULT hr = S_OK;
1038 __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction 1010// BA_ONDETECTCOMPLETE_ARGS args = { };
1039) 1011// BA_ONDETECTCOMPLETE_RESULTS results = { };
1040{ 1012// PIPE_RPC_RESULT result = { };
1041 HRESULT hr = S_OK; 1013
1042 BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS args = { }; 1014// args.cbSize = sizeof(args);
1043 BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS results = { }; 1015// args.hrStatus = hrStatus;
1044 1016// args.fEligibleForCleanup = fEligibleForCleanup;
1045 args.cbSize = sizeof(args); 1017
1046 args.wzTransactionId = wzTransactionId; 1018// results.cbSize = sizeof(results);
1047 args.hrStatus = hrStatus; 1019
1048 args.restart = restart; 1020// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE, &args, args.cbSize, &result);
1049 args.recommendation = *pAction; 1021// ExitOnFailure(hr, "BA OnDetectComplete failed.");
1050 1022
1051 results.cbSize = sizeof(results); 1023// LExit:
1052 results.action = *pAction; 1024// return hr;
1053 1025// }
1054 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results); 1026
1055 ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); 1027// EXTERN_C BAAPI UserExperienceOnDetectForwardCompatibleBundle(
1056 1028// __in BURN_USER_EXPERIENCE* pUserExperience,
1057 *pAction = results.action; 1029// __in_z LPCWSTR wzBundleId,
1058 1030// __in BOOTSTRAPPER_RELATION_TYPE relationType,
1059LExit: 1031// __in_z LPCWSTR wzBundleTag,
1060 return hr; 1032// __in BOOL fPerMachine,
1061} 1033// __in VERUTIL_VERSION* pVersion,
1062 1034// __in BOOL fMissingFromCache
1063EXTERN_C BAAPI UserExperienceOnDetectBegin( 1035// )
1064 __in BURN_USER_EXPERIENCE* pUserExperience, 1036// {
1065 __in BOOL fCached, 1037// HRESULT hr = S_OK;
1066 __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType, 1038// BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS args = { };
1067 __in DWORD cPackages 1039// BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS results = { };
1068 ) 1040// PIPE_RPC_RESULT result = { };
1069{ 1041
1070 HRESULT hr = S_OK; 1042// args.cbSize = sizeof(args);
1071 BA_ONDETECTBEGIN_ARGS args = { }; 1043// args.wzBundleId = wzBundleId;
1072 BA_ONDETECTBEGIN_RESULTS results = { }; 1044// args.relationType = relationType;
1073 1045// args.wzBundleTag = wzBundleTag;
1074 args.cbSize = sizeof(args); 1046// args.fPerMachine = fPerMachine;
1075 args.cPackages = cPackages; 1047// args.wzVersion = pVersion->sczVersion;
1076 args.registrationType = registrationType; 1048// args.fMissingFromCache = fMissingFromCache;
1077 args.fCached = fCached; 1049
1078 1050// results.cbSize = sizeof(results);
1079 results.cbSize = sizeof(results); 1051
1080 1052// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE, &args, args.cbSize, &result);
1081 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN, &args, &results); 1053// ExitOnFailure(hr, "BA OnDetectForwardCompatibleBundle failed.");
1082 ExitOnFailure(hr, "BA OnDetectBegin failed."); 1054
1083 1055// if (results.fCancel)
1084 if (results.fCancel) 1056// {
1085 { 1057// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1086 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1058// }
1087 } 1059
1088 1060// LExit:
1089LExit: 1061// return hr;
1090 return hr; 1062// }
1091} 1063
1092 1064// EXTERN_C BAAPI UserExperienceOnDetectMsiFeature(
1093EXTERN_C BAAPI UserExperienceOnDetectCompatibleMsiPackage( 1065// __in BURN_USER_EXPERIENCE* pUserExperience,
1094 __in BURN_USER_EXPERIENCE* pUserExperience, 1066// __in_z LPCWSTR wzPackageId,
1095 __in_z LPCWSTR wzPackageId, 1067// __in_z LPCWSTR wzFeatureId,
1096 __in_z LPCWSTR wzCompatiblePackageId, 1068// __in BOOTSTRAPPER_FEATURE_STATE state
1097 __in VERUTIL_VERSION* pCompatiblePackageVersion 1069// )
1098 ) 1070// {
1099{ 1071// HRESULT hr = S_OK;
1100 HRESULT hr = S_OK; 1072// BA_ONDETECTMSIFEATURE_ARGS args = { };
1101 BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS args = { }; 1073// BA_ONDETECTMSIFEATURE_RESULTS results = { };
1102 BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS results = { }; 1074// PIPE_RPC_RESULT result = { };
1103 1075
1104 args.cbSize = sizeof(args); 1076// args.cbSize = sizeof(args);
1105 args.wzPackageId = wzPackageId; 1077// args.wzPackageId = wzPackageId;
1106 args.wzCompatiblePackageId = wzCompatiblePackageId; 1078// args.wzFeatureId = wzFeatureId;
1107 args.wzCompatiblePackageVersion = pCompatiblePackageVersion->sczVersion; 1079// args.state = state;
1108 1080
1109 results.cbSize = sizeof(results); 1081// results.cbSize = sizeof(results);
1110 1082
1111 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE, &args, &results); 1083// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE, &args, args.cbSize, &result);
1112 ExitOnFailure(hr, "BA OnDetectCompatibleMsiPackage failed."); 1084// ExitOnFailure(hr, "BA OnDetectMsiFeature failed.");
1113 1085
1114 if (results.fCancel) 1086// if (results.fCancel)
1115 { 1087// {
1116 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1088// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1117 } 1089// }
1118 1090
1119LExit: 1091// LExit:
1120 return hr; 1092// return hr;
1121} 1093// }
1122 1094
1123EXTERN_C BAAPI UserExperienceOnDetectComplete( 1095// EXTERN_C BAAPI UserExperienceOnDetectPackageBegin(
1124 __in BURN_USER_EXPERIENCE* pUserExperience, 1096// __in BURN_USER_EXPERIENCE* pUserExperience,
1125 __in HRESULT hrStatus, 1097// __in_z LPCWSTR wzPackageId
1126 __in BOOL fEligibleForCleanup 1098// )
1127 ) 1099// {
1128{ 1100// HRESULT hr = S_OK;
1129 HRESULT hr = S_OK; 1101// BA_ONDETECTPACKAGEBEGIN_ARGS args = { };
1130 BA_ONDETECTCOMPLETE_ARGS args = { }; 1102// BA_ONDETECTPACKAGEBEGIN_RESULTS results = { };
1131 BA_ONDETECTCOMPLETE_RESULTS results = { }; 1103// PIPE_RPC_RESULT result = { };
1132 1104
1133 args.cbSize = sizeof(args); 1105// args.cbSize = sizeof(args);
1134 args.hrStatus = hrStatus; 1106// args.wzPackageId = wzPackageId;
1135 args.fEligibleForCleanup = fEligibleForCleanup; 1107
1136 1108// results.cbSize = sizeof(results);
1137 results.cbSize = sizeof(results); 1109
1138 1110// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN, &args, args.cbSize, &result);
1139 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE, &args, &results); 1111// ExitOnFailure(hr, "BA OnDetectPackageBegin failed.");
1140 ExitOnFailure(hr, "BA OnDetectComplete failed."); 1112
1141 1113// if (results.fCancel)
1142LExit: 1114// {
1143 return hr; 1115// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1144} 1116// }
1145 1117
1146EXTERN_C BAAPI UserExperienceOnDetectForwardCompatibleBundle( 1118// LExit:
1147 __in BURN_USER_EXPERIENCE* pUserExperience, 1119// return hr;
1148 __in_z LPCWSTR wzBundleId, 1120// }
1149 __in BOOTSTRAPPER_RELATION_TYPE relationType, 1121
1150 __in_z LPCWSTR wzBundleTag, 1122// EXTERN_C BAAPI UserExperienceOnDetectPackageComplete(
1151 __in BOOL fPerMachine, 1123// __in BURN_USER_EXPERIENCE* pUserExperience,
1152 __in VERUTIL_VERSION* pVersion, 1124// __in_z LPCWSTR wzPackageId,
1153 __in BOOL fMissingFromCache 1125// __in HRESULT hrStatus,
1154 ) 1126// __in BOOTSTRAPPER_PACKAGE_STATE state,
1155{ 1127// __in BOOL fCached
1156 HRESULT hr = S_OK; 1128// )
1157 BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS args = { }; 1129// {
1158 BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS results = { }; 1130// HRESULT hr = S_OK;
1159 1131// BA_ONDETECTPACKAGECOMPLETE_ARGS args = { };
1160 args.cbSize = sizeof(args); 1132// BA_ONDETECTPACKAGECOMPLETE_RESULTS results = { };
1161 args.wzBundleId = wzBundleId; 1133// PIPE_RPC_RESULT result = { };
1162 args.relationType = relationType; 1134
1163 args.wzBundleTag = wzBundleTag; 1135// args.cbSize = sizeof(args);
1164 args.fPerMachine = fPerMachine; 1136// args.wzPackageId = wzPackageId;
1165 args.wzVersion = pVersion->sczVersion; 1137// args.hrStatus = hrStatus;
1166 args.fMissingFromCache = fMissingFromCache; 1138// args.state = state;
1167 1139// args.fCached = fCached;
1168 results.cbSize = sizeof(results); 1140
1169 1141// results.cbSize = sizeof(results);
1170 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE, &args, &results); 1142
1171 ExitOnFailure(hr, "BA OnDetectForwardCompatibleBundle failed."); 1143// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE, &args, args.cbSize, &result);
1172 1144// ExitOnFailure(hr, "BA OnDetectPackageComplete failed.");
1173 if (results.fCancel) 1145
1174 { 1146// LExit:
1175 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1147// return hr;
1176 } 1148// }
1177 1149
1178LExit: 1150// EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle(
1179 return hr; 1151// __in BURN_USER_EXPERIENCE* pUserExperience,
1180} 1152// __in_z LPCWSTR wzBundleId,
1181 1153// __in BOOTSTRAPPER_RELATION_TYPE relationType,
1182EXTERN_C BAAPI UserExperienceOnDetectMsiFeature( 1154// __in_z LPCWSTR wzBundleTag,
1183 __in BURN_USER_EXPERIENCE* pUserExperience, 1155// __in BOOL fPerMachine,
1184 __in_z LPCWSTR wzPackageId, 1156// __in VERUTIL_VERSION* pVersion,
1185 __in_z LPCWSTR wzFeatureId, 1157// __in BOOL fMissingFromCache
1186 __in BOOTSTRAPPER_FEATURE_STATE state 1158// )
1187 ) 1159// {
1188{ 1160// HRESULT hr = S_OK;
1189 HRESULT hr = S_OK; 1161// BA_ONDETECTRELATEDBUNDLE_ARGS args = { };
1190 BA_ONDETECTMSIFEATURE_ARGS args = { }; 1162// BA_ONDETECTRELATEDBUNDLE_RESULTS results = { };
1191 BA_ONDETECTMSIFEATURE_RESULTS results = { }; 1163// PIPE_RPC_RESULT result = { };
1192 1164
1193 args.cbSize = sizeof(args); 1165// args.cbSize = sizeof(args);
1194 args.wzPackageId = wzPackageId; 1166// args.wzBundleId = wzBundleId;
1195 args.wzFeatureId = wzFeatureId; 1167// args.relationType = relationType;
1196 args.state = state; 1168// args.wzBundleTag = wzBundleTag;
1197 1169// args.fPerMachine = fPerMachine;
1198 results.cbSize = sizeof(results); 1170// args.wzVersion = pVersion->sczVersion;
1199 1171// args.fMissingFromCache = fMissingFromCache;
1200 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE, &args, &results); 1172
1201 ExitOnFailure(hr, "BA OnDetectMsiFeature failed."); 1173// results.cbSize = sizeof(results);
1202 1174
1203 if (results.fCancel) 1175// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE, &args, args.cbSize, &result);
1204 { 1176// ExitOnFailure(hr, "BA OnDetectRelatedBundle failed.");
1205 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1177
1206 } 1178// if (results.fCancel)
1207 1179// {
1208LExit: 1180// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1209 return hr; 1181// }
1210} 1182
1211 1183// LExit:
1212EXTERN_C BAAPI UserExperienceOnDetectPackageBegin( 1184// return hr;
1213 __in BURN_USER_EXPERIENCE* pUserExperience, 1185// }
1214 __in_z LPCWSTR wzPackageId 1186
1215 ) 1187// EXTERN_C BAAPI UserExperienceOnDetectRelatedBundlePackage(
1216{ 1188// __in BURN_USER_EXPERIENCE* pUserExperience,
1217 HRESULT hr = S_OK; 1189// __in_z LPCWSTR wzPackageId,
1218 BA_ONDETECTPACKAGEBEGIN_ARGS args = { }; 1190// __in_z LPCWSTR wzBundleId,
1219 BA_ONDETECTPACKAGEBEGIN_RESULTS results = { }; 1191// __in BOOTSTRAPPER_RELATION_TYPE relationType,
1220 1192// __in BOOL fPerMachine,
1221 args.cbSize = sizeof(args); 1193// __in VERUTIL_VERSION* pVersion
1222 args.wzPackageId = wzPackageId; 1194// )
1223 1195// {
1224 results.cbSize = sizeof(results); 1196// HRESULT hr = S_OK;
1225 1197// BA_ONDETECTRELATEDBUNDLEPACKAGE_ARGS args = { };
1226 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN, &args, &results); 1198// BA_ONDETECTRELATEDBUNDLEPACKAGE_RESULTS results = { };
1227 ExitOnFailure(hr, "BA OnDetectPackageBegin failed."); 1199// PIPE_RPC_RESULT result = { };
1228 1200
1229 if (results.fCancel) 1201// args.cbSize = sizeof(args);
1230 { 1202// args.wzPackageId = wzPackageId;
1231 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1203// args.wzBundleId = wzBundleId;
1232 } 1204// args.relationType = relationType;
1233 1205// args.fPerMachine = fPerMachine;
1234LExit: 1206// args.wzVersion = pVersion->sczVersion;
1235 return hr; 1207
1236} 1208// results.cbSize = sizeof(results);
1237 1209
1238EXTERN_C BAAPI UserExperienceOnDetectPackageComplete( 1210// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLEPACKAGE, &args, args.cbSize, &result);
1239 __in BURN_USER_EXPERIENCE* pUserExperience, 1211// ExitOnFailure(hr, "BA OnDetectRelatedBundlePackage failed.");
1240 __in_z LPCWSTR wzPackageId, 1212
1241 __in HRESULT hrStatus, 1213// if (results.fCancel)
1242 __in BOOTSTRAPPER_PACKAGE_STATE state, 1214// {
1243 __in BOOL fCached 1215// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1244 ) 1216// }
1245{ 1217
1246 HRESULT hr = S_OK; 1218// LExit:
1247 BA_ONDETECTPACKAGECOMPLETE_ARGS args = { }; 1219// return hr;
1248 BA_ONDETECTPACKAGECOMPLETE_RESULTS results = { }; 1220// }
1249 1221
1250 args.cbSize = sizeof(args); 1222// EXTERN_C BAAPI UserExperienceOnDetectRelatedMsiPackage(
1251 args.wzPackageId = wzPackageId; 1223// __in BURN_USER_EXPERIENCE* pUserExperience,
1252 args.hrStatus = hrStatus; 1224// __in_z LPCWSTR wzPackageId,
1253 args.state = state; 1225// __in_z LPCWSTR wzUpgradeCode,
1254 args.fCached = fCached; 1226// __in_z LPCWSTR wzProductCode,
1255 1227// __in BOOL fPerMachine,
1256 results.cbSize = sizeof(results); 1228// __in VERUTIL_VERSION* pVersion,
1257 1229// __in BOOTSTRAPPER_RELATED_OPERATION operation
1258 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE, &args, &results); 1230// )
1259 ExitOnFailure(hr, "BA OnDetectPackageComplete failed."); 1231// {
1260 1232// HRESULT hr = S_OK;
1261LExit: 1233// BA_ONDETECTRELATEDMSIPACKAGE_ARGS args = { };
1262 return hr; 1234// BA_ONDETECTRELATEDMSIPACKAGE_RESULTS results = { };
1263} 1235// PIPE_RPC_RESULT result = { };
1264 1236
1265EXTERN_C BAAPI UserExperienceOnDetectRelatedBundle( 1237// args.cbSize = sizeof(args);
1266 __in BURN_USER_EXPERIENCE* pUserExperience, 1238// args.wzPackageId = wzPackageId;
1267 __in_z LPCWSTR wzBundleId, 1239// args.wzUpgradeCode = wzUpgradeCode;
1268 __in BOOTSTRAPPER_RELATION_TYPE relationType, 1240// args.wzProductCode = wzProductCode;
1269 __in_z LPCWSTR wzBundleTag, 1241// args.fPerMachine = fPerMachine;
1270 __in BOOL fPerMachine, 1242// args.wzVersion = pVersion->sczVersion;
1271 __in VERUTIL_VERSION* pVersion, 1243// args.operation = operation;
1272 __in BOOL fMissingFromCache 1244
1273 ) 1245// results.cbSize = sizeof(results);
1274{ 1246
1275 HRESULT hr = S_OK; 1247// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE, &args, args.cbSize, &result);
1276 BA_ONDETECTRELATEDBUNDLE_ARGS args = { }; 1248// ExitOnFailure(hr, "BA OnDetectRelatedMsiPackage failed.");
1277 BA_ONDETECTRELATEDBUNDLE_RESULTS results = { }; 1249
1278 1250// if (results.fCancel)
1279 args.cbSize = sizeof(args); 1251// {
1280 args.wzBundleId = wzBundleId; 1252// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1281 args.relationType = relationType; 1253// }
1282 args.wzBundleTag = wzBundleTag; 1254
1283 args.fPerMachine = fPerMachine; 1255// LExit:
1284 args.wzVersion = pVersion->sczVersion; 1256// return hr;
1285 args.fMissingFromCache = fMissingFromCache; 1257// }
1286 1258
1287 results.cbSize = sizeof(results); 1259// EXTERN_C BAAPI UserExperienceOnDetectPatchTarget(
1288 1260// __in BURN_USER_EXPERIENCE* pUserExperience,
1289 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE, &args, &results); 1261// __in_z LPCWSTR wzPackageId,
1290 ExitOnFailure(hr, "BA OnDetectRelatedBundle failed."); 1262// __in_z LPCWSTR wzProductCode,
1291 1263// __in BOOTSTRAPPER_PACKAGE_STATE patchState
1292 if (results.fCancel) 1264// )
1293 { 1265// {
1294 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1266// HRESULT hr = S_OK;
1295 } 1267// BA_ONDETECTPATCHTARGET_ARGS args = { };
1296 1268// BA_ONDETECTPATCHTARGET_RESULTS results = { };
1297LExit: 1269// PIPE_RPC_RESULT result = { };
1298 return hr; 1270
1299} 1271// args.cbSize = sizeof(args);
1300 1272// args.wzPackageId = wzPackageId;
1301EXTERN_C BAAPI UserExperienceOnDetectRelatedBundlePackage( 1273// args.wzProductCode = wzProductCode;
1302 __in BURN_USER_EXPERIENCE* pUserExperience, 1274// args.patchState = patchState;
1303 __in_z LPCWSTR wzPackageId, 1275
1304 __in_z LPCWSTR wzBundleId, 1276// results.cbSize = sizeof(results);
1305 __in BOOTSTRAPPER_RELATION_TYPE relationType, 1277
1306 __in BOOL fPerMachine, 1278// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPATCHTARGET, &args, args.cbSize, &result);
1307 __in VERUTIL_VERSION* pVersion 1279// ExitOnFailure(hr, "BA OnDetectPatchTarget failed.");
1308 ) 1280
1309{ 1281// if (results.fCancel)
1310 HRESULT hr = S_OK; 1282// {
1311 BA_ONDETECTRELATEDBUNDLEPACKAGE_ARGS args = { }; 1283// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1312 BA_ONDETECTRELATEDBUNDLEPACKAGE_RESULTS results = { }; 1284// }
1313 1285
1314 args.cbSize = sizeof(args); 1286// LExit:
1315 args.wzPackageId = wzPackageId; 1287// return hr;
1316 args.wzBundleId = wzBundleId; 1288// }
1317 args.relationType = relationType; 1289
1318 args.fPerMachine = fPerMachine; 1290// EXTERN_C BAAPI UserExperienceOnDetectUpdate(
1319 args.wzVersion = pVersion->sczVersion; 1291// __in BURN_USER_EXPERIENCE* pUserExperience,
1320 1292// __in_z_opt LPCWSTR wzUpdateLocation,
1321 results.cbSize = sizeof(results); 1293// __in DWORD64 dw64Size,
1322 1294// __in_z_opt LPCWSTR wzHash,
1323 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLEPACKAGE, &args, &results); 1295// __in BOOTSTRAPPER_UPDATE_HASH_TYPE hashAlgorithm,
1324 ExitOnFailure(hr, "BA OnDetectRelatedBundlePackage failed."); 1296// __in VERUTIL_VERSION* pVersion,
1325 1297// __in_z_opt LPCWSTR wzTitle,
1326 if (results.fCancel) 1298// __in_z_opt LPCWSTR wzSummary,
1327 { 1299// __in_z_opt LPCWSTR wzContentType,
1328 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1300// __in_z_opt LPCWSTR wzContent,
1329 } 1301// __inout BOOL* pfStopProcessingUpdates
1330 1302// )
1331LExit: 1303// {
1332 return hr; 1304// HRESULT hr = S_OK;
1333} 1305// BA_ONDETECTUPDATE_ARGS args = { };
1334 1306// BA_ONDETECTUPDATE_RESULTS results = { };
1335EXTERN_C BAAPI UserExperienceOnDetectRelatedMsiPackage( 1307// PIPE_RPC_RESULT result = { };
1336 __in BURN_USER_EXPERIENCE* pUserExperience, 1308
1337 __in_z LPCWSTR wzPackageId, 1309// args.cbSize = sizeof(args);
1338 __in_z LPCWSTR wzUpgradeCode, 1310// args.wzUpdateLocation = wzUpdateLocation;
1339 __in_z LPCWSTR wzProductCode, 1311// args.dw64Size = dw64Size;
1340 __in BOOL fPerMachine, 1312// args.wzHash = wzHash;
1341 __in VERUTIL_VERSION* pVersion, 1313// args.hashAlgorithm = hashAlgorithm;
1342 __in BOOTSTRAPPER_RELATED_OPERATION operation 1314// args.wzVersion = pVersion->sczVersion;
1343 ) 1315// args.wzTitle = wzTitle;
1344{ 1316// args.wzSummary = wzSummary;
1345 HRESULT hr = S_OK; 1317// args.wzContentType = wzContentType;
1346 BA_ONDETECTRELATEDMSIPACKAGE_ARGS args = { }; 1318// args.wzContent = wzContent;
1347 BA_ONDETECTRELATEDMSIPACKAGE_RESULTS results = { }; 1319
1348 1320// results.cbSize = sizeof(results);
1349 args.cbSize = sizeof(args); 1321// results.fStopProcessingUpdates = *pfStopProcessingUpdates;
1350 args.wzPackageId = wzPackageId; 1322
1351 args.wzUpgradeCode = wzUpgradeCode; 1323// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE, &args, args.cbSize, &result);
1352 args.wzProductCode = wzProductCode; 1324// ExitOnFailure(hr, "BA OnDetectUpdate failed.");
1353 args.fPerMachine = fPerMachine; 1325
1354 args.wzVersion = pVersion->sczVersion; 1326// if (results.fCancel)
1355 args.operation = operation; 1327// {
1356 1328// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1357 results.cbSize = sizeof(results); 1329// }
1358 1330
1359 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE, &args, &results); 1331// *pfStopProcessingUpdates = results.fStopProcessingUpdates;
1360 ExitOnFailure(hr, "BA OnDetectRelatedMsiPackage failed."); 1332
1361 1333// LExit:
1362 if (results.fCancel) 1334// return hr;
1363 { 1335// }
1364 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1336
1365 } 1337// EXTERN_C BAAPI UserExperienceOnDetectUpdateBegin(
1366 1338// __in BURN_USER_EXPERIENCE* pUserExperience,
1367LExit: 1339// __in_z LPCWSTR wzUpdateLocation,
1368 return hr; 1340// __inout BOOL* pfSkip
1369} 1341// )
1370 1342// {
1371EXTERN_C BAAPI UserExperienceOnDetectPatchTarget( 1343// HRESULT hr = S_OK;
1372 __in BURN_USER_EXPERIENCE* pUserExperience, 1344// BA_ONDETECTUPDATEBEGIN_ARGS args = { };
1373 __in_z LPCWSTR wzPackageId, 1345// BA_ONDETECTUPDATEBEGIN_RESULTS results = { };
1374 __in_z LPCWSTR wzProductCode, 1346// PIPE_RPC_RESULT result = { };
1375 __in BOOTSTRAPPER_PACKAGE_STATE patchState 1347
1376 ) 1348// args.cbSize = sizeof(args);
1377{ 1349// args.wzUpdateLocation = wzUpdateLocation;
1378 HRESULT hr = S_OK; 1350
1379 BA_ONDETECTPATCHTARGET_ARGS args = { }; 1351// results.cbSize = sizeof(results);
1380 BA_ONDETECTPATCHTARGET_RESULTS results = { }; 1352// results.fSkip = *pfSkip;
1381 1353
1382 args.cbSize = sizeof(args); 1354// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN, &args, args.cbSize, &result);
1383 args.wzPackageId = wzPackageId; 1355// ExitOnFailure(hr, "BA OnDetectUpdateBegin failed.");
1384 args.wzProductCode = wzProductCode; 1356
1385 args.patchState = patchState; 1357// if (results.fCancel)
1386 1358// {
1387 results.cbSize = sizeof(results); 1359// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1388 1360// }
1389 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPATCHTARGET, &args, &results); 1361// *pfSkip = results.fSkip;
1390 ExitOnFailure(hr, "BA OnDetectPatchTarget failed."); 1362
1391 1363// LExit:
1392 if (results.fCancel) 1364// return hr;
1393 { 1365// }
1394 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1366
1395 } 1367// EXTERN_C BAAPI UserExperienceOnDetectUpdateComplete(
1396 1368// __in BURN_USER_EXPERIENCE* pUserExperience,
1397LExit: 1369// __in HRESULT hrStatus,
1398 return hr; 1370// __inout BOOL* pfIgnoreError
1399} 1371// )
1400 1372// {
1401EXTERN_C BAAPI UserExperienceOnDetectUpdate( 1373// HRESULT hr = S_OK;
1402 __in BURN_USER_EXPERIENCE* pUserExperience, 1374// BA_ONDETECTUPDATECOMPLETE_ARGS args = { };
1403 __in_z_opt LPCWSTR wzUpdateLocation, 1375// BA_ONDETECTUPDATECOMPLETE_RESULTS results = { };
1404 __in DWORD64 dw64Size, 1376// PIPE_RPC_RESULT result = { };
1405 __in_z_opt LPCWSTR wzHash, 1377
1406 __in BOOTSTRAPPER_UPDATE_HASH_TYPE hashAlgorithm, 1378// args.cbSize = sizeof(args);
1407 __in VERUTIL_VERSION* pVersion, 1379// args.hrStatus = hrStatus;
1408 __in_z_opt LPCWSTR wzTitle, 1380
1409 __in_z_opt LPCWSTR wzSummary, 1381// results.cbSize = sizeof(results);
1410 __in_z_opt LPCWSTR wzContentType, 1382// results.fIgnoreError = *pfIgnoreError;
1411 __in_z_opt LPCWSTR wzContent, 1383
1412 __inout BOOL* pfStopProcessingUpdates 1384// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE, &args, args.cbSize, &result);
1413 ) 1385// ExitOnFailure(hr, "BA OnDetectUpdateComplete failed.");
1414{ 1386
1415 HRESULT hr = S_OK; 1387// if (FAILED(hrStatus))
1416 BA_ONDETECTUPDATE_ARGS args = { }; 1388// {
1417 BA_ONDETECTUPDATE_RESULTS results = { }; 1389// *pfIgnoreError = results.fIgnoreError;
1418 1390// }
1419 args.cbSize = sizeof(args); 1391
1420 args.wzUpdateLocation = wzUpdateLocation; 1392// LExit:
1421 args.dw64Size = dw64Size; 1393// return hr;
1422 args.wzHash = wzHash; 1394// }
1423 args.hashAlgorithm = hashAlgorithm; 1395
1424 args.wzVersion = pVersion->sczVersion; 1396// EXTERN_C BAAPI UserExperienceOnElevateBegin(
1425 args.wzTitle = wzTitle; 1397// __in BURN_USER_EXPERIENCE* pUserExperience
1426 args.wzSummary = wzSummary; 1398// )
1427 args.wzContentType = wzContentType; 1399// {
1428 args.wzContent = wzContent; 1400// HRESULT hr = S_OK;
1429 1401// BA_ONELEVATEBEGIN_ARGS args = { };
1430 results.cbSize = sizeof(results); 1402// BA_ONELEVATEBEGIN_RESULTS results = { };
1431 results.fStopProcessingUpdates = *pfStopProcessingUpdates; 1403// PIPE_RPC_RESULT result = { };
1432 1404
1433 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE, &args, &results); 1405// args.cbSize = sizeof(args);
1434 ExitOnFailure(hr, "BA OnDetectUpdate failed."); 1406
1435 1407// results.cbSize = sizeof(results);
1436 if (results.fCancel) 1408
1437 { 1409// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATEBEGIN, &args, args.cbSize, &result);
1438 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1410// ExitOnFailure(hr, "BA OnElevateBegin failed.");
1439 } 1411
1440 1412// if (results.fCancel)
1441 *pfStopProcessingUpdates = results.fStopProcessingUpdates; 1413// {
1442 1414// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1443LExit: 1415// }
1444 return hr; 1416
1445} 1417// LExit:
1446 1418// return hr;
1447EXTERN_C BAAPI UserExperienceOnDetectUpdateBegin( 1419// }
1448 __in BURN_USER_EXPERIENCE* pUserExperience, 1420
1449 __in_z LPCWSTR wzUpdateLocation, 1421// EXTERN_C BAAPI UserExperienceOnElevateComplete(
1450 __inout BOOL* pfSkip 1422// __in BURN_USER_EXPERIENCE* pUserExperience,
1451 ) 1423// __in HRESULT hrStatus
1452{ 1424// )
1453 HRESULT hr = S_OK; 1425// {
1454 BA_ONDETECTUPDATEBEGIN_ARGS args = { }; 1426// HRESULT hr = S_OK;
1455 BA_ONDETECTUPDATEBEGIN_RESULTS results = { }; 1427// BA_ONELEVATECOMPLETE_ARGS args = { };
1456 1428// BA_ONELEVATECOMPLETE_RESULTS results = { };
1457 args.cbSize = sizeof(args); 1429// PIPE_RPC_RESULT result = { };
1458 args.wzUpdateLocation = wzUpdateLocation; 1430
1459 1431// args.cbSize = sizeof(args);
1460 results.cbSize = sizeof(results); 1432// args.hrStatus = hrStatus;
1461 results.fSkip = *pfSkip; 1433
1462 1434// results.cbSize = sizeof(results);
1463 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN, &args, &results); 1435
1464 ExitOnFailure(hr, "BA OnDetectUpdateBegin failed."); 1436// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATECOMPLETE, &args, args.cbSize, &result);
1465 1437// ExitOnFailure(hr, "BA OnElevateComplete failed.");
1466 if (results.fCancel) 1438
1467 { 1439// LExit:
1468 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1440// return hr;
1469 } 1441// }
1470 *pfSkip = results.fSkip; 1442
1471 1443// EXTERN_C BAAPI UserExperienceOnError(
1472LExit: 1444// __in BURN_USER_EXPERIENCE* pUserExperience,
1473 return hr; 1445// __in BOOTSTRAPPER_ERROR_TYPE errorType,
1474} 1446// __in_z_opt LPCWSTR wzPackageId,
1475 1447// __in DWORD dwCode,
1476EXTERN_C BAAPI UserExperienceOnDetectUpdateComplete( 1448// __in_z_opt LPCWSTR wzError,
1477 __in BURN_USER_EXPERIENCE* pUserExperience, 1449// __in DWORD dwUIHint,
1478 __in HRESULT hrStatus, 1450// __in DWORD cData,
1479 __inout BOOL* pfIgnoreError 1451// __in_ecount_z_opt(cData) LPCWSTR* rgwzData,
1480 ) 1452// __inout int* pnResult
1481{ 1453// )
1482 HRESULT hr = S_OK; 1454// {
1483 BA_ONDETECTUPDATECOMPLETE_ARGS args = { }; 1455// HRESULT hr = S_OK;
1484 BA_ONDETECTUPDATECOMPLETE_RESULTS results = { }; 1456// BA_ONERROR_ARGS args = { };
1485 1457// BA_ONERROR_RESULTS results = { };
1486 args.cbSize = sizeof(args); 1458// PIPE_RPC_RESULT result = { };
1487 args.hrStatus = hrStatus; 1459
1488 1460// args.cbSize = sizeof(args);
1489 results.cbSize = sizeof(results); 1461// args.errorType = errorType;
1490 results.fIgnoreError = *pfIgnoreError; 1462// args.wzPackageId = wzPackageId;
1491 1463// args.dwCode = dwCode;
1492 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE, &args, &results); 1464// args.wzError = wzError;
1493 ExitOnFailure(hr, "BA OnDetectUpdateComplete failed."); 1465// args.dwUIHint = dwUIHint;
1494 1466// args.cData = cData;
1495 if (FAILED(hrStatus)) 1467// args.rgwzData = rgwzData;
1496 { 1468// args.nRecommendation = *pnResult;
1497 *pfIgnoreError = results.fIgnoreError; 1469
1498 } 1470// results.cbSize = sizeof(results);
1499 1471// results.nResult = *pnResult;
1500LExit: 1472
1501 return hr; 1473// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONERROR, &args, args.cbSize, &result);
1502} 1474// ExitOnFailure(hr, "BA OnError failed.");
1503 1475
1504EXTERN_C BAAPI UserExperienceOnElevateBegin( 1476// *pnResult = results.nResult;
1505 __in BURN_USER_EXPERIENCE* pUserExperience 1477
1506 ) 1478// LExit:
1507{ 1479// return hr;
1508 HRESULT hr = S_OK; 1480// }
1509 BA_ONELEVATEBEGIN_ARGS args = { }; 1481
1510 BA_ONELEVATEBEGIN_RESULTS results = { }; 1482// EXTERN_C BAAPI UserExperienceOnExecuteBegin(
1511 1483// __in BURN_USER_EXPERIENCE* pUserExperience,
1512 args.cbSize = sizeof(args); 1484// __in DWORD cExecutingPackages
1513 1485// )
1514 results.cbSize = sizeof(results); 1486// {
1515 1487// HRESULT hr = S_OK;
1516 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATEBEGIN, &args, &results); 1488// BA_ONEXECUTEBEGIN_ARGS args = { };
1517 ExitOnFailure(hr, "BA OnElevateBegin failed."); 1489// BA_ONEXECUTEBEGIN_RESULTS results = { };
1518 1490// PIPE_RPC_RESULT result = { };
1519 if (results.fCancel) 1491
1520 { 1492// args.cbSize = sizeof(args);
1521 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1493// args.cExecutingPackages = cExecutingPackages;
1522 } 1494
1523 1495// results.cbSize = sizeof(results);
1524LExit: 1496
1525 return hr; 1497// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEBEGIN, &args, args.cbSize, &result);
1526} 1498// ExitOnFailure(hr, "BA OnExecuteBegin failed.");
1527 1499
1528EXTERN_C BAAPI UserExperienceOnElevateComplete( 1500// if (results.fCancel)
1529 __in BURN_USER_EXPERIENCE* pUserExperience, 1501// {
1530 __in HRESULT hrStatus 1502// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1531 ) 1503// }
1532{ 1504
1533 HRESULT hr = S_OK; 1505// LExit:
1534 BA_ONELEVATECOMPLETE_ARGS args = { }; 1506// return hr;
1535 BA_ONELEVATECOMPLETE_RESULTS results = { }; 1507// }
1536 1508
1537 args.cbSize = sizeof(args); 1509// EXTERN_C BAAPI UserExperienceOnExecuteComplete(
1538 args.hrStatus = hrStatus; 1510// __in BURN_USER_EXPERIENCE* pUserExperience,
1539 1511// __in HRESULT hrStatus
1540 results.cbSize = sizeof(results); 1512// )
1541 1513// {
1542 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATECOMPLETE, &args, &results); 1514// HRESULT hr = S_OK;
1543 ExitOnFailure(hr, "BA OnElevateComplete failed."); 1515// BA_ONEXECUTECOMPLETE_ARGS args = { };
1544 1516// BA_ONEXECUTECOMPLETE_RESULTS results = { };
1545LExit: 1517// PIPE_RPC_RESULT result = { };
1546 return hr; 1518
1547} 1519// args.cbSize = sizeof(args);
1548 1520// args.hrStatus = hrStatus;
1549EXTERN_C BAAPI UserExperienceOnError( 1521
1550 __in BURN_USER_EXPERIENCE* pUserExperience, 1522// results.cbSize = sizeof(results);
1551 __in BOOTSTRAPPER_ERROR_TYPE errorType, 1523
1552 __in_z_opt LPCWSTR wzPackageId, 1524// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTECOMPLETE, &args, args.cbSize, &result);
1553 __in DWORD dwCode, 1525// ExitOnFailure(hr, "BA OnExecuteComplete failed.");
1554 __in_z_opt LPCWSTR wzError, 1526
1555 __in DWORD dwUIHint, 1527// LExit:
1556 __in DWORD cData, 1528// return hr;
1557 __in_ecount_z_opt(cData) LPCWSTR* rgwzData, 1529// }
1558 __inout int* pnResult 1530
1559 ) 1531// EXTERN_C BAAPI UserExperienceOnExecuteFilesInUse(
1560{ 1532// __in BURN_USER_EXPERIENCE* pUserExperience,
1561 HRESULT hr = S_OK; 1533// __in_z LPCWSTR wzPackageId,
1562 BA_ONERROR_ARGS args = { }; 1534// __in DWORD cFiles,
1563 BA_ONERROR_RESULTS results = { }; 1535// __in_ecount_z_opt(cFiles) LPCWSTR* rgwzFiles,
1564 1536// __in BOOTSTRAPPER_FILES_IN_USE_TYPE source,
1565 args.cbSize = sizeof(args); 1537// __inout int* pnResult
1566 args.errorType = errorType; 1538// )
1567 args.wzPackageId = wzPackageId; 1539// {
1568 args.dwCode = dwCode; 1540// HRESULT hr = S_OK;
1569 args.wzError = wzError; 1541// BA_ONEXECUTEFILESINUSE_ARGS args = { };
1570 args.dwUIHint = dwUIHint; 1542// BA_ONEXECUTEFILESINUSE_RESULTS results = { };
1571 args.cData = cData; 1543// PIPE_RPC_RESULT result = { };
1572 args.rgwzData = rgwzData; 1544
1573 args.nRecommendation = *pnResult; 1545// args.cbSize = sizeof(args);
1574 1546// args.wzPackageId = wzPackageId;
1575 results.cbSize = sizeof(results); 1547// args.cFiles = cFiles;
1576 results.nResult = *pnResult; 1548// args.rgwzFiles = rgwzFiles;
1577 1549// args.nRecommendation = *pnResult;
1578 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONERROR, &args, &results); 1550// args.source = source;
1579 ExitOnFailure(hr, "BA OnError failed."); 1551
1580 1552// results.cbSize = sizeof(results);
1581 *pnResult = results.nResult; 1553// results.nResult = *pnResult;
1582 1554
1583LExit: 1555// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEFILESINUSE, &args, args.cbSize, &result);
1584 return hr; 1556// ExitOnFailure(hr, "BA OnExecuteFilesInUse failed.");
1585} 1557
1586 1558// *pnResult = results.nResult;
1587EXTERN_C BAAPI UserExperienceOnExecuteBegin( 1559
1588 __in BURN_USER_EXPERIENCE* pUserExperience, 1560// LExit:
1589 __in DWORD cExecutingPackages 1561// return hr;
1590 ) 1562// }
1591{ 1563
1592 HRESULT hr = S_OK; 1564// EXTERN_C BAAPI UserExperienceOnExecuteMsiMessage(
1593 BA_ONEXECUTEBEGIN_ARGS args = { }; 1565// __in BURN_USER_EXPERIENCE* pUserExperience,
1594 BA_ONEXECUTEBEGIN_RESULTS results = { }; 1566// __in_z LPCWSTR wzPackageId,
1595 1567// __in INSTALLMESSAGE messageType,
1596 args.cbSize = sizeof(args); 1568// __in DWORD dwUIHint,
1597 args.cExecutingPackages = cExecutingPackages; 1569// __in_z LPCWSTR wzMessage,
1598 1570// __in DWORD cData,
1599 results.cbSize = sizeof(results); 1571// __in_ecount_z_opt(cData) LPCWSTR* rgwzData,
1600 1572// __inout int* pnResult
1601 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEBEGIN, &args, &results); 1573// )
1602 ExitOnFailure(hr, "BA OnExecuteBegin failed."); 1574// {
1603 1575// HRESULT hr = S_OK;
1604 if (results.fCancel) 1576// BA_ONEXECUTEMSIMESSAGE_ARGS args = { };
1605 { 1577// BA_ONEXECUTEMSIMESSAGE_RESULTS results = { };
1606 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1578// PIPE_RPC_RESULT result = { };
1607 } 1579
1608 1580// args.cbSize = sizeof(args);
1609LExit: 1581// args.wzPackageId = wzPackageId;
1610 return hr; 1582// args.messageType = messageType;
1611} 1583// args.dwUIHint = dwUIHint;
1612 1584// args.wzMessage = wzMessage;
1613EXTERN_C BAAPI UserExperienceOnExecuteComplete( 1585// args.cData = cData;
1614 __in BURN_USER_EXPERIENCE* pUserExperience, 1586// args.rgwzData = rgwzData;
1615 __in HRESULT hrStatus 1587// args.nRecommendation = *pnResult;
1616 ) 1588
1617{ 1589// results.cbSize = sizeof(results);
1618 HRESULT hr = S_OK; 1590// results.nResult = *pnResult;
1619 BA_ONEXECUTECOMPLETE_ARGS args = { }; 1591
1620 BA_ONEXECUTECOMPLETE_RESULTS results = { }; 1592// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEMSIMESSAGE, &args, args.cbSize, &result);
1621 1593// ExitOnFailure(hr, "BA OnExecuteMsiMessage failed.");
1622 args.cbSize = sizeof(args); 1594
1623 args.hrStatus = hrStatus; 1595// *pnResult = results.nResult;
1624 1596
1625 results.cbSize = sizeof(results); 1597// LExit:
1626 1598// return hr;
1627 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTECOMPLETE, &args, &results); 1599// }
1628 ExitOnFailure(hr, "BA OnExecuteComplete failed."); 1600
1629 1601// EXTERN_C BAAPI UserExperienceOnExecutePackageBegin(
1630LExit: 1602// __in BURN_USER_EXPERIENCE* pUserExperience,
1631 return hr; 1603// __in_z LPCWSTR wzPackageId,
1632} 1604// __in BOOL fExecute,
1633 1605// __in BOOTSTRAPPER_ACTION_STATE action,
1634EXTERN_C BAAPI UserExperienceOnExecuteFilesInUse( 1606// __in INSTALLUILEVEL uiLevel,
1635 __in BURN_USER_EXPERIENCE* pUserExperience, 1607// __in BOOL fDisableExternalUiHandler
1636 __in_z LPCWSTR wzPackageId, 1608// )
1637 __in DWORD cFiles, 1609// {
1638 __in_ecount_z_opt(cFiles) LPCWSTR* rgwzFiles, 1610// HRESULT hr = S_OK;
1639 __in BOOTSTRAPPER_FILES_IN_USE_TYPE source, 1611// BA_ONEXECUTEPACKAGEBEGIN_ARGS args = { };
1640 __inout int* pnResult 1612// BA_ONEXECUTEPACKAGEBEGIN_RESULTS results = { };
1641 ) 1613// PIPE_RPC_RESULT result = { };
1642{ 1614
1643 HRESULT hr = S_OK; 1615// args.cbSize = sizeof(args);
1644 BA_ONEXECUTEFILESINUSE_ARGS args = { }; 1616// args.wzPackageId = wzPackageId;
1645 BA_ONEXECUTEFILESINUSE_RESULTS results = { }; 1617// args.fExecute = fExecute;
1646 1618// args.action = action;
1647 args.cbSize = sizeof(args); 1619// args.uiLevel = uiLevel;
1648 args.wzPackageId = wzPackageId; 1620// args.fDisableExternalUiHandler = fDisableExternalUiHandler;
1649 args.cFiles = cFiles; 1621
1650 args.rgwzFiles = rgwzFiles; 1622// results.cbSize = sizeof(results);
1651 args.nRecommendation = *pnResult; 1623
1652 args.source = source; 1624// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGEBEGIN, &args, args.cbSize, &result);
1653 1625// ExitOnFailure(hr, "BA OnExecutePackageBegin failed.");
1654 results.cbSize = sizeof(results); 1626
1655 results.nResult = *pnResult; 1627// if (results.fCancel)
1656 1628// {
1657 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEFILESINUSE, &args, &results); 1629// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1658 ExitOnFailure(hr, "BA OnExecuteFilesInUse failed."); 1630// }
1659 1631
1660 *pnResult = results.nResult; 1632// LExit:
1661 1633// return hr;
1662LExit: 1634// }
1663 return hr; 1635
1664} 1636// EXTERN_C BAAPI UserExperienceOnExecutePackageComplete(
1665 1637// __in BURN_USER_EXPERIENCE* pUserExperience,
1666EXTERN_C BAAPI UserExperienceOnExecuteMsiMessage( 1638// __in_z LPCWSTR wzPackageId,
1667 __in BURN_USER_EXPERIENCE* pUserExperience, 1639// __in HRESULT hrStatus,
1668 __in_z LPCWSTR wzPackageId, 1640// __in BOOTSTRAPPER_APPLY_RESTART restart,
1669 __in INSTALLMESSAGE messageType, 1641// __inout BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION* pAction
1670 __in DWORD dwUIHint, 1642// )
1671 __in_z LPCWSTR wzMessage, 1643// {
1672 __in DWORD cData, 1644// HRESULT hr = S_OK;
1673 __in_ecount_z_opt(cData) LPCWSTR* rgwzData, 1645// BA_ONEXECUTEPACKAGECOMPLETE_ARGS args = { };
1674 __inout int* pnResult 1646// BA_ONEXECUTEPACKAGECOMPLETE_RESULTS results = { };
1675 ) 1647// PIPE_RPC_RESULT result = { };
1676{ 1648
1677 HRESULT hr = S_OK; 1649// args.cbSize = sizeof(args);
1678 BA_ONEXECUTEMSIMESSAGE_ARGS args = { }; 1650// args.wzPackageId = wzPackageId;
1679 BA_ONEXECUTEMSIMESSAGE_RESULTS results = { }; 1651// args.hrStatus = hrStatus;
1680 1652// args.restart = restart;
1681 args.cbSize = sizeof(args); 1653// args.recommendation = *pAction;
1682 args.wzPackageId = wzPackageId; 1654
1683 args.messageType = messageType; 1655// results.cbSize = sizeof(results);
1684 args.dwUIHint = dwUIHint; 1656// results.action = *pAction;
1685 args.wzMessage = wzMessage; 1657
1686 args.cData = cData; 1658// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGECOMPLETE, &args, args.cbSize, &result);
1687 args.rgwzData = rgwzData; 1659// ExitOnFailure(hr, "BA OnExecutePackageComplete failed.");
1688 args.nRecommendation = *pnResult; 1660
1689 1661// *pAction = results.action;
1690 results.cbSize = sizeof(results); 1662
1691 results.nResult = *pnResult; 1663// LExit:
1692 1664// return hr;
1693 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEMSIMESSAGE, &args, &results); 1665// }
1694 ExitOnFailure(hr, "BA OnExecuteMsiMessage failed."); 1666
1695 1667// EXTERN_C BAAPI UserExperienceOnExecutePatchTarget(
1696 *pnResult = results.nResult; 1668// __in BURN_USER_EXPERIENCE* pUserExperience,
1697 1669// __in_z LPCWSTR wzPackageId,
1698LExit: 1670// __in_z LPCWSTR wzTargetProductCode
1699 return hr; 1671// )
1700} 1672// {
1701 1673// HRESULT hr = S_OK;
1702EXTERN_C BAAPI UserExperienceOnExecutePackageBegin( 1674// BA_ONEXECUTEPATCHTARGET_ARGS args = { };
1703 __in BURN_USER_EXPERIENCE* pUserExperience, 1675// BA_ONEXECUTEPATCHTARGET_RESULTS results = { };
1704 __in_z LPCWSTR wzPackageId, 1676// PIPE_RPC_RESULT result = { };
1705 __in BOOL fExecute, 1677
1706 __in BOOTSTRAPPER_ACTION_STATE action, 1678// args.cbSize = sizeof(args);
1707 __in INSTALLUILEVEL uiLevel, 1679// args.wzPackageId = wzPackageId;
1708 __in BOOL fDisableExternalUiHandler 1680// args.wzTargetProductCode = wzTargetProductCode;
1709 ) 1681
1710{ 1682// results.cbSize = sizeof(results);
1711 HRESULT hr = S_OK; 1683
1712 BA_ONEXECUTEPACKAGEBEGIN_ARGS args = { }; 1684// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPATCHTARGET, &args, args.cbSize, &result);
1713 BA_ONEXECUTEPACKAGEBEGIN_RESULTS results = { }; 1685// ExitOnFailure(hr, "BA OnExecutePatchTarget failed.");
1714 1686
1715 args.cbSize = sizeof(args); 1687// if (results.fCancel)
1716 args.wzPackageId = wzPackageId; 1688// {
1717 args.fExecute = fExecute; 1689// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1718 args.action = action; 1690// }
1719 args.uiLevel = uiLevel; 1691
1720 args.fDisableExternalUiHandler = fDisableExternalUiHandler; 1692// LExit:
1721 1693// return hr;
1722 results.cbSize = sizeof(results); 1694// }
1723 1695
1724 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGEBEGIN, &args, &results); 1696// BAAPI UserExperienceOnExecuteProcessCancel(
1725 ExitOnFailure(hr, "BA OnExecutePackageBegin failed."); 1697// __in BURN_USER_EXPERIENCE* pUserExperience,
1726 1698// __in_z LPCWSTR wzPackageId,
1727 if (results.fCancel) 1699// __in DWORD dwProcessId,
1728 { 1700// __inout BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION* pAction
1729 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1701// )
1730 } 1702// {
1731 1703// HRESULT hr = S_OK;
1732LExit: 1704// BA_ONEXECUTEPROCESSCANCEL_ARGS args = { };
1733 return hr; 1705// BA_ONEXECUTEPROCESSCANCEL_RESULTS results = { };
1734} 1706// PIPE_RPC_RESULT result = { };
1735 1707
1736EXTERN_C BAAPI UserExperienceOnExecutePackageComplete( 1708// args.cbSize = sizeof(args);
1737 __in BURN_USER_EXPERIENCE* pUserExperience, 1709// args.wzPackageId = wzPackageId;
1738 __in_z LPCWSTR wzPackageId, 1710// args.dwProcessId = dwProcessId;
1739 __in HRESULT hrStatus, 1711// args.recommendation = *pAction;
1740 __in BOOTSTRAPPER_APPLY_RESTART restart, 1712
1741 __inout BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION* pAction 1713// results.cbSize = sizeof(results);
1742 ) 1714// results.action = *pAction;
1743{ 1715
1744 HRESULT hr = S_OK; 1716// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROCESSCANCEL, &args, args.cbSize, &result);
1745 BA_ONEXECUTEPACKAGECOMPLETE_ARGS args = { }; 1717// ExitOnFailure(hr, "BA OnExecuteProcessCancel failed.");
1746 BA_ONEXECUTEPACKAGECOMPLETE_RESULTS results = { }; 1718
1747 1719// *pAction = results.action;
1748 args.cbSize = sizeof(args); 1720
1749 args.wzPackageId = wzPackageId; 1721// LExit:
1750 args.hrStatus = hrStatus; 1722// return hr;
1751 args.restart = restart; 1723// }
1752 args.recommendation = *pAction; 1724
1753 1725// EXTERN_C BAAPI UserExperienceOnExecuteProgress(
1754 results.cbSize = sizeof(results); 1726// __in BURN_USER_EXPERIENCE* pUserExperience,
1755 results.action = *pAction; 1727// __in_z LPCWSTR wzPackageId,
1756 1728// __in DWORD dwProgressPercentage,
1757 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGECOMPLETE, &args, &results); 1729// __in DWORD dwOverallPercentage,
1758 ExitOnFailure(hr, "BA OnExecutePackageComplete failed."); 1730// __out int* pnResult
1759 1731// )
1760 *pAction = results.action; 1732// {
1761 1733// HRESULT hr = S_OK;
1762LExit: 1734// BA_ONEXECUTEPROGRESS_ARGS args = { };
1763 return hr; 1735// BA_ONEXECUTEPROGRESS_RESULTS results = { };
1764} 1736// PIPE_RPC_RESULT result = { };
1765 1737
1766EXTERN_C BAAPI UserExperienceOnExecutePatchTarget( 1738// args.cbSize = sizeof(args);
1767 __in BURN_USER_EXPERIENCE* pUserExperience, 1739// args.wzPackageId = wzPackageId;
1768 __in_z LPCWSTR wzPackageId, 1740// args.dwProgressPercentage = dwProgressPercentage;
1769 __in_z LPCWSTR wzTargetProductCode 1741// args.dwOverallPercentage = dwOverallPercentage;
1770 ) 1742
1771{ 1743// results.cbSize = sizeof(results);
1772 HRESULT hr = S_OK; 1744
1773 BA_ONEXECUTEPATCHTARGET_ARGS args = { }; 1745// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROGRESS, &args, args.cbSize, &result);
1774 BA_ONEXECUTEPATCHTARGET_RESULTS results = { }; 1746// ExitOnFailure(hr, "BA OnExecuteProgress failed.");
1775 1747
1776 args.cbSize = sizeof(args); 1748// LExit:
1777 args.wzPackageId = wzPackageId; 1749// if (FAILED(hr))
1778 args.wzTargetProductCode = wzTargetProductCode; 1750// {
1779 1751// *pnResult = IDERROR;
1780 results.cbSize = sizeof(results); 1752// }
1781 1753// else if (results.fCancel)
1782 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPATCHTARGET, &args, &results); 1754// {
1783 ExitOnFailure(hr, "BA OnExecutePatchTarget failed."); 1755// *pnResult = IDCANCEL;
1784 1756// }
1785 if (results.fCancel) 1757// else
1786 { 1758// {
1787 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1759// *pnResult = IDNOACTION;
1788 } 1760// }
1789 1761// return hr;
1790LExit: 1762// }
1791 return hr; 1763
1792} 1764// EXTERN_C BAAPI UserExperienceOnLaunchApprovedExeBegin(
1793 1765// __in BURN_USER_EXPERIENCE* pUserExperience
1794BAAPI UserExperienceOnExecuteProcessCancel( 1766// )
1795 __in BURN_USER_EXPERIENCE* pUserExperience, 1767// {
1796 __in_z LPCWSTR wzPackageId, 1768// HRESULT hr = S_OK;
1797 __in DWORD dwProcessId, 1769// BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS args = { };
1798 __inout BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION* pAction 1770// BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS results = { };
1799 ) 1771// PIPE_RPC_RESULT result = { };
1800{ 1772
1801 HRESULT hr = S_OK; 1773// args.cbSize = sizeof(args);
1802 BA_ONEXECUTEPROCESSCANCEL_ARGS args = { }; 1774
1803 BA_ONEXECUTEPROCESSCANCEL_RESULTS results = { }; 1775// results.cbSize = sizeof(results);
1804 1776
1805 args.cbSize = sizeof(args); 1777// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN, &args, args.cbSize, &result);
1806 args.wzPackageId = wzPackageId; 1778// ExitOnFailure(hr, "BA OnLaunchApprovedExeBegin failed.");
1807 args.dwProcessId = dwProcessId; 1779
1808 args.recommendation = *pAction; 1780// if (results.fCancel)
1809 1781// {
1810 results.cbSize = sizeof(results); 1782// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1811 results.action = *pAction; 1783// }
1812 1784
1813 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROCESSCANCEL, &args, &results); 1785// LExit:
1814 ExitOnFailure(hr, "BA OnExecuteProcessCancel failed."); 1786// return hr;
1815 1787// }
1816 *pAction = results.action; 1788
1817 1789// EXTERN_C BAAPI UserExperienceOnLaunchApprovedExeComplete(
1818LExit: 1790// __in BURN_USER_EXPERIENCE* pUserExperience,
1819 return hr; 1791// __in HRESULT hrStatus,
1820} 1792// __in DWORD dwProcessId
1821 1793// )
1822EXTERN_C BAAPI UserExperienceOnExecuteProgress( 1794// {
1823 __in BURN_USER_EXPERIENCE* pUserExperience, 1795// HRESULT hr = S_OK;
1824 __in_z LPCWSTR wzPackageId, 1796// BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS args = { };
1825 __in DWORD dwProgressPercentage, 1797// BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS results = { };
1826 __in DWORD dwOverallPercentage, 1798// PIPE_RPC_RESULT result = { };
1827 __out int* pnResult 1799
1828 ) 1800// args.cbSize = sizeof(args);
1829{ 1801// args.hrStatus = hrStatus;
1830 HRESULT hr = S_OK; 1802// args.dwProcessId = dwProcessId;
1831 BA_ONEXECUTEPROGRESS_ARGS args = { }; 1803
1832 BA_ONEXECUTEPROGRESS_RESULTS results = { }; 1804// results.cbSize = sizeof(results);
1833 1805
1834 args.cbSize = sizeof(args); 1806// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE, &args, args.cbSize, &result);
1835 args.wzPackageId = wzPackageId; 1807// ExitOnFailure(hr, "BA OnLaunchApprovedExeComplete failed.");
1836 args.dwProgressPercentage = dwProgressPercentage; 1808
1837 args.dwOverallPercentage = dwOverallPercentage; 1809// LExit:
1838 1810// return hr;
1839 results.cbSize = sizeof(results); 1811// }
1840 1812
1841 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROGRESS, &args, &results); 1813// EXTERN_C BAAPI UserExperienceOnPauseAUBegin(
1842 ExitOnFailure(hr, "BA OnExecuteProgress failed."); 1814// __in BURN_USER_EXPERIENCE* pUserExperience
1843 1815// )
1844LExit: 1816// {
1845 if (FAILED(hr)) 1817// HRESULT hr = S_OK;
1846 { 1818// BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS args = { };
1847 *pnResult = IDERROR; 1819// BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS results = { };
1848 } 1820// PIPE_RPC_RESULT result = { };
1849 else if (results.fCancel) 1821
1850 { 1822// args.cbSize = sizeof(args);
1851 *pnResult = IDCANCEL; 1823
1852 } 1824// results.cbSize = sizeof(results);
1853 else 1825
1854 { 1826// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, args.cbSize, &result);
1855 *pnResult = IDNOACTION; 1827// ExitOnFailure(hr, "BA OnPauseAUBegin failed.");
1856 } 1828
1857 return hr; 1829// LExit:
1858} 1830// return hr;
1859 1831// }
1860EXTERN_C BAAPI UserExperienceOnLaunchApprovedExeBegin( 1832
1861 __in BURN_USER_EXPERIENCE* pUserExperience 1833// EXTERN_C BAAPI UserExperienceOnPauseAUComplete(
1862 ) 1834// __in BURN_USER_EXPERIENCE* pUserExperience,
1863{ 1835// __in HRESULT hrStatus
1864 HRESULT hr = S_OK; 1836// )
1865 BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS args = { }; 1837// {
1866 BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS results = { }; 1838// HRESULT hr = S_OK;
1867 1839// BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS args = { };
1868 args.cbSize = sizeof(args); 1840// BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS results = { };
1869 1841// PIPE_RPC_RESULT result = { };
1870 results.cbSize = sizeof(results); 1842
1871 1843// args.cbSize = sizeof(args);
1872 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN, &args, &results); 1844// args.hrStatus = hrStatus;
1873 ExitOnFailure(hr, "BA OnLaunchApprovedExeBegin failed."); 1845
1874 1846// results.cbSize = sizeof(results);
1875 if (results.fCancel) 1847
1876 { 1848// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE, &args, args.cbSize, &result);
1877 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1849// ExitOnFailure(hr, "BA OnPauseAUComplete failed.");
1878 } 1850
1879 1851// LExit:
1880LExit: 1852// return hr;
1881 return hr; 1853// }
1882} 1854
1883 1855// EXTERN_C BAAPI UserExperienceOnPlanBegin(
1884EXTERN_C BAAPI UserExperienceOnLaunchApprovedExeComplete( 1856// __in BURN_USER_EXPERIENCE* pUserExperience,
1885 __in BURN_USER_EXPERIENCE* pUserExperience, 1857// __in DWORD cPackages
1886 __in HRESULT hrStatus, 1858// )
1887 __in DWORD dwProcessId 1859// {
1888 ) 1860// HRESULT hr = S_OK;
1889{ 1861// BA_ONPLANBEGIN_ARGS args = { };
1890 HRESULT hr = S_OK; 1862// BA_ONPLANBEGIN_RESULTS results = { };
1891 BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS args = { }; 1863// PIPE_RPC_RESULT result = { };
1892 BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS results = { }; 1864
1893 1865// args.cbSize = sizeof(args);
1894 args.cbSize = sizeof(args); 1866// args.cPackages = cPackages;
1895 args.hrStatus = hrStatus; 1867
1896 args.dwProcessId = dwProcessId; 1868// results.cbSize = sizeof(results);
1897 1869
1898 results.cbSize = sizeof(results); 1870// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN, &args, args.cbSize, &result);
1899 1871// ExitOnFailure(hr, "BA OnPlanBegin failed.");
1900 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE, &args, &results); 1872
1901 ExitOnFailure(hr, "BA OnLaunchApprovedExeComplete failed."); 1873// if (results.fCancel)
1902 1874// {
1903LExit: 1875// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1904 return hr; 1876// }
1905} 1877
1906 1878// LExit:
1907EXTERN_C BAAPI UserExperienceOnPauseAUBegin( 1879// return hr;
1908 __in BURN_USER_EXPERIENCE* pUserExperience 1880// }
1909 ) 1881
1910{ 1882// EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageBegin(
1911 HRESULT hr = S_OK; 1883// __in BURN_USER_EXPERIENCE* pUserExperience,
1912 BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS args = { }; 1884// __in_z LPCWSTR wzPackageId,
1913 BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS results = { }; 1885// __in_z LPCWSTR wzCompatiblePackageId,
1914 1886// __in VERUTIL_VERSION* pCompatiblePackageVersion,
1915 args.cbSize = sizeof(args); 1887// __inout BOOL* pfRequested
1916 1888// )
1917 results.cbSize = sizeof(results); 1889// {
1918 1890// HRESULT hr = S_OK;
1919 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results); 1891// BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS args = { };
1920 ExitOnFailure(hr, "BA OnPauseAUBegin failed."); 1892// BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS results = { };
1921 1893// PIPE_RPC_RESULT result = { };
1922LExit: 1894
1923 return hr; 1895// args.cbSize = sizeof(args);
1924} 1896// args.wzPackageId = wzPackageId;
1925 1897// args.wzCompatiblePackageId = wzCompatiblePackageId;
1926EXTERN_C BAAPI UserExperienceOnPauseAUComplete( 1898// args.wzCompatiblePackageVersion = pCompatiblePackageVersion->sczVersion;
1927 __in BURN_USER_EXPERIENCE* pUserExperience, 1899// args.fRecommendedRemove = *pfRequested;
1928 __in HRESULT hrStatus 1900
1929 ) 1901// results.cbSize = sizeof(results);
1930{ 1902// results.fRequestRemove = *pfRequested;
1931 HRESULT hr = S_OK; 1903
1932 BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS args = { }; 1904// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN, &args, args.cbSize, &result);
1933 BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS results = { }; 1905// ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageBegin failed.");
1934 1906
1935 args.cbSize = sizeof(args); 1907// if (results.fCancel)
1936 args.hrStatus = hrStatus; 1908// {
1937 1909// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1938 results.cbSize = sizeof(results); 1910// }
1939 1911// *pfRequested = results.fRequestRemove;
1940 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE, &args, &results); 1912
1941 ExitOnFailure(hr, "BA OnPauseAUComplete failed."); 1913// LExit:
1942 1914// return hr;
1943LExit: 1915// }
1944 return hr; 1916
1945} 1917// EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageComplete(
1946 1918// __in BURN_USER_EXPERIENCE* pUserExperience,
1947EXTERN_C BAAPI UserExperienceOnPlanBegin( 1919// __in_z LPCWSTR wzPackageId,
1948 __in BURN_USER_EXPERIENCE* pUserExperience, 1920// __in_z LPCWSTR wzCompatiblePackageId,
1949 __in DWORD cPackages 1921// __in HRESULT hrStatus,
1950 ) 1922// __in BOOL fRequested
1951{ 1923// )
1952 HRESULT hr = S_OK; 1924// {
1953 BA_ONPLANBEGIN_ARGS args = { }; 1925// HRESULT hr = S_OK;
1954 BA_ONPLANBEGIN_RESULTS results = { }; 1926// BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS args = { };
1955 1927// BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS results = { };
1956 args.cbSize = sizeof(args); 1928// PIPE_RPC_RESULT result = { };
1957 args.cPackages = cPackages; 1929
1958 1930// args.cbSize = sizeof(args);
1959 results.cbSize = sizeof(results); 1931// args.wzPackageId = wzPackageId;
1960 1932// args.wzCompatiblePackageId = wzCompatiblePackageId;
1961 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN, &args, &results); 1933// args.hrStatus = hrStatus;
1962 ExitOnFailure(hr, "BA OnPlanBegin failed."); 1934// args.fRequestedRemove = fRequested;
1963 1935
1964 if (results.fCancel) 1936// results.cbSize = sizeof(results);
1965 { 1937
1966 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1938// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE, &args, args.cbSize, &result);
1967 } 1939// ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageComplete failed.");
1968 1940
1969LExit: 1941// LExit:
1970 return hr; 1942// return hr;
1971} 1943// }
1972 1944
1973EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageBegin( 1945// EXTERN_C BAAPI UserExperienceOnPlanMsiFeature(
1974 __in BURN_USER_EXPERIENCE* pUserExperience, 1946// __in BURN_USER_EXPERIENCE* pUserExperience,
1975 __in_z LPCWSTR wzPackageId, 1947// __in_z LPCWSTR wzPackageId,
1976 __in_z LPCWSTR wzCompatiblePackageId, 1948// __in_z LPCWSTR wzFeatureId,
1977 __in VERUTIL_VERSION* pCompatiblePackageVersion, 1949// __inout BOOTSTRAPPER_FEATURE_STATE* pRequestedState
1978 __inout BOOL* pfRequested 1950// )
1979 ) 1951// {
1980{ 1952// HRESULT hr = S_OK;
1981 HRESULT hr = S_OK; 1953// BA_ONPLANMSIFEATURE_ARGS args = { };
1982 BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS args = { }; 1954// BA_ONPLANMSIFEATURE_RESULTS results = { };
1983 BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS results = { }; 1955// PIPE_RPC_RESULT result = { };
1984 1956
1985 args.cbSize = sizeof(args); 1957// args.cbSize = sizeof(args);
1986 args.wzPackageId = wzPackageId; 1958// args.wzPackageId = wzPackageId;
1987 args.wzCompatiblePackageId = wzCompatiblePackageId; 1959// args.wzFeatureId = wzFeatureId;
1988 args.wzCompatiblePackageVersion = pCompatiblePackageVersion->sczVersion; 1960// args.recommendedState = *pRequestedState;
1989 args.fRecommendedRemove = *pfRequested; 1961
1990 1962// results.cbSize = sizeof(results);
1991 results.cbSize = sizeof(results); 1963// results.requestedState = *pRequestedState;
1992 results.fRequestRemove = *pfRequested; 1964
1993 1965// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE, &args, args.cbSize, &result);
1994 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN, &args, &results); 1966// ExitOnFailure(hr, "BA OnPlanMsiFeature failed.");
1995 ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageBegin failed."); 1967
1996 1968// if (results.fCancel)
1997 if (results.fCancel) 1969// {
1998 { 1970// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
1999 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 1971// }
2000 } 1972// *pRequestedState = results.requestedState;
2001 *pfRequested = results.fRequestRemove; 1973
2002 1974// LExit:
2003LExit: 1975// return hr;
2004 return hr; 1976// }
2005} 1977
2006 1978// EXTERN_C BAAPI UserExperienceOnPlanComplete(
2007EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageComplete( 1979// __in BURN_USER_EXPERIENCE* pUserExperience,
2008 __in BURN_USER_EXPERIENCE* pUserExperience, 1980// __in HRESULT hrStatus
2009 __in_z LPCWSTR wzPackageId, 1981// )
2010 __in_z LPCWSTR wzCompatiblePackageId, 1982// {
2011 __in HRESULT hrStatus, 1983// HRESULT hr = S_OK;
2012 __in BOOL fRequested 1984// BA_ONPLANCOMPLETE_ARGS args = { };
2013 ) 1985// BA_ONPLANCOMPLETE_RESULTS results = { };
2014{ 1986// PIPE_RPC_RESULT result = { };
2015 HRESULT hr = S_OK; 1987
2016 BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS args = { }; 1988// args.cbSize = sizeof(args);
2017 BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS results = { }; 1989// args.hrStatus = hrStatus;
2018 1990
2019 args.cbSize = sizeof(args); 1991// results.cbSize = sizeof(results);
2020 args.wzPackageId = wzPackageId; 1992
2021 args.wzCompatiblePackageId = wzCompatiblePackageId; 1993// hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE, &args, args.cbSize, &result);
2022 args.hrStatus = hrStatus; 1994// ExitOnFailure(hr, "BA OnPlanComplete failed.");
2023 args.fRequestedRemove = fRequested; 1995
2024 1996// LExit:
2025 results.cbSize = sizeof(results); 1997// return hr;
2026 1998// }
2027 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE, &args, &results); 1999
2028 ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageComplete failed."); 2000// EXTERN_C BAAPI UserExperienceOnPlanForwardCompatibleBundle(
2029 2001// __in BURN_USER_EXPERIENCE* pUserExperience,
2030LExit: 2002// __in_z LPCWSTR wzBundleId,
2031 return hr; 2003// __in BOOTSTRAPPER_RELATION_TYPE relationType,
2032} 2004// __in_z LPCWSTR wzBundleTag,
2033 2005// __in BOOL fPerMachine,
2034EXTERN_C BAAPI UserExperienceOnPlanMsiFeature( 2006// __in VERUTIL_VERSION* pVersion,
2035 __in BURN_USER_EXPERIENCE* pUserExperience, 2007// __inout BOOL* pfIgnoreBundle
2036 __in_z LPCWSTR wzPackageId, 2008// )
2037 __in_z LPCWSTR wzFeatureId, 2009// {
2038 __inout BOOTSTRAPPER_FEATURE_STATE* pRequestedState 2010// HRESULT hr = S_OK;
2039 ) 2011// BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS args = { };
2040{ 2012// BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS results = { };
2041 HRESULT hr = S_OK; 2013// PIPE_RPC_RESULT result = { };
2042 BA_ONPLANMSIFEATURE_ARGS args = { }; 2014
2043 BA_ONPLANMSIFEATURE_RESULTS results = { }; 2015// args.cbSize = sizeof(args);
2044 2016// args.wzBundleId = wzBundleId;
2045 args.cbSize = sizeof(args); 2017// args.relationType = relationType;
2046 args.wzPackageId = wzPackageId; 2018// args.wzBundleTag = wzBundleTag;
2047 args.wzFeatureId = wzFeatureId; 2019// args.fPerMachine = fPerMachine;
2048 args.recommendedState = *pRequestedState; 2020// args.wzVersion = pVersion->sczVersion;
2049 2021// args.fRecommendedIgnoreBundle = *pfIgnoreBundle;
2050 results.cbSize = sizeof(results); 2022
2051 results.requestedState = *pRequestedState; 2023// results.cbSize = sizeof(results);
2052 2024// results.fIgnoreBundle = *pfIgnoreBundle;
2053 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE, &args, &results); 2025
2054 ExitOnFailure(hr, "BA OnPlanMsiFeature failed."); 2026// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE, &args, args.cbSize, &result);
2055 2027// ExitOnFailure(hr, "BA OnPlanForwardCompatibleBundle failed.");
2056 if (results.fCancel) 2028
2057 { 2029// if (results.fCancel)
2058 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2030// {
2059 } 2031// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2060 *pRequestedState = results.requestedState; 2032// }
2061 2033// *pfIgnoreBundle = results.fIgnoreBundle;
2062LExit: 2034
2063 return hr; 2035// LExit:
2064} 2036// return hr;
2065 2037// }
2066EXTERN_C BAAPI UserExperienceOnPlanComplete( 2038
2067 __in BURN_USER_EXPERIENCE* pUserExperience, 2039// EXTERN_C BAAPI UserExperienceOnPlanMsiPackage(
2068 __in HRESULT hrStatus 2040// __in BURN_USER_EXPERIENCE* pUserExperience,
2069 ) 2041// __in_z LPCWSTR wzPackageId,
2070{ 2042// __in BOOL fExecute,
2071 HRESULT hr = S_OK; 2043// __in BOOTSTRAPPER_ACTION_STATE action,
2072 BA_ONPLANCOMPLETE_ARGS args = { }; 2044// __inout BURN_MSI_PROPERTY* pActionMsiProperty,
2073 BA_ONPLANCOMPLETE_RESULTS results = { }; 2045// __inout INSTALLUILEVEL* pUiLevel,
2074 2046// __inout BOOL* pfDisableExternalUiHandler,
2075 args.cbSize = sizeof(args); 2047// __inout BOOTSTRAPPER_MSI_FILE_VERSIONING* pFileVersioning
2076 args.hrStatus = hrStatus; 2048// )
2077 2049// {
2078 results.cbSize = sizeof(results); 2050// HRESULT hr = S_OK;
2079 2051// BA_ONPLANMSIPACKAGE_ARGS args = { };
2080 hr = SendBAMessageFromInactiveEngine(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE, &args, &results); 2052// BA_ONPLANMSIPACKAGE_RESULTS results = { };
2081 ExitOnFailure(hr, "BA OnPlanComplete failed."); 2053// PIPE_RPC_RESULT result = { };
2082 2054
2083LExit: 2055// args.cbSize = sizeof(args);
2084 return hr; 2056// args.wzPackageId = wzPackageId;
2085} 2057// args.fExecute = fExecute;
2086 2058// args.action = action;
2087EXTERN_C BAAPI UserExperienceOnPlanForwardCompatibleBundle( 2059// args.recommendedFileVersioning = *pFileVersioning;
2088 __in BURN_USER_EXPERIENCE* pUserExperience, 2060
2089 __in_z LPCWSTR wzBundleId, 2061// results.cbSize = sizeof(results);
2090 __in BOOTSTRAPPER_RELATION_TYPE relationType, 2062// results.actionMsiProperty = *pActionMsiProperty;
2091 __in_z LPCWSTR wzBundleTag, 2063// results.uiLevel = *pUiLevel;
2092 __in BOOL fPerMachine, 2064// results.fDisableExternalUiHandler = *pfDisableExternalUiHandler;
2093 __in VERUTIL_VERSION* pVersion, 2065// results.fileVersioning = args.recommendedFileVersioning;
2094 __inout BOOL* pfIgnoreBundle 2066
2095 ) 2067// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIPACKAGE, &args, args.cbSize, &result);
2096{ 2068// ExitOnFailure(hr, "BA OnPlanMsiPackage failed.");
2097 HRESULT hr = S_OK; 2069
2098 BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS args = { }; 2070// if (results.fCancel)
2099 BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS results = { }; 2071// {
2100 2072// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2101 args.cbSize = sizeof(args); 2073// }
2102 args.wzBundleId = wzBundleId; 2074// *pActionMsiProperty = results.actionMsiProperty;
2103 args.relationType = relationType; 2075// *pUiLevel = results.uiLevel;
2104 args.wzBundleTag = wzBundleTag; 2076// *pfDisableExternalUiHandler = results.fDisableExternalUiHandler;
2105 args.fPerMachine = fPerMachine; 2077// *pFileVersioning = results.fileVersioning;
2106 args.wzVersion = pVersion->sczVersion; 2078
2107 args.fRecommendedIgnoreBundle = *pfIgnoreBundle; 2079// LExit:
2108 2080// return hr;
2109 results.cbSize = sizeof(results); 2081// }
2110 results.fIgnoreBundle = *pfIgnoreBundle; 2082
2111 2083// EXTERN_C BAAPI UserExperienceOnPlannedCompatiblePackage(
2112 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE, &args, &results); 2084// __in BURN_USER_EXPERIENCE* pUserExperience,
2113 ExitOnFailure(hr, "BA OnPlanForwardCompatibleBundle failed."); 2085// __in_z LPCWSTR wzPackageId,
2114 2086// __in_z LPCWSTR wzCompatiblePackageId,
2115 if (results.fCancel) 2087// __in BOOL fRemove
2116 { 2088// )
2117 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2089// {
2118 } 2090// HRESULT hr = S_OK;
2119 *pfIgnoreBundle = results.fIgnoreBundle; 2091// BA_ONPLANNEDCOMPATIBLEPACKAGE_ARGS args = { };
2120 2092// BA_ONPLANNEDCOMPATIBLEPACKAGE_RESULTS results = { };
2121LExit: 2093// PIPE_RPC_RESULT result = { };
2122 return hr; 2094
2123} 2095// args.cbSize = sizeof(args);
2124 2096// args.wzPackageId = wzPackageId;
2125EXTERN_C BAAPI UserExperienceOnPlanMsiPackage( 2097// args.wzCompatiblePackageId = wzCompatiblePackageId;
2126 __in BURN_USER_EXPERIENCE* pUserExperience, 2098// args.fRemove = fRemove;
2127 __in_z LPCWSTR wzPackageId, 2099
2128 __in BOOL fExecute, 2100// results.cbSize = sizeof(results);
2129 __in BOOTSTRAPPER_ACTION_STATE action, 2101
2130 __inout BURN_MSI_PROPERTY* pActionMsiProperty, 2102// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANNEDCOMPATIBLEPACKAGE, &args, args.cbSize, &result);
2131 __inout INSTALLUILEVEL* pUiLevel, 2103// ExitOnFailure(hr, "BA OnPlannedCompatiblePackage failed.");
2132 __inout BOOL* pfDisableExternalUiHandler, 2104
2133 __inout BOOTSTRAPPER_MSI_FILE_VERSIONING* pFileVersioning 2105// LExit:
2134 ) 2106// return hr;
2135{ 2107// }
2136 HRESULT hr = S_OK; 2108
2137 BA_ONPLANMSIPACKAGE_ARGS args = { }; 2109// EXTERN_C BAAPI UserExperienceOnPlannedPackage(
2138 BA_ONPLANMSIPACKAGE_RESULTS results = { }; 2110// __in BURN_USER_EXPERIENCE* pUserExperience,
2139 2111// __in_z LPCWSTR wzPackageId,
2140 args.cbSize = sizeof(args); 2112// __in BOOTSTRAPPER_ACTION_STATE execute,
2141 args.wzPackageId = wzPackageId; 2113// __in BOOTSTRAPPER_ACTION_STATE rollback,
2142 args.fExecute = fExecute; 2114// __in BOOL fPlannedCache,
2143 args.action = action; 2115// __in BOOL fPlannedUncache
2144 args.recommendedFileVersioning = *pFileVersioning; 2116// )
2145 2117// {
2146 results.cbSize = sizeof(results); 2118// HRESULT hr = S_OK;
2147 results.actionMsiProperty = *pActionMsiProperty; 2119// BA_ONPLANNEDPACKAGE_ARGS args = { };
2148 results.uiLevel = *pUiLevel; 2120// BA_ONPLANNEDPACKAGE_RESULTS results = { };
2149 results.fDisableExternalUiHandler = *pfDisableExternalUiHandler; 2121// PIPE_RPC_RESULT result = { };
2150 results.fileVersioning = args.recommendedFileVersioning; 2122
2151 2123// args.cbSize = sizeof(args);
2152 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIPACKAGE, &args, &results); 2124// args.wzPackageId = wzPackageId;
2153 ExitOnFailure(hr, "BA OnPlanMsiPackage failed."); 2125// args.execute = execute;
2154 2126// args.rollback = rollback;
2155 if (results.fCancel) 2127// args.fPlannedCache = fPlannedCache;
2156 { 2128// args.fPlannedUncache = fPlannedUncache;
2157 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2129
2158 } 2130// results.cbSize = sizeof(results);
2159 *pActionMsiProperty = results.actionMsiProperty; 2131
2160 *pUiLevel = results.uiLevel; 2132// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANNEDPACKAGE, &args, args.cbSize, &result);
2161 *pfDisableExternalUiHandler = results.fDisableExternalUiHandler; 2133// ExitOnFailure(hr, "BA OnPlannedPackage failed.");
2162 *pFileVersioning = results.fileVersioning; 2134
2163 2135// LExit:
2164LExit: 2136// return hr;
2165 return hr; 2137// }
2166} 2138
2167 2139// EXTERN_C BAAPI UserExperienceOnPlanPackageBegin(
2168EXTERN_C BAAPI UserExperienceOnPlannedCompatiblePackage( 2140// __in BURN_USER_EXPERIENCE* pUserExperience,
2169 __in BURN_USER_EXPERIENCE* pUserExperience, 2141// __in_z LPCWSTR wzPackageId,
2170 __in_z LPCWSTR wzPackageId, 2142// __in BOOTSTRAPPER_PACKAGE_STATE state,
2171 __in_z LPCWSTR wzCompatiblePackageId, 2143// __in BOOL fCached,
2172 __in BOOL fRemove 2144// __in BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition,
2173 ) 2145// __in BOOTSTRAPPER_PACKAGE_CONDITION_RESULT repairCondition,
2174{ 2146// __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState,
2175 HRESULT hr = S_OK; 2147// __inout BOOTSTRAPPER_CACHE_TYPE* pRequestedCacheType
2176 BA_ONPLANNEDCOMPATIBLEPACKAGE_ARGS args = { }; 2148// )
2177 BA_ONPLANNEDCOMPATIBLEPACKAGE_RESULTS results = { }; 2149// {
2178 2150// HRESULT hr = S_OK;
2179 args.cbSize = sizeof(args); 2151// BA_ONPLANPACKAGEBEGIN_ARGS args = { };
2180 args.wzPackageId = wzPackageId; 2152// BA_ONPLANPACKAGEBEGIN_RESULTS results = { };
2181 args.wzCompatiblePackageId = wzCompatiblePackageId; 2153// PIPE_RPC_RESULT result = { };
2182 args.fRemove = fRemove; 2154
2183 2155// args.cbSize = sizeof(args);
2184 results.cbSize = sizeof(results); 2156// args.wzPackageId = wzPackageId;
2185 2157// args.state = state;
2186 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANNEDCOMPATIBLEPACKAGE, &args, &results); 2158// args.fCached = fCached;
2187 ExitOnFailure(hr, "BA OnPlannedCompatiblePackage failed."); 2159// args.installCondition = installCondition;
2188 2160// args.repairCondition = repairCondition;
2189LExit: 2161// args.recommendedState = *pRequestedState;
2190 return hr; 2162// args.recommendedCacheType = *pRequestedCacheType;
2191} 2163
2192 2164// results.cbSize = sizeof(results);
2193EXTERN_C BAAPI UserExperienceOnPlannedPackage( 2165// results.requestedState = *pRequestedState;
2194 __in BURN_USER_EXPERIENCE* pUserExperience, 2166// results.requestedCacheType = *pRequestedCacheType;
2195 __in_z LPCWSTR wzPackageId, 2167
2196 __in BOOTSTRAPPER_ACTION_STATE execute, 2168// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN, &args, args.cbSize, &result);
2197 __in BOOTSTRAPPER_ACTION_STATE rollback, 2169// ExitOnFailure(hr, "BA OnPlanPackageBegin failed.");
2198 __in BOOL fPlannedCache, 2170
2199 __in BOOL fPlannedUncache 2171// if (results.fCancel)
2200 ) 2172// {
2201{ 2173// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2202 HRESULT hr = S_OK; 2174// }
2203 BA_ONPLANNEDPACKAGE_ARGS args = { }; 2175// *pRequestedState = results.requestedState;
2204 BA_ONPLANNEDPACKAGE_RESULTS results = { }; 2176
2205 2177// if (BOOTSTRAPPER_CACHE_TYPE_REMOVE <= results.requestedCacheType && BOOTSTRAPPER_CACHE_TYPE_FORCE >= results.requestedCacheType)
2206 args.cbSize = sizeof(args); 2178// {
2207 args.wzPackageId = wzPackageId; 2179// *pRequestedCacheType = results.requestedCacheType;
2208 args.execute = execute; 2180// }
2209 args.rollback = rollback; 2181
2210 args.fPlannedCache = fPlannedCache; 2182// LExit:
2211 args.fPlannedUncache = fPlannedUncache; 2183// return hr;
2212 2184// }
2213 results.cbSize = sizeof(results); 2185
2214 2186// EXTERN_C BAAPI UserExperienceOnPlanPackageComplete(
2215 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANNEDPACKAGE, &args, &results); 2187// __in BURN_USER_EXPERIENCE* pUserExperience,
2216 ExitOnFailure(hr, "BA OnPlannedPackage failed."); 2188// __in_z LPCWSTR wzPackageId,
2217 2189// __in HRESULT hrStatus,
2218LExit: 2190// __in BOOTSTRAPPER_REQUEST_STATE requested
2219 return hr; 2191// )
2220} 2192// {
2221 2193// HRESULT hr = S_OK;
2222EXTERN_C BAAPI UserExperienceOnPlanPackageBegin( 2194// BA_ONPLANPACKAGECOMPLETE_ARGS args = { };
2223 __in BURN_USER_EXPERIENCE* pUserExperience, 2195// BA_ONPLANPACKAGECOMPLETE_RESULTS results = { };
2224 __in_z LPCWSTR wzPackageId, 2196// PIPE_RPC_RESULT result = { };
2225 __in BOOTSTRAPPER_PACKAGE_STATE state, 2197
2226 __in BOOL fCached, 2198// args.cbSize = sizeof(args);
2227 __in BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, 2199// args.wzPackageId = wzPackageId;
2228 __in BOOTSTRAPPER_PACKAGE_CONDITION_RESULT repairCondition, 2200// args.hrStatus = hrStatus;
2229 __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState, 2201// args.requested = requested;
2230 __inout BOOTSTRAPPER_CACHE_TYPE* pRequestedCacheType 2202
2231 ) 2203// results.cbSize = sizeof(results);
2232{ 2204
2233 HRESULT hr = S_OK; 2205// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE, &args, args.cbSize, &result);
2234 BA_ONPLANPACKAGEBEGIN_ARGS args = { }; 2206// ExitOnFailure(hr, "BA OnPlanPackageComplete failed.");
2235 BA_ONPLANPACKAGEBEGIN_RESULTS results = { }; 2207
2236 2208// LExit:
2237 args.cbSize = sizeof(args); 2209// return hr;
2238 args.wzPackageId = wzPackageId; 2210// }
2239 args.state = state; 2211
2240 args.fCached = fCached; 2212// EXTERN_C BAAPI UserExperienceOnPlanRelatedBundle(
2241 args.installCondition = installCondition; 2213// __in BURN_USER_EXPERIENCE* pUserExperience,
2242 args.repairCondition = repairCondition; 2214// __in_z LPCWSTR wzBundleId,
2243 args.recommendedState = *pRequestedState; 2215// __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
2244 args.recommendedCacheType = *pRequestedCacheType; 2216// )
2245 2217// {
2246 results.cbSize = sizeof(results); 2218// HRESULT hr = S_OK;
2247 results.requestedState = *pRequestedState; 2219// BA_ONPLANRELATEDBUNDLE_ARGS args = { };
2248 results.requestedCacheType = *pRequestedCacheType; 2220// BA_ONPLANRELATEDBUNDLE_RESULTS results = { };
2249 2221// PIPE_RPC_RESULT result = { };
2250 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN, &args, &results); 2222
2251 ExitOnFailure(hr, "BA OnPlanPackageBegin failed."); 2223// args.cbSize = sizeof(args);
2252 2224// args.wzBundleId = wzBundleId;
2253 if (results.fCancel) 2225// args.recommendedState = *pRequestedState;
2254 { 2226
2255 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2227// results.cbSize = sizeof(results);
2256 } 2228// results.requestedState = *pRequestedState;
2257 *pRequestedState = results.requestedState; 2229
2258 2230// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE, &args, args.cbSize, &result);
2259 if (BOOTSTRAPPER_CACHE_TYPE_REMOVE <= results.requestedCacheType && BOOTSTRAPPER_CACHE_TYPE_FORCE >= results.requestedCacheType) 2231// ExitOnFailure(hr, "BA OnPlanRelatedBundle failed.");
2260 { 2232
2261 *pRequestedCacheType = results.requestedCacheType; 2233// if (results.fCancel)
2262 } 2234// {
2263 2235// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2264LExit: 2236// }
2265 return hr; 2237// *pRequestedState = results.requestedState;
2266} 2238
2267 2239// LExit:
2268EXTERN_C BAAPI UserExperienceOnPlanPackageComplete( 2240// return hr;
2269 __in BURN_USER_EXPERIENCE* pUserExperience, 2241// }
2270 __in_z LPCWSTR wzPackageId, 2242
2271 __in HRESULT hrStatus, 2243// EXTERN_C BAAPI UserExperienceOnPlanRelatedBundleType(
2272 __in BOOTSTRAPPER_REQUEST_STATE requested 2244// __in BURN_USER_EXPERIENCE* pUserExperience,
2273 ) 2245// __in_z LPCWSTR wzBundleId,
2274{ 2246// __inout BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE* pRequestedType
2275 HRESULT hr = S_OK; 2247// )
2276 BA_ONPLANPACKAGECOMPLETE_ARGS args = { }; 2248// {
2277 BA_ONPLANPACKAGECOMPLETE_RESULTS results = { }; 2249// HRESULT hr = S_OK;
2278 2250// BA_ONPLANRELATEDBUNDLETYPE_ARGS args = { };
2279 args.cbSize = sizeof(args); 2251// BA_ONPLANRELATEDBUNDLETYPE_RESULTS results = { };
2280 args.wzPackageId = wzPackageId; 2252// PIPE_RPC_RESULT result = { };
2281 args.hrStatus = hrStatus; 2253
2282 args.requested = requested; 2254// args.cbSize = sizeof(args);
2283 2255// args.wzBundleId = wzBundleId;
2284 results.cbSize = sizeof(results); 2256// args.recommendedType = *pRequestedType;
2285 2257
2286 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE, &args, &results); 2258// results.cbSize = sizeof(results);
2287 ExitOnFailure(hr, "BA OnPlanPackageComplete failed."); 2259// results.requestedType = *pRequestedType;
2288 2260
2289LExit: 2261// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLETYPE, &args, args.cbSize, &result);
2290 return hr; 2262// ExitOnFailure(hr, "BA OnPlanRelatedBundleType failed.");
2291} 2263
2292 2264// if (results.fCancel)
2293EXTERN_C BAAPI UserExperienceOnPlanRelatedBundle( 2265// {
2294 __in BURN_USER_EXPERIENCE* pUserExperience, 2266// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2295 __in_z LPCWSTR wzBundleId, 2267// }
2296 __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState 2268// *pRequestedType = results.requestedType;
2297 ) 2269
2298{ 2270// LExit:
2299 HRESULT hr = S_OK; 2271// return hr;
2300 BA_ONPLANRELATEDBUNDLE_ARGS args = { }; 2272// }
2301 BA_ONPLANRELATEDBUNDLE_RESULTS results = { }; 2273
2302 2274// EXTERN_C BAAPI UserExperienceOnPlanRestoreRelatedBundle(
2303 args.cbSize = sizeof(args); 2275// __in BURN_USER_EXPERIENCE* pUserExperience,
2304 args.wzBundleId = wzBundleId; 2276// __in_z LPCWSTR wzBundleId,
2305 args.recommendedState = *pRequestedState; 2277// __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
2306 2278// )
2307 results.cbSize = sizeof(results); 2279// {
2308 results.requestedState = *pRequestedState; 2280// HRESULT hr = S_OK;
2309 2281// BA_ONPLANRESTORERELATEDBUNDLE_ARGS args = { };
2310 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE, &args, &results); 2282// BA_ONPLANRESTORERELATEDBUNDLE_RESULTS results = { };
2311 ExitOnFailure(hr, "BA OnPlanRelatedBundle failed."); 2283// PIPE_RPC_RESULT result = { };
2312 2284
2313 if (results.fCancel) 2285// args.cbSize = sizeof(args);
2314 { 2286// args.wzBundleId = wzBundleId;
2315 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2287// args.recommendedState = *pRequestedState;
2316 } 2288
2317 *pRequestedState = results.requestedState; 2289// results.cbSize = sizeof(results);
2318 2290// results.requestedState = *pRequestedState;
2319LExit: 2291
2320 return hr; 2292// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRESTORERELATEDBUNDLE, &args, args.cbSize, &result);
2321} 2293// ExitOnFailure(hr, "BA OnPlanRestoreRelatedBundle failed.");
2322 2294
2323EXTERN_C BAAPI UserExperienceOnPlanRelatedBundleType( 2295// if (results.fCancel)
2324 __in BURN_USER_EXPERIENCE* pUserExperience, 2296// {
2325 __in_z LPCWSTR wzBundleId, 2297// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2326 __inout BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE* pRequestedType 2298// }
2327 ) 2299// *pRequestedState = results.requestedState;
2328{ 2300
2329 HRESULT hr = S_OK; 2301// LExit:
2330 BA_ONPLANRELATEDBUNDLETYPE_ARGS args = { }; 2302// return hr;
2331 BA_ONPLANRELATEDBUNDLETYPE_RESULTS results = { }; 2303// }
2332 2304
2333 args.cbSize = sizeof(args); 2305// EXTERN_C BAAPI UserExperienceOnPlanRollbackBoundary(
2334 args.wzBundleId = wzBundleId; 2306// __in BURN_USER_EXPERIENCE* pUserExperience,
2335 args.recommendedType = *pRequestedType; 2307// __in_z LPCWSTR wzRollbackBoundaryId,
2336 2308// __inout BOOL* pfTransaction
2337 results.cbSize = sizeof(results); 2309// )
2338 results.requestedType = *pRequestedType; 2310// {
2339 2311// HRESULT hr = S_OK;
2340 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLETYPE, &args, &results); 2312// BA_ONPLANROLLBACKBOUNDARY_ARGS args = { };
2341 ExitOnFailure(hr, "BA OnPlanRelatedBundleType failed."); 2313// BA_ONPLANROLLBACKBOUNDARY_RESULTS results = { };
2342 2314// PIPE_RPC_RESULT result = { };
2343 if (results.fCancel) 2315
2344 { 2316// args.cbSize = sizeof(args);
2345 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2317// args.wzRollbackBoundaryId = wzRollbackBoundaryId;
2346 } 2318// args.fRecommendedTransaction = *pfTransaction;
2347 *pRequestedType = results.requestedType; 2319
2348 2320// results.cbSize = sizeof(results);
2349LExit: 2321// results.fTransaction = *pfTransaction;
2350 return hr; 2322
2351} 2323// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY, &args, args.cbSize, &result);
2352 2324// ExitOnFailure(hr, "BA OnPlanRollbackBoundary failed.");
2353EXTERN_C BAAPI UserExperienceOnPlanRestoreRelatedBundle( 2325
2354 __in BURN_USER_EXPERIENCE* pUserExperience, 2326// if (results.fCancel)
2355 __in_z LPCWSTR wzBundleId, 2327// {
2356 __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState 2328// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2357 ) 2329// }
2358{ 2330// *pfTransaction = results.fTransaction;
2359 HRESULT hr = S_OK; 2331
2360 BA_ONPLANRESTORERELATEDBUNDLE_ARGS args = { }; 2332// LExit:
2361 BA_ONPLANRESTORERELATEDBUNDLE_RESULTS results = { }; 2333// return hr;
2362 2334// }
2363 args.cbSize = sizeof(args); 2335
2364 args.wzBundleId = wzBundleId; 2336// EXTERN_C BAAPI UserExperienceOnPlanPatchTarget(
2365 args.recommendedState = *pRequestedState; 2337// __in BURN_USER_EXPERIENCE* pUserExperience,
2366 2338// __in_z LPCWSTR wzPackageId,
2367 results.cbSize = sizeof(results); 2339// __in_z LPCWSTR wzProductCode,
2368 results.requestedState = *pRequestedState; 2340// __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState
2369 2341// )
2370 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRESTORERELATEDBUNDLE, &args, &results); 2342// {
2371 ExitOnFailure(hr, "BA OnPlanRestoreRelatedBundle failed."); 2343// HRESULT hr = S_OK;
2372 2344// BA_ONPLANPATCHTARGET_ARGS args = { };
2373 if (results.fCancel) 2345// BA_ONPLANPATCHTARGET_RESULTS results = { };
2374 { 2346// PIPE_RPC_RESULT result = { };
2375 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2347
2376 } 2348// args.cbSize = sizeof(args);
2377 *pRequestedState = results.requestedState; 2349// args.wzPackageId = wzPackageId;
2378 2350// args.wzProductCode = wzProductCode;
2379LExit: 2351// args.recommendedState = *pRequestedState;
2380 return hr; 2352
2381} 2353// results.cbSize = sizeof(results);
2382 2354// results.requestedState = *pRequestedState;
2383EXTERN_C BAAPI UserExperienceOnPlanRollbackBoundary( 2355
2384 __in BURN_USER_EXPERIENCE* pUserExperience, 2356// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPATCHTARGET, &args, args.cbSize, &result);
2385 __in_z LPCWSTR wzRollbackBoundaryId, 2357// ExitOnFailure(hr, "BA OnPlanPatchTarget failed.");
2386 __inout BOOL* pfTransaction 2358
2387 ) 2359// if (results.fCancel)
2388{ 2360// {
2389 HRESULT hr = S_OK; 2361// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2390 BA_ONPLANROLLBACKBOUNDARY_ARGS args = { }; 2362// }
2391 BA_ONPLANROLLBACKBOUNDARY_RESULTS results = { }; 2363// *pRequestedState = results.requestedState;
2392 2364
2393 args.cbSize = sizeof(args); 2365// LExit:
2394 args.wzRollbackBoundaryId = wzRollbackBoundaryId; 2366// return hr;
2395 args.fRecommendedTransaction = *pfTransaction; 2367// }
2396 2368
2397 results.cbSize = sizeof(results); 2369// EXTERN_C BAAPI UserExperienceOnProgress(
2398 results.fTransaction = *pfTransaction; 2370// __in BURN_USER_EXPERIENCE* pUserExperience,
2399 2371// __in BOOL fRollback,
2400 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY, &args, &results); 2372// __in DWORD dwProgressPercentage,
2401 ExitOnFailure(hr, "BA OnPlanRollbackBoundary failed."); 2373// __in DWORD dwOverallPercentage
2402 2374// )
2403 if (results.fCancel) 2375// {
2404 { 2376// HRESULT hr = S_OK;
2405 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2377// BA_ONPROGRESS_ARGS args = { };
2406 } 2378// BA_ONPROGRESS_RESULTS results = { };
2407 *pfTransaction = results.fTransaction; 2379// PIPE_RPC_RESULT result = { };
2408 2380
2409LExit: 2381// args.cbSize = sizeof(args);
2410 return hr; 2382// args.dwProgressPercentage = dwProgressPercentage;
2411} 2383// args.dwOverallPercentage = dwOverallPercentage;
2412 2384
2413EXTERN_C BAAPI UserExperienceOnPlanPatchTarget( 2385// results.cbSize = sizeof(results);
2414 __in BURN_USER_EXPERIENCE* pUserExperience, 2386
2415 __in_z LPCWSTR wzPackageId, 2387// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPROGRESS, &args, args.cbSize, &result);
2416 __in_z LPCWSTR wzProductCode, 2388// hr = FilterExecuteResult(pUserExperience, hr, fRollback, results.fCancel, L"OnProgress");
2417 __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState 2389
2418 ) 2390// return hr;
2419{ 2391// }
2420 HRESULT hr = S_OK; 2392
2421 BA_ONPLANPATCHTARGET_ARGS args = { }; 2393// EXTERN_C BAAPI UserExperienceOnRegisterBegin(
2422 BA_ONPLANPATCHTARGET_RESULTS results = { }; 2394// __in BURN_USER_EXPERIENCE* pUserExperience,
2423 2395// __inout BOOTSTRAPPER_REGISTRATION_TYPE* pRegistrationType
2424 args.cbSize = sizeof(args); 2396// )
2425 args.wzPackageId = wzPackageId; 2397// {
2426 args.wzProductCode = wzProductCode; 2398// HRESULT hr = S_OK;
2427 args.recommendedState = *pRequestedState; 2399// BA_ONREGISTERBEGIN_ARGS args = { };
2428 2400// BA_ONREGISTERBEGIN_RESULTS results = { };
2429 results.cbSize = sizeof(results); 2401// PIPE_RPC_RESULT result = { };
2430 results.requestedState = *pRequestedState; 2402
2431 2403// args.cbSize = sizeof(args);
2432 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPATCHTARGET, &args, &results); 2404// args.recommendedRegistrationType = *pRegistrationType;
2433 ExitOnFailure(hr, "BA OnPlanPatchTarget failed."); 2405
2434 2406// results.cbSize = sizeof(results);
2435 if (results.fCancel) 2407// results.registrationType = *pRegistrationType;
2436 { 2408
2437 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2409// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERBEGIN, &args, args.cbSize, &result);
2438 } 2410// ExitOnFailure(hr, "BA OnRegisterBegin failed.");
2439 *pRequestedState = results.requestedState; 2411
2440 2412// if (results.fCancel)
2441LExit: 2413// {
2442 return hr; 2414// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2443} 2415// }
2444 2416// else if (BOOTSTRAPPER_REGISTRATION_TYPE_NONE < results.registrationType && BOOTSTRAPPER_REGISTRATION_TYPE_FULL >= results.registrationType)
2445EXTERN_C BAAPI UserExperienceOnProgress( 2417// {
2446 __in BURN_USER_EXPERIENCE* pUserExperience, 2418// *pRegistrationType = results.registrationType;
2447 __in BOOL fRollback, 2419// }
2448 __in DWORD dwProgressPercentage, 2420
2449 __in DWORD dwOverallPercentage 2421// LExit:
2450 ) 2422// return hr;
2451{ 2423// }
2452 HRESULT hr = S_OK; 2424
2453 BA_ONPROGRESS_ARGS args = { }; 2425// EXTERN_C BAAPI UserExperienceOnRegisterComplete(
2454 BA_ONPROGRESS_RESULTS results = { }; 2426// __in BURN_USER_EXPERIENCE* pUserExperience,
2455 2427// __in HRESULT hrStatus
2456 args.cbSize = sizeof(args); 2428// )
2457 args.dwProgressPercentage = dwProgressPercentage; 2429// {
2458 args.dwOverallPercentage = dwOverallPercentage; 2430// HRESULT hr = S_OK;
2459 2431// BA_ONREGISTERCOMPLETE_ARGS args = { };
2460 results.cbSize = sizeof(results); 2432// BA_ONREGISTERCOMPLETE_RESULTS results = { };
2461 2433// PIPE_RPC_RESULT result = { };
2462 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPROGRESS, &args, &results); 2434
2463 hr = FilterExecuteResult(pUserExperience, hr, fRollback, results.fCancel, L"OnProgress"); 2435// args.cbSize = sizeof(args);
2464 2436// args.hrStatus = hrStatus;
2465 return hr; 2437
2466} 2438// results.cbSize = sizeof(results);
2467 2439
2468EXTERN_C BAAPI UserExperienceOnRegisterBegin( 2440// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERCOMPLETE, &args, args.cbSize, &result);
2469 __in BURN_USER_EXPERIENCE* pUserExperience, 2441// ExitOnFailure(hr, "BA OnRegisterComplete failed.");
2470 __inout BOOTSTRAPPER_REGISTRATION_TYPE* pRegistrationType 2442
2471 ) 2443// LExit:
2472{ 2444// return hr;
2473 HRESULT hr = S_OK; 2445// }
2474 BA_ONREGISTERBEGIN_ARGS args = { }; 2446
2475 BA_ONREGISTERBEGIN_RESULTS results = { }; 2447// EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionBegin(
2476 2448// __in BURN_USER_EXPERIENCE* pUserExperience,
2477 args.cbSize = sizeof(args); 2449// __in LPCWSTR wzTransactionId
2478 args.recommendedRegistrationType = *pRegistrationType; 2450// )
2479 2451// {
2480 results.cbSize = sizeof(results); 2452// HRESULT hr = S_OK;
2481 results.registrationType = *pRegistrationType; 2453// BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS args = { };
2482 2454// BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS results = { };
2483 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERBEGIN, &args, &results); 2455// PIPE_RPC_RESULT result = { };
2484 ExitOnFailure(hr, "BA OnRegisterBegin failed."); 2456
2485 2457// args.cbSize = sizeof(args);
2486 if (results.fCancel) 2458// args.wzTransactionId = wzTransactionId;
2487 { 2459
2488 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2460// results.cbSize = sizeof(results);
2489 } 2461
2490 else if (BOOTSTRAPPER_REGISTRATION_TYPE_NONE < results.registrationType && BOOTSTRAPPER_REGISTRATION_TYPE_FULL >= results.registrationType) 2462// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, args.cbSize, &result);
2491 { 2463// ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed.");
2492 *pRegistrationType = results.registrationType; 2464
2493 } 2465// LExit:
2494 2466// return hr;
2495LExit: 2467// }
2496 return hr; 2468
2497} 2469// EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete(
2498 2470// __in BURN_USER_EXPERIENCE* pUserExperience,
2499EXTERN_C BAAPI UserExperienceOnRegisterComplete( 2471// __in LPCWSTR wzTransactionId,
2500 __in BURN_USER_EXPERIENCE* pUserExperience, 2472// __in HRESULT hrStatus,
2501 __in HRESULT hrStatus 2473// __in BOOTSTRAPPER_APPLY_RESTART restart,
2502 ) 2474// __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION *pAction
2503{ 2475// )
2504 HRESULT hr = S_OK; 2476// {
2505 BA_ONREGISTERCOMPLETE_ARGS args = { }; 2477// HRESULT hr = S_OK;
2506 BA_ONREGISTERCOMPLETE_RESULTS results = { }; 2478// BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS args = { };
2507 2479// BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS results = { };
2508 args.cbSize = sizeof(args); 2480// PIPE_RPC_RESULT result = { };
2509 args.hrStatus = hrStatus; 2481
2510 2482// args.cbSize = sizeof(args);
2511 results.cbSize = sizeof(results); 2483// args.wzTransactionId = wzTransactionId;
2512 2484// args.hrStatus = hrStatus;
2513 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERCOMPLETE, &args, &results); 2485// args.restart = restart;
2514 ExitOnFailure(hr, "BA OnRegisterComplete failed."); 2486// args.recommendation = *pAction;
2515 2487
2516LExit: 2488// results.cbSize = sizeof(results);
2517 return hr; 2489// results.action = *pAction;
2518} 2490
2519 2491// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, args.cbSize, &result);
2520EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionBegin( 2492// ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed.");
2521 __in BURN_USER_EXPERIENCE* pUserExperience, 2493
2522 __in LPCWSTR wzTransactionId 2494// *pAction = results.action;
2523 ) 2495
2524{ 2496// LExit:
2525 HRESULT hr = S_OK; 2497// return hr;
2526 BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS args = { }; 2498// }
2527 BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS results = { }; 2499
2528 2500// EXTERN_C BAAPI UserExperienceOnSetUpdateBegin(
2529 args.cbSize = sizeof(args); 2501// __in BURN_USER_EXPERIENCE* pUserExperience
2530 args.wzTransactionId = wzTransactionId; 2502// )
2531 2503// {
2532 results.cbSize = sizeof(results); 2504// HRESULT hr = S_OK;
2533 2505// BA_ONSETUPDATEBEGIN_ARGS args = { };
2534 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results); 2506// BA_ONSETUPDATEBEGIN_RESULTS results = { };
2535 ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); 2507// PIPE_RPC_RESULT result = { };
2536 2508
2537LExit: 2509// args.cbSize = sizeof(args);
2538 return hr; 2510
2539} 2511// results.cbSize = sizeof(results);
2540 2512
2541EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( 2513// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATEBEGIN, &args, args.cbSize, &result);
2542 __in BURN_USER_EXPERIENCE* pUserExperience, 2514// ExitOnFailure(hr, "BA OnSetUpdateBegin failed.");
2543 __in LPCWSTR wzTransactionId, 2515
2544 __in HRESULT hrStatus, 2516// LExit:
2545 __in BOOTSTRAPPER_APPLY_RESTART restart, 2517// return hr;
2546 __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION *pAction 2518// }
2547 ) 2519
2548{ 2520// EXTERN_C BAAPI UserExperienceOnSetUpdateComplete(
2549 HRESULT hr = S_OK; 2521// __in BURN_USER_EXPERIENCE* pUserExperience,
2550 BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS args = { }; 2522// __in HRESULT hrStatus,
2551 BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS results = { }; 2523// __in_z_opt LPCWSTR wzPreviousPackageId,
2552 2524// __in_z_opt LPCWSTR wzNewPackageId
2553 args.cbSize = sizeof(args); 2525// )
2554 args.wzTransactionId = wzTransactionId; 2526// {
2555 args.hrStatus = hrStatus; 2527// HRESULT hr = S_OK;
2556 args.restart = restart; 2528// BA_ONSETUPDATECOMPLETE_ARGS args = { };
2557 args.recommendation = *pAction; 2529// BA_ONSETUPDATECOMPLETE_RESULTS results = { };
2558 2530// PIPE_RPC_RESULT result = { };
2559 results.cbSize = sizeof(results); 2531
2560 results.action = *pAction; 2532// args.cbSize = sizeof(args);
2561 2533// args.hrStatus = hrStatus;
2562 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results); 2534// args.wzPreviousPackageId = wzPreviousPackageId;
2563 ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); 2535// args.wzNewPackageId = wzNewPackageId;
2564 2536
2565 *pAction = results.action; 2537// results.cbSize = sizeof(results);
2566 2538
2567LExit: 2539// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATECOMPLETE, &args, args.cbSize, &result);
2568 return hr; 2540// ExitOnFailure(hr, "BA OnSetUpdateComplete failed.");
2569} 2541
2570 2542// LExit:
2571EXTERN_C BAAPI UserExperienceOnSetUpdateBegin( 2543// return hr;
2572 __in BURN_USER_EXPERIENCE* pUserExperience 2544// }
2573 ) 2545
2574{ 2546// EXTERN_C BAAPI UserExperienceOnSystemRestorePointBegin(
2575 HRESULT hr = S_OK; 2547// __in BURN_USER_EXPERIENCE* pUserExperience
2576 BA_ONSETUPDATEBEGIN_ARGS args = { }; 2548// )
2577 BA_ONSETUPDATEBEGIN_RESULTS results = { }; 2549// {
2578 2550// HRESULT hr = S_OK;
2579 args.cbSize = sizeof(args); 2551// BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS args = { };
2580 2552// BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS results = { };
2581 results.cbSize = sizeof(results); 2553// PIPE_RPC_RESULT result = { };
2582 2554
2583 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATEBEGIN, &args, &results); 2555// args.cbSize = sizeof(args);
2584 ExitOnFailure(hr, "BA OnSetUpdateBegin failed."); 2556
2585 2557// results.cbSize = sizeof(results);
2586LExit: 2558
2587 return hr; 2559// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, args.cbSize, &result);
2588} 2560// ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed.");
2589 2561
2590EXTERN_C BAAPI UserExperienceOnSetUpdateComplete( 2562// LExit:
2591 __in BURN_USER_EXPERIENCE* pUserExperience, 2563// return hr;
2592 __in HRESULT hrStatus, 2564// }
2593 __in_z_opt LPCWSTR wzPreviousPackageId, 2565
2594 __in_z_opt LPCWSTR wzNewPackageId 2566// EXTERN_C BAAPI UserExperienceOnSystemRestorePointComplete(
2595 ) 2567// __in BURN_USER_EXPERIENCE* pUserExperience,
2596{ 2568// __in HRESULT hrStatus
2597 HRESULT hr = S_OK; 2569// )
2598 BA_ONSETUPDATECOMPLETE_ARGS args = { }; 2570// {
2599 BA_ONSETUPDATECOMPLETE_RESULTS results = { }; 2571// HRESULT hr = S_OK;
2600 2572// BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS args = { };
2601 args.cbSize = sizeof(args); 2573// BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS results = { };
2602 args.hrStatus = hrStatus; 2574// PIPE_RPC_RESULT result = { };
2603 args.wzPreviousPackageId = wzPreviousPackageId; 2575
2604 args.wzNewPackageId = wzNewPackageId; 2576// args.cbSize = sizeof(args);
2605 2577// args.hrStatus = hrStatus;
2606 results.cbSize = sizeof(results); 2578
2607 2579// results.cbSize = sizeof(results);
2608 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSETUPDATECOMPLETE, &args, &results); 2580
2609 ExitOnFailure(hr, "BA OnSetUpdateComplete failed."); 2581// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE, &args, args.cbSize, &result);
2610 2582// ExitOnFailure(hr, "BA OnSystemRestorePointComplete failed.");
2611LExit: 2583
2612 return hr; 2584// LExit:
2613} 2585// return hr;
2614 2586// }
2615EXTERN_C BAAPI UserExperienceOnShutdown( 2587
2616 __in BURN_USER_EXPERIENCE* pUserExperience, 2588// EXTERN_C BAAPI UserExperienceOnUnregisterBegin(
2617 __inout BOOTSTRAPPER_SHUTDOWN_ACTION* pAction 2589// __in BURN_USER_EXPERIENCE* pUserExperience,
2618 ) 2590// __inout BOOTSTRAPPER_REGISTRATION_TYPE* pRegistrationType
2619{ 2591// )
2620 HRESULT hr = S_OK; 2592// {
2621 BA_ONSHUTDOWN_ARGS args = { }; 2593// HRESULT hr = S_OK;
2622 BA_ONSHUTDOWN_RESULTS results = { }; 2594// BA_ONUNREGISTERBEGIN_ARGS args = { };
2623 2595// BA_ONUNREGISTERBEGIN_RESULTS results = { };
2624 args.cbSize = sizeof(args); 2596// PIPE_RPC_RESULT result = { };
2625 2597
2626 results.cbSize = sizeof(results); 2598// args.cbSize = sizeof(args);
2627 results.action = *pAction; 2599// args.recommendedRegistrationType = *pRegistrationType;
2628 2600
2629 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN, &args, &results); 2601// results.cbSize = sizeof(results);
2630 ExitOnFailure(hr, "BA OnShutdown failed."); 2602// results.registrationType = *pRegistrationType;
2631 2603
2632 *pAction = results.action; 2604// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN, &args, args.cbSize, &result);
2633 2605// ExitOnFailure(hr, "BA OnUnregisterBegin failed.");
2634LExit: 2606
2635 return hr; 2607// if (BOOTSTRAPPER_REGISTRATION_TYPE_NONE < results.registrationType && BOOTSTRAPPER_REGISTRATION_TYPE_FULL >= results.registrationType)
2636} 2608// {
2637 2609// *pRegistrationType = results.registrationType;
2638EXTERN_C BAAPI UserExperienceOnStartup( 2610// }
2639 __in BURN_USER_EXPERIENCE* pUserExperience 2611
2640 ) 2612// LExit:
2641{ 2613// return hr;
2642 HRESULT hr = S_OK; 2614// }
2643 BA_ONSTARTUP_ARGS args = { }; 2615
2644 BA_ONSTARTUP_RESULTS results = { }; 2616// EXTERN_C BAAPI UserExperienceOnUnregisterComplete(
2645 2617// __in BURN_USER_EXPERIENCE* pUserExperience,
2646 args.cbSize = sizeof(args); 2618// __in HRESULT hrStatus
2647 2619// )
2648 results.cbSize = sizeof(results); 2620// {
2649 2621// HRESULT hr = S_OK;
2650 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP, &args, &results); 2622// BA_ONUNREGISTERCOMPLETE_ARGS args = { };
2651 ExitOnFailure(hr, "BA OnStartup failed."); 2623// BA_ONUNREGISTERCOMPLETE_RESULTS results = { };
2652 2624// PIPE_RPC_RESULT result = { };
2653LExit: 2625
2654 return hr; 2626// args.cbSize = sizeof(args);
2655} 2627// args.hrStatus = hrStatus;
2656 2628
2657EXTERN_C BAAPI UserExperienceOnSystemRestorePointBegin( 2629// results.cbSize = sizeof(results);
2658 __in BURN_USER_EXPERIENCE* pUserExperience 2630
2659 ) 2631// hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERCOMPLETE, &args, args.cbSize, &result);
2660{ 2632// ExitOnFailure(hr, "BA OnUnregisterComplete failed.");
2661 HRESULT hr = S_OK; 2633
2662 BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS args = { }; 2634// LExit:
2663 BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS results = { }; 2635// return hr;
2664 2636// }
2665 args.cbSize = sizeof(args); 2637
2666 2638// extern "C" int UserExperienceCheckExecuteResult(
2667 results.cbSize = sizeof(results); 2639// __in BURN_USER_EXPERIENCE* pUserExperience,
2668 2640// __in BOOL fRollback,
2669 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results); 2641// __in DWORD dwAllowedResults,
2670 ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); 2642// __in int nResult
2671 2643// )
2672LExit: 2644// {
2673 return hr; 2645// // Do not allow canceling while rolling back.
2674} 2646// if (fRollback && (IDCANCEL == nResult || IDABORT == nResult))
2675 2647// {
2676EXTERN_C BAAPI UserExperienceOnSystemRestorePointComplete( 2648// nResult = IDNOACTION;
2677 __in BURN_USER_EXPERIENCE* pUserExperience, 2649// }
2678 __in HRESULT hrStatus 2650// else if (FAILED(pUserExperience->hrApplyError) && !fRollback) // if we failed cancel except not during rollback.
2679 ) 2651// {
2680{ 2652// nResult = IDCANCEL;
2681 HRESULT hr = S_OK; 2653// }
2682 BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS args = { }; 2654
2683 BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS results = { }; 2655// nResult = FilterResult(dwAllowedResults, nResult);
2684 2656// return nResult;
2685 args.cbSize = sizeof(args); 2657// }
2686 args.hrStatus = hrStatus; 2658
2687 2659// extern "C" HRESULT UserExperienceInterpretExecuteResult(
2688 results.cbSize = sizeof(results); 2660// __in BURN_USER_EXPERIENCE* pUserExperience,
2689 2661// __in BOOL fRollback,
2690 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE, &args, &results); 2662// __in DWORD dwAllowedResults,
2691 ExitOnFailure(hr, "BA OnSystemRestorePointComplete failed."); 2663// __in int nResult
2692 2664// )
2693LExit: 2665// {
2694 return hr; 2666// HRESULT hr = S_OK;
2695} 2667
2696 2668// // If we failed return that error unless this is rollback which should roll on.
2697EXTERN_C BAAPI UserExperienceOnUnregisterBegin( 2669// if (FAILED(pUserExperience->hrApplyError) && !fRollback)
2698 __in BURN_USER_EXPERIENCE* pUserExperience, 2670// {
2699 __inout BOOTSTRAPPER_REGISTRATION_TYPE* pRegistrationType 2671// hr = pUserExperience->hrApplyError;
2700 ) 2672// }
2701{ 2673// else
2702 HRESULT hr = S_OK; 2674// {
2703 BA_ONUNREGISTERBEGIN_ARGS args = { }; 2675// int nCheckedResult = UserExperienceCheckExecuteResult(pUserExperience, fRollback, dwAllowedResults, nResult);
2704 BA_ONUNREGISTERBEGIN_RESULTS results = { }; 2676// hr = IDOK == nCheckedResult || IDNOACTION == nCheckedResult ? S_OK : IDCANCEL == nCheckedResult || IDABORT == nCheckedResult ? HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT) : HRESULT_FROM_WIN32(ERROR_INSTALL_FAILURE);
2705 2677// }
2706 args.cbSize = sizeof(args); 2678
2707 args.recommendedRegistrationType = *pRegistrationType; 2679// return hr;
2708 2680// }
2709 results.cbSize = sizeof(results); 2681
2710 results.registrationType = *pRegistrationType; 2682
2711 2683// // internal functions
2712 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN, &args, &results); 2684
2713 ExitOnFailure(hr, "BA OnUnregisterBegin failed."); 2685// static int FilterResult(
2714 2686// __in DWORD dwAllowedResults,
2715 if (BOOTSTRAPPER_REGISTRATION_TYPE_NONE < results.registrationType && BOOTSTRAPPER_REGISTRATION_TYPE_FULL >= results.registrationType) 2687// __in int nResult
2716 { 2688// )
2717 *pRegistrationType = results.registrationType; 2689// {
2718 } 2690// if (IDNOACTION == nResult || IDERROR == nResult) // do nothing and errors pass through.
2719 2691// {
2720LExit: 2692// }
2721 return hr; 2693// else
2722} 2694// {
2723 2695// switch (dwAllowedResults)
2724EXTERN_C BAAPI UserExperienceOnUnregisterComplete( 2696// {
2725 __in BURN_USER_EXPERIENCE* pUserExperience, 2697// case MB_OK:
2726 __in HRESULT hrStatus 2698// nResult = IDOK;
2727 ) 2699// break;
2728{ 2700
2729 HRESULT hr = S_OK; 2701// case MB_OKCANCEL:
2730 BA_ONUNREGISTERCOMPLETE_ARGS args = { }; 2702// if (IDOK == nResult || IDYES == nResult)
2731 BA_ONUNREGISTERCOMPLETE_RESULTS results = { }; 2703// {
2732 2704// nResult = IDOK;
2733 args.cbSize = sizeof(args); 2705// }
2734 args.hrStatus = hrStatus; 2706// else if (IDCANCEL == nResult || IDABORT == nResult || IDNO == nResult)
2735 2707// {
2736 results.cbSize = sizeof(results); 2708// nResult = IDCANCEL;
2737 2709// }
2738 hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERCOMPLETE, &args, &results); 2710// else
2739 ExitOnFailure(hr, "BA OnUnregisterComplete failed."); 2711// {
2740 2712// nResult = IDNOACTION;
2741LExit: 2713// }
2742 return hr; 2714// break;
2743} 2715
2744 2716// case MB_ABORTRETRYIGNORE:
2745extern "C" int UserExperienceCheckExecuteResult( 2717// if (IDCANCEL == nResult || IDABORT == nResult)
2746 __in BURN_USER_EXPERIENCE* pUserExperience, 2718// {
2747 __in BOOL fRollback, 2719// nResult = IDABORT;
2748 __in DWORD dwAllowedResults, 2720// }
2749 __in int nResult 2721// else if (IDRETRY == nResult || IDTRYAGAIN == nResult)
2750 ) 2722// {
2751{ 2723// nResult = IDRETRY;
2752 // Do not allow canceling while rolling back. 2724// }
2753 if (fRollback && (IDCANCEL == nResult || IDABORT == nResult)) 2725// else if (IDIGNORE == nResult)
2754 { 2726// {
2755 nResult = IDNOACTION; 2727// nResult = IDIGNORE;
2756 } 2728// }
2757 else if (FAILED(pUserExperience->hrApplyError) && !fRollback) // if we failed cancel except not during rollback. 2729// else
2758 { 2730// {
2759 nResult = IDCANCEL; 2731// nResult = IDNOACTION;
2760 } 2732// }
2761 2733// break;
2762 nResult = FilterResult(dwAllowedResults, nResult); 2734
2763 return nResult; 2735// case MB_YESNO:
2764} 2736// if (IDOK == nResult || IDYES == nResult)
2765 2737// {
2766extern "C" HRESULT UserExperienceInterpretExecuteResult( 2738// nResult = IDYES;
2767 __in BURN_USER_EXPERIENCE* pUserExperience, 2739// }
2768 __in BOOL fRollback, 2740// else if (IDCANCEL == nResult || IDABORT == nResult || IDNO == nResult)
2769 __in DWORD dwAllowedResults, 2741// {
2770 __in int nResult 2742// nResult = IDNO;
2771 ) 2743// }
2772{ 2744// else
2773 HRESULT hr = S_OK; 2745// {
2774 2746// nResult = IDNOACTION;
2775 // If we failed return that error unless this is rollback which should roll on. 2747// }
2776 if (FAILED(pUserExperience->hrApplyError) && !fRollback) 2748// break;
2777 { 2749
2778 hr = pUserExperience->hrApplyError; 2750// case MB_YESNOCANCEL:
2779 } 2751// if (IDOK == nResult || IDYES == nResult)
2780 else 2752// {
2781 { 2753// nResult = IDYES;
2782 int nCheckedResult = UserExperienceCheckExecuteResult(pUserExperience, fRollback, dwAllowedResults, nResult); 2754// }
2783 hr = IDOK == nCheckedResult || IDNOACTION == nCheckedResult ? S_OK : IDCANCEL == nCheckedResult || IDABORT == nCheckedResult ? HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT) : HRESULT_FROM_WIN32(ERROR_INSTALL_FAILURE); 2755// else if (IDNO == nResult)
2784 } 2756// {
2785 2757// nResult = IDNO;
2786 return hr; 2758// }
2787} 2759// else if (IDCANCEL == nResult || IDABORT == nResult)
2788 2760// {
2789 2761// nResult = IDCANCEL;
2790// internal functions 2762// }
2791 2763// else
2792static int FilterResult( 2764// {
2793 __in DWORD dwAllowedResults, 2765// nResult = IDNOACTION;
2794 __in int nResult 2766// }
2795 ) 2767// break;
2796{ 2768
2797 if (IDNOACTION == nResult || IDERROR == nResult) // do nothing and errors pass through. 2769// case MB_RETRYCANCEL:
2798 { 2770// if (IDRETRY == nResult || IDTRYAGAIN == nResult)
2799 } 2771// {
2800 else 2772// nResult = IDRETRY;
2801 { 2773// }
2802 switch (dwAllowedResults) 2774// else if (IDCANCEL == nResult || IDABORT == nResult)
2803 { 2775// {
2804 case MB_OK: 2776// nResult = IDABORT;
2805 nResult = IDOK; 2777// }
2806 break; 2778// else
2807 2779// {
2808 case MB_OKCANCEL: 2780// nResult = IDNOACTION;
2809 if (IDOK == nResult || IDYES == nResult) 2781// }
2810 { 2782// break;
2811 nResult = IDOK; 2783
2812 } 2784// case MB_CANCELTRYCONTINUE:
2813 else if (IDCANCEL == nResult || IDABORT == nResult || IDNO == nResult) 2785// if (IDCANCEL == nResult || IDABORT == nResult)
2814 { 2786// {
2815 nResult = IDCANCEL; 2787// nResult = IDABORT;
2816 } 2788// }
2817 else 2789// else if (IDRETRY == nResult || IDTRYAGAIN == nResult)
2818 { 2790// {
2819 nResult = IDNOACTION; 2791// nResult = IDRETRY;
2820 } 2792// }
2821 break; 2793// else if (IDCONTINUE == nResult || IDIGNORE == nResult)
2822 2794// {
2823 case MB_ABORTRETRYIGNORE: 2795// nResult = IDCONTINUE;
2824 if (IDCANCEL == nResult || IDABORT == nResult) 2796// }
2825 { 2797// else
2826 nResult = IDABORT; 2798// {
2827 } 2799// nResult = IDNOACTION;
2828 else if (IDRETRY == nResult || IDTRYAGAIN == nResult) 2800// }
2829 { 2801// break;
2830 nResult = IDRETRY; 2802
2831 } 2803// case BURN_MB_RETRYTRYAGAIN: // custom return code.
2832 else if (IDIGNORE == nResult) 2804// if (IDRETRY != nResult && IDTRYAGAIN != nResult)
2833 { 2805// {
2834 nResult = IDIGNORE; 2806// nResult = IDNOACTION;
2835 } 2807// }
2836 else 2808// break;
2837 { 2809
2838 nResult = IDNOACTION; 2810// default:
2839 } 2811// AssertSz(FALSE, "Unknown allowed results.");
2840 break; 2812// break;
2841 2813// }
2842 case MB_YESNO: 2814// }
2843 if (IDOK == nResult || IDYES == nResult) 2815
2844 { 2816// return nResult;
2845 nResult = IDYES; 2817// }
2846 } 2818
2847 else if (IDCANCEL == nResult || IDABORT == nResult || IDNO == nResult) 2819// // This filters the BA's responses to events during apply.
2848 { 2820// // If an apply thread failed, then return its error so this thread will bail out.
2849 nResult = IDNO; 2821// // During rollback, the BA can't cancel.
2850 } 2822// static HRESULT FilterExecuteResult(
2851 else 2823// __in BURN_USER_EXPERIENCE* pUserExperience,
2852 { 2824// __in HRESULT hrStatus,
2853 nResult = IDNOACTION; 2825// __in BOOL fRollback,
2854 } 2826// __in BOOL fCancel,
2855 break; 2827// __in LPCWSTR sczEventName
2856 2828// )
2857 case MB_YESNOCANCEL: 2829// {
2858 if (IDOK == nResult || IDYES == nResult) 2830// HRESULT hr = hrStatus;
2859 { 2831// HRESULT hrApplyError = pUserExperience->hrApplyError; // make sure to use the same value for the whole method, since it can be changed in other threads.
2860 nResult = IDYES; 2832
2861 } 2833// // If we failed return that error unless this is rollback which should roll on.
2862 else if (IDNO == nResult) 2834// if (FAILED(hrApplyError) && !fRollback)
2863 { 2835// {
2864 nResult = IDNO; 2836// hr = hrApplyError;
2865 } 2837// }
2866 else if (IDCANCEL == nResult || IDABORT == nResult) 2838// else if (fRollback)
2867 { 2839// {
2868 nResult = IDCANCEL; 2840// if (fCancel)
2869 } 2841// {
2870 else 2842// LogId(REPORT_STANDARD, MSG_APPLY_CANCEL_IGNORED_DURING_ROLLBACK, sczEventName);
2871 { 2843// }
2872 nResult = IDNOACTION; 2844// // TODO: since cancel isn't allowed, should the BA's HRESULT be ignored as well?
2873 } 2845// // In the previous code, they could still alter rollback by returning IDERROR.
2874 break; 2846// }
2875 2847// else
2876 case MB_RETRYCANCEL: 2848// {
2877 if (IDRETRY == nResult || IDTRYAGAIN == nResult) 2849// ExitOnFailure(hr, "BA %ls failed.", sczEventName);
2878 { 2850
2879 nResult = IDRETRY; 2851// if (fCancel)
2880 } 2852// {
2881 else if (IDCANCEL == nResult || IDABORT == nResult) 2853// hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2882 { 2854// }
2883 nResult = IDABORT; 2855// }
2884 } 2856
2885 else 2857// LExit:
2886 { 2858// return hr;
2887 nResult = IDNOACTION; 2859// }
2888 } 2860
2889 break; 2861// static HRESULT SendBAMessage(
2890 2862// __in BURN_USER_EXPERIENCE* /*pUserExperience*/,
2891 case MB_CANCELTRYCONTINUE: 2863// __in BOOTSTRAPPER_APPLICATION_MESSAGE /*message*/,
2892 if (IDCANCEL == nResult || IDABORT == nResult) 2864// __in_bcount(cbArgs) const LPVOID /*pvArgs*/,
2893 { 2865// __in DWORD /*cbArgs*/,
2894 nResult = IDABORT; 2866// __in PIPE_RPC_RESULT* /*pResult*/
2895 } 2867// )
2896 else if (IDRETRY == nResult || IDTRYAGAIN == nResult) 2868// {
2897 { 2869// // // HRESULT hr = S_OK;
2898 nResult = IDRETRY; 2870// // // // DWORD rgResultAndSize[2] = { };
2899 } 2871// // // // DWORD cbSize = 0;
2900 else if (IDCONTINUE == nResult || IDIGNORE == nResult) 2872// // // // LPVOID pvData = NULL;
2901 { 2873// // // // DWORD cbData = 0;
2902 nResult = IDCONTINUE; 2874
2903 } 2875// // // //if (!pUserExperience->hUXModule)
2904 else 2876// // // if (!PipeRpcInitialized(&pUserExperience->hBARpcPipe))
2905 { 2877// // // {
2906 nResult = IDNOACTION; 2878// // // ExitFunction();
2907 } 2879// // // }
2908 break; 2880
2909 2881// // // //hr = pUserExperience->pfnBAProc(message, pvArgs, pvResults, pUserExperience->pvBAProcContext);
2910 case BURN_MB_RETRYTRYAGAIN: // custom return code. 2882// // // //if (hr == E_NOTIMPL)
2911 if (IDRETRY != nResult && IDTRYAGAIN != nResult) 2883// // // //{
2912 { 2884// // // // hr = S_OK;
2913 nResult = IDNOACTION; 2885// // // //}
2914 } 2886
2915 break; 2887// // // // Send the message.
2916 2888// // // // hr = PipeWriteMessage(hPipe, message, pvArgs, cbArgs);
2917 default: 2889// // // hr = PipeRpcRequest(&pUserExperience->hBARpcPipe, message, pvArgs, cbArgs, pResult);
2918 AssertSz(FALSE, "Unknown allowed results."); 2890// // // ExitOnFailure(hr, "Failed to write message to BA.");
2919 break; 2891
2920 } 2892// // // #if TODO_DELETE
2921 } 2893// // // // Read the result and size of response.
2922 2894// // // hr = FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(rgResultAndSize), sizeof(rgResultAndSize));
2923 return nResult; 2895// // // ExitOnFailure(hr, "Failed to read result and size of message.");
2924} 2896
2925 2897// // // pResult->hr = rgResultAndSize[0];
2926// This filters the BA's responses to events during apply. 2898// // // cbSize = rgResultAndSize[1];
2927// If an apply thread failed, then return its error so this thread will bail out. 2899
2928// During rollback, the BA can't cancel. 2900// // // // Ensure the message size isn't "too big".
2929static HRESULT FilterExecuteResult( 2901// // // if (cbSize > MAX_SIZE_BA_RESPONSE)
2930 __in BURN_USER_EXPERIENCE* pUserExperience, 2902// // // {
2931 __in HRESULT hrStatus, 2903// // // hr = E_INVALIDDATA;
2932 __in BOOL fRollback, 2904// // // ExitOnRootFailure(hr, "BA sent too much data in response.");
2933 __in BOOL fCancel, 2905// // // }
2934 __in LPCWSTR sczEventName 2906// // // else if (cbSize > sizeof(DWORD)) // if there is data beyond the size of the response struct, read it.
2935 ) 2907// // // {
2936{ 2908// // // cbData = cbSize - sizeof(DWORD);
2937 HRESULT hr = hrStatus; 2909
2938 HRESULT hrApplyError = pUserExperience->hrApplyError; // make sure to use the same value for the whole method, since it can be changed in other threads. 2910// // // pvData = MemAlloc(cbData, TRUE);
2939 2911// // // ExitOnNull(pvData, hr, E_OUTOFMEMORY, "Failed to allocate memory for BA results.");
2940 // If we failed return that error unless this is rollback which should roll on. 2912
2941 if (FAILED(hrApplyError) && !fRollback) 2913// // // hr = FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(pvData), cbData);
2942 { 2914// // // ExitOnFailure(hr, "Failed to read result and size of message.");
2943 hr = hrApplyError; 2915// // // }
2944 } 2916
2945 else if (fRollback) 2917// // // pResult->cbSize = cbSize;
2946 { 2918// // // pResult->cbData = cbData;
2947 if (fCancel) 2919// // // pResult->pvData = pvData;
2948 { 2920// // // pvData = NULL;
2949 LogId(REPORT_STANDARD, MSG_APPLY_CANCEL_IGNORED_DURING_ROLLBACK, sczEventName); 2921// // // #endif
2950 } 2922
2951 // TODO: since cancel isn't allowed, should the BA's HRESULT be ignored as well? 2923// // // hr = pResult->hr;
2952 // In the previous code, they could still alter rollback by returning IDERROR. 2924// // // ExitOnFailure(hr, "BA reported failure.");
2953 } 2925
2954 else 2926// // // LExit:
2955 { 2927// // // // ReleaseMem(pvData);
2956 ExitOnFailure(hr, "BA %ls failed.", sczEventName); 2928
2957 2929// // // return hr;
2958 if (fCancel) 2930// return E_NOTIMPL;
2959 { 2931// }
2960 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); 2932
2961 } 2933// static HRESULT SendBAMessageFromInactiveEngine(
2962 } 2934// __in BURN_USER_EXPERIENCE* /*pUserExperience*/,
2963 2935// __in BOOTSTRAPPER_APPLICATION_MESSAGE /*message*/,
2964LExit: 2936// __in_bcount(cbArgs) const LPVOID /*pvArgs*/,
2965 return hr; 2937// __in DWORD /*cbArgs*/,
2966} 2938// __in PIPE_RPC_RESULT* /*pResult*/
2967 2939// )
2968static HRESULT SendBAMessage( 2940// {
2969 __in BURN_USER_EXPERIENCE* pUserExperience, 2941// // // HRESULT hr = S_OK;
2970 __in BOOTSTRAPPER_APPLICATION_MESSAGE message, 2942
2971 __in const LPVOID pvArgs, 2943// // // //if (!pUserExperience->hUXModule)
2972 __inout LPVOID pvResults 2944// // // if (!PipeRpcInitialized(&pUserExperience->hBARpcPipe))
2973 ) 2945// // // {
2974{ 2946// // // ExitFunction();
2975 HRESULT hr = S_OK; 2947// // // }
2976 2948
2977 if (!pUserExperience->hUXModule) 2949// // // UserExperienceDeactivateEngine(pUserExperience);
2978 { 2950
2979 ExitFunction(); 2951// // // hr = SendBAMessage(pUserExperience, message, pvArgs, cbArgs, pResult);
2980 } 2952
2981 2953// // // UserExperienceActivateEngine(pUserExperience);
2982 hr = pUserExperience->pfnBAProc(message, pvArgs, pvResults, pUserExperience->pvBAProcContext); 2954
2983 if (hr == E_NOTIMPL) 2955// // // LExit:
2984 { 2956// // // return hr;
2985 hr = S_OK; 2957// return E_NOTIMPL;
2986 } 2958// }
2987
2988LExit:
2989 return hr;
2990}
2991
2992static HRESULT SendBAMessageFromInactiveEngine(
2993 __in BURN_USER_EXPERIENCE* pUserExperience,
2994 __in BOOTSTRAPPER_APPLICATION_MESSAGE message,
2995 __in const LPVOID pvArgs,
2996 __inout LPVOID pvResults
2997 )
2998{
2999 HRESULT hr = S_OK;
3000
3001 if (!pUserExperience->hUXModule)
3002 {
3003 ExitFunction();
3004 }
3005
3006 UserExperienceDeactivateEngine(pUserExperience);
3007
3008 hr = SendBAMessage(pUserExperience, message, pvArgs, pvResults);
3009
3010 UserExperienceActivateEngine(pUserExperience);
3011
3012LExit:
3013 return hr;
3014}