diff options
Diffstat (limited to 'src/balutil/inc')
-rw-r--r-- | src/balutil/inc/BAFunctions.h | 2 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBAFunctions.h | 23 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBAFunctionsProc.h | 2 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBootstrapperApplication.h | 36 | ||||
-rw-r--r-- | src/balutil/inc/BalBaseBootstrapperApplicationProc.h | 16 | ||||
-rw-r--r-- | src/balutil/inc/IBootstrapperApplication.h | 50 | ||||
-rw-r--r-- | src/balutil/inc/balretry.h | 37 |
7 files changed, 107 insertions, 59 deletions
diff --git a/src/balutil/inc/BAFunctions.h b/src/balutil/inc/BAFunctions.h index 66852efa..07f7a750 100644 --- a/src/balutil/inc/BAFunctions.h +++ b/src/balutil/inc/BAFunctions.h | |||
@@ -42,7 +42,7 @@ enum BA_FUNCTIONS_MESSAGE | |||
42 | BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, | 42 | BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN, |
43 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, | 43 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN, |
44 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, | 44 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS, |
45 | BA_FUNCTIONS_MESSAGE_ONRESOLVESOURCE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE, | 45 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING, |
46 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, | 46 | BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE, |
47 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, | 47 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN, |
48 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, | 48 | BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE, |
diff --git a/src/balutil/inc/BalBaseBAFunctions.h b/src/balutil/inc/BalBaseBAFunctions.h index 0164269c..ca727f49 100644 --- a/src/balutil/inc/BalBaseBAFunctions.h +++ b/src/balutil/inc/BalBaseBAFunctions.h | |||
@@ -90,6 +90,7 @@ public: // IBootstrapperApplication | |||
90 | } | 90 | } |
91 | 91 | ||
92 | virtual STDMETHODIMP OnDetectBegin( | 92 | virtual STDMETHODIMP OnDetectBegin( |
93 | __in BOOL /*fCached*/, | ||
93 | __in BOOL /*fInstalled*/, | 94 | __in BOOL /*fInstalled*/, |
94 | __in DWORD /*cPackages*/, | 95 | __in DWORD /*cPackages*/, |
95 | __inout BOOL* /*pfCancel*/ | 96 | __inout BOOL* /*pfCancel*/ |
@@ -385,8 +386,11 @@ public: // IBootstrapperApplication | |||
385 | virtual STDMETHODIMP OnCacheAcquireBegin( | 386 | virtual STDMETHODIMP OnCacheAcquireBegin( |
386 | __in_z LPCWSTR /*wzPackageOrContainerId*/, | 387 | __in_z LPCWSTR /*wzPackageOrContainerId*/, |
387 | __in_z_opt LPCWSTR /*wzPayloadId*/, | 388 | __in_z_opt LPCWSTR /*wzPayloadId*/, |
388 | __in BOOTSTRAPPER_CACHE_OPERATION /*operation*/, | ||
389 | __in_z LPCWSTR /*wzSource*/, | 389 | __in_z LPCWSTR /*wzSource*/, |
390 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
391 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
392 | __in BOOTSTRAPPER_CACHE_OPERATION /*recommendation*/, | ||
393 | __inout BOOTSTRAPPER_CACHE_OPERATION* /*pAction*/, | ||
390 | __inout BOOL* /*pfCancel*/ | 394 | __inout BOOL* /*pfCancel*/ |
391 | ) | 395 | ) |
392 | { | 396 | { |
@@ -405,13 +409,18 @@ public: // IBootstrapperApplication | |||
405 | return S_OK; | 409 | return S_OK; |
406 | } | 410 | } |
407 | 411 | ||
408 | virtual STDMETHODIMP OnResolveSource( | 412 | virtual STDMETHODIMP OnCacheAcquireResolving( |
409 | __in_z LPCWSTR /*wzPackageOrContainerId*/, | 413 | __in_z_opt LPCWSTR /*wzPackageOrContainerId*/, |
410 | __in_z_opt LPCWSTR /*wzPayloadId*/, | 414 | __in_z_opt LPCWSTR /*wzPayloadId*/, |
411 | __in_z LPCWSTR /*wzLocalSource*/, | 415 | __in_z LPCWSTR* /*rgSearchPaths*/, |
412 | __in_z_opt LPCWSTR /*wzDownloadSource*/, | 416 | __in DWORD /*cSearchPaths*/, |
413 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION /*recommendation*/, | 417 | __in BOOL /*fFoundLocal*/, |
414 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* /*pAction*/, | 418 | __in DWORD /*dwRecommendedSearchPath*/, |
419 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
420 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
421 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/, | ||
422 | __inout DWORD* /*pdwChosenSearchPath*/, | ||
423 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* /*pAction*/, | ||
415 | __inout BOOL* /*pfCancel*/ | 424 | __inout BOOL* /*pfCancel*/ |
416 | ) | 425 | ) |
417 | { | 426 | { |
diff --git a/src/balutil/inc/BalBaseBAFunctionsProc.h b/src/balutil/inc/BalBaseBAFunctionsProc.h index e1de800a..7e89fe83 100644 --- a/src/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/balutil/inc/BalBaseBAFunctionsProc.h | |||
@@ -77,7 +77,7 @@ static HRESULT WINAPI BalBaseBAFunctionsProc( | |||
77 | case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN: | 77 | case BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN: |
78 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN: | 78 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN: |
79 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS: | 79 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS: |
80 | case BA_FUNCTIONS_MESSAGE_ONRESOLVESOURCE: | 80 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING: |
81 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE: | 81 | case BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE: |
82 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN: | 82 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN: |
83 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE: | 83 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE: |
diff --git a/src/balutil/inc/BalBaseBootstrapperApplication.h b/src/balutil/inc/BalBaseBootstrapperApplication.h index c9211e0f..3d3e4ffa 100644 --- a/src/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/balutil/inc/BalBaseBootstrapperApplication.h | |||
@@ -87,6 +87,7 @@ public: // IBootstrapperApplication | |||
87 | } | 87 | } |
88 | 88 | ||
89 | virtual STDMETHODIMP OnDetectBegin( | 89 | virtual STDMETHODIMP OnDetectBegin( |
90 | __in BOOL /*fCached*/, | ||
90 | __in BOOL /*fInstalled*/, | 91 | __in BOOL /*fInstalled*/, |
91 | __in DWORD /*cPackages*/, | 92 | __in DWORD /*cPackages*/, |
92 | __inout BOOL* pfCancel | 93 | __inout BOOL* pfCancel |
@@ -442,14 +443,17 @@ public: // IBootstrapperApplication | |||
442 | } | 443 | } |
443 | 444 | ||
444 | virtual STDMETHODIMP OnCacheAcquireBegin( | 445 | virtual STDMETHODIMP OnCacheAcquireBegin( |
445 | __in_z LPCWSTR wzPackageOrContainerId, | 446 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
446 | __in_z_opt LPCWSTR wzPayloadId, | 447 | __in_z_opt LPCWSTR wzPayloadId, |
447 | __in BOOTSTRAPPER_CACHE_OPERATION /*operation*/, | ||
448 | __in_z LPCWSTR /*wzSource*/, | 448 | __in_z LPCWSTR /*wzSource*/, |
449 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
450 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
451 | __in BOOTSTRAPPER_CACHE_OPERATION /*recommendation*/, | ||
452 | __inout BOOTSTRAPPER_CACHE_OPERATION* /*pAction*/, | ||
449 | __inout BOOL* pfCancel | 453 | __inout BOOL* pfCancel |
450 | ) | 454 | ) |
451 | { | 455 | { |
452 | BalRetryStartPackage(BALRETRY_TYPE_CACHE, wzPackageOrContainerId, wzPayloadId); | 456 | BalRetryStartContainerOrPayload(wzPackageOrContainerId, wzPayloadId); |
453 | *pfCancel |= CheckCanceled(); | 457 | *pfCancel |= CheckCanceled(); |
454 | return S_OK; | 458 | return S_OK; |
455 | } | 459 | } |
@@ -488,13 +492,18 @@ public: // IBootstrapperApplication | |||
488 | return hr; | 492 | return hr; |
489 | } | 493 | } |
490 | 494 | ||
491 | virtual STDMETHODIMP OnResolveSource( | 495 | virtual STDMETHODIMP OnCacheAcquireResolving( |
492 | __in_z LPCWSTR /*wzPackageOrContainerId*/, | 496 | __in_z_opt LPCWSTR /*wzPackageOrContainerId*/, |
493 | __in_z_opt LPCWSTR /*wzPayloadId*/, | 497 | __in_z_opt LPCWSTR /*wzPayloadId*/, |
494 | __in_z LPCWSTR /*wzLocalSource*/, | 498 | __in_z LPCWSTR* /*rgSearchPaths*/, |
495 | __in_z_opt LPCWSTR /*wzDownloadSource*/, | 499 | __in DWORD /*cSearchPaths*/, |
496 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION /*recommendation*/, | 500 | __in BOOL /*fFoundLocal*/, |
497 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* /*pAction*/, | 501 | __in DWORD /*dwRecommendedSearchPath*/, |
502 | __in_z_opt LPCWSTR /*wzDownloadUrl*/, | ||
503 | __in_z_opt LPCWSTR /*wzPayloadContainerId*/, | ||
504 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/, | ||
505 | __inout DWORD* /*pdwChosenSearchPath*/, | ||
506 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* /*pAction*/, | ||
498 | __inout BOOL* pfCancel | 507 | __inout BOOL* pfCancel |
499 | ) | 508 | ) |
500 | { | 509 | { |
@@ -518,7 +527,7 @@ public: // IBootstrapperApplication | |||
518 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); | 527 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); |
519 | } | 528 | } |
520 | 529 | ||
521 | hr = BalRetryEndPackage(BALRETRY_TYPE_CACHE, wzPackageOrContainerId, wzPayloadId, hrStatus, &fRetry); | 530 | hr = BalRetryEndContainerOrPayload(wzPackageOrContainerId, wzPayloadId, hrStatus, &fRetry); |
522 | ExitOnFailure(hr, "BalRetryEndPackage for cache failed"); | 531 | ExitOnFailure(hr, "BalRetryEndPackage for cache failed"); |
523 | 532 | ||
524 | if (fRetry) | 533 | if (fRetry) |
@@ -599,7 +608,7 @@ public: // IBootstrapperApplication | |||
599 | // Only track retry on execution (not rollback). | 608 | // Only track retry on execution (not rollback). |
600 | if (fExecute) | 609 | if (fExecute) |
601 | { | 610 | { |
602 | BalRetryStartPackage(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL); | 611 | BalRetryStartPackage(wzPackageId); |
603 | } | 612 | } |
604 | 613 | ||
605 | m_fRollingBack = !fExecute; | 614 | m_fRollingBack = !fExecute; |
@@ -700,7 +709,7 @@ public: // IBootstrapperApplication | |||
700 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); | 709 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); |
701 | } | 710 | } |
702 | 711 | ||
703 | hr = BalRetryEndPackage(BALRETRY_TYPE_EXECUTE, wzPackageId, NULL, hrStatus, &fRetry); | 712 | hr = BalRetryEndPackage(wzPackageId, hrStatus, &fRetry); |
704 | ExitOnFailure(hr, "BalRetryEndPackage for execute failed"); | 713 | ExitOnFailure(hr, "BalRetryEndPackage for execute failed"); |
705 | 714 | ||
706 | if (fRetry) | 715 | if (fRetry) |
@@ -951,6 +960,9 @@ protected: | |||
951 | m_fApplying = FALSE; | 960 | m_fApplying = FALSE; |
952 | m_fRollingBack = FALSE; | 961 | m_fRollingBack = FALSE; |
953 | 962 | ||
963 | m_dwProgressPercentage = 0; | ||
964 | m_dwOverallProgressPercentage = 0; | ||
965 | |||
954 | BalRetryInitialize(dwRetryCount, dwRetryTimeout); | 966 | BalRetryInitialize(dwRetryCount, dwRetryTimeout); |
955 | } | 967 | } |
956 | 968 | ||
diff --git a/src/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/balutil/inc/BalBaseBootstrapperApplicationProc.h index d8a6590b..42ffeb79 100644 --- a/src/balutil/inc/BalBaseBootstrapperApplicationProc.h +++ b/src/balutil/inc/BalBaseBootstrapperApplicationProc.h | |||
@@ -15,7 +15,7 @@ static HRESULT BalBaseBAProcOnDetectBegin( | |||
15 | __inout BA_ONDETECTBEGIN_RESULTS* pResults | 15 | __inout BA_ONDETECTBEGIN_RESULTS* pResults |
16 | ) | 16 | ) |
17 | { | 17 | { |
18 | return pBA->OnDetectBegin(pArgs->fInstalled, pArgs->cPackages, &pResults->fCancel); | 18 | return pBA->OnDetectBegin(pArgs->fCached, pArgs->fInstalled, pArgs->cPackages, &pResults->fCancel); |
19 | } | 19 | } |
20 | 20 | ||
21 | static HRESULT BalBaseBAProcOnDetectComplete( | 21 | static HRESULT BalBaseBAProcOnDetectComplete( |
@@ -303,7 +303,7 @@ static HRESULT BalBaseBAProcOnCacheAcquireBegin( | |||
303 | __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults | 303 | __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults |
304 | ) | 304 | ) |
305 | { | 305 | { |
306 | return pBA->OnCacheAcquireBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->operation, pArgs->wzSource, &pResults->fCancel); | 306 | return pBA->OnCacheAcquireBegin(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzSource, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->action, &pResults->fCancel); |
307 | } | 307 | } |
308 | 308 | ||
309 | static HRESULT BalBaseBAProcOnCacheAcquireProgress( | 309 | static HRESULT BalBaseBAProcOnCacheAcquireProgress( |
@@ -315,13 +315,13 @@ static HRESULT BalBaseBAProcOnCacheAcquireProgress( | |||
315 | return pBA->OnCacheAcquireProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel); | 315 | return pBA->OnCacheAcquireProgress(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->dw64Progress, pArgs->dw64Total, pArgs->dwOverallPercentage, &pResults->fCancel); |
316 | } | 316 | } |
317 | 317 | ||
318 | static HRESULT BalBaseBAProcOnResolveSource( | 318 | static HRESULT BalBaseBAProcOnCacheAcquireResolving( |
319 | __in IBootstrapperApplication* pBA, | 319 | __in IBootstrapperApplication* pBA, |
320 | __in BA_ONRESOLVESOURCE_ARGS* pArgs, | 320 | __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs, |
321 | __inout BA_ONRESOLVESOURCE_RESULTS* pResults | 321 | __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults |
322 | ) | 322 | ) |
323 | { | 323 | { |
324 | return pBA->OnResolveSource(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->wzLocalSource, pArgs->wzDownloadSource, pArgs->recommendation, &pResults->action, &pResults->fCancel); | 324 | return pBA->OnCacheAcquireResolving(pArgs->wzPackageOrContainerId, pArgs->wzPayloadId, pArgs->rgSearchPaths, pArgs->cSearchPaths, pArgs->fFoundLocal, pArgs->dwRecommendedSearchPath, pArgs->wzDownloadUrl, pArgs->wzPayloadContainerId, pArgs->recommendation, &pResults->dwChosenSearchPath, &pResults->action, &pResults->fCancel); |
325 | } | 325 | } |
326 | 326 | ||
327 | static HRESULT BalBaseBAProcOnCacheAcquireComplete( | 327 | static HRESULT BalBaseBAProcOnCacheAcquireComplete( |
@@ -713,8 +713,8 @@ static HRESULT WINAPI BalBaseBootstrapperApplicationProc( | |||
713 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: | 713 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS: |
714 | hr = BalBaseBAProcOnCacheAcquireProgress(pBA, reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults)); | 714 | hr = BalBaseBAProcOnCacheAcquireProgress(pBA, reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults)); |
715 | break; | 715 | break; |
716 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONRESOLVESOURCE: | 716 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING: |
717 | hr = BalBaseBAProcOnResolveSource(pBA, reinterpret_cast<BA_ONRESOLVESOURCE_ARGS*>(pvArgs), reinterpret_cast<BA_ONRESOLVESOURCE_RESULTS*>(pvResults)); | 717 | hr = BalBaseBAProcOnCacheAcquireResolving(pBA, reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_RESULTS*>(pvResults)); |
718 | break; | 718 | break; |
719 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: | 719 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE: |
720 | hr = BalBaseBAProcOnCacheAcquireComplete(pBA, reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults)); | 720 | hr = BalBaseBAProcOnCacheAcquireComplete(pBA, reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults)); |
diff --git a/src/balutil/inc/IBootstrapperApplication.h b/src/balutil/inc/IBootstrapperApplication.h index ed70d8fe..8fcdd318 100644 --- a/src/balutil/inc/IBootstrapperApplication.h +++ b/src/balutil/inc/IBootstrapperApplication.h | |||
@@ -21,6 +21,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
21 | 21 | ||
22 | // OnDetectBegin - called when the engine begins detection. | 22 | // OnDetectBegin - called when the engine begins detection. |
23 | STDMETHOD(OnDetectBegin)( | 23 | STDMETHOD(OnDetectBegin)( |
24 | __in BOOL fCached, | ||
24 | __in BOOL fInstalled, | 25 | __in BOOL fInstalled, |
25 | __in DWORD cPackages, | 26 | __in DWORD cPackages, |
26 | __inout BOOL* pfCancel | 27 | __inout BOOL* pfCancel |
@@ -279,14 +280,20 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
279 | __inout BOOL* pfCancel | 280 | __inout BOOL* pfCancel |
280 | ) = 0; | 281 | ) = 0; |
281 | 282 | ||
282 | // OnCacheAcquireBegin - called when the engine begins copying or | 283 | // OnCacheAcquireBegin - called when the engine begins acquiring a payload or container. |
283 | // downloading a payload to the working folder. | 284 | // |
285 | // Notes: | ||
286 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | ||
287 | // to update the source location before returning. | ||
284 | // | 288 | // |
285 | STDMETHOD(OnCacheAcquireBegin)( | 289 | STDMETHOD(OnCacheAcquireBegin)( |
286 | __in_z_opt LPCWSTR wzPackageOrContainerId, | 290 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
287 | __in_z_opt LPCWSTR wzPayloadId, | 291 | __in_z_opt LPCWSTR wzPayloadId, |
288 | __in BOOTSTRAPPER_CACHE_OPERATION operation, | ||
289 | __in_z LPCWSTR wzSource, | 292 | __in_z LPCWSTR wzSource, |
293 | __in_z_opt LPCWSTR wzDownloadUrl, | ||
294 | __in_z_opt LPCWSTR wzPayloadContainerId, | ||
295 | __in BOOTSTRAPPER_CACHE_OPERATION recommendation, | ||
296 | __inout BOOTSTRAPPER_CACHE_OPERATION* pAction, | ||
290 | __inout BOOL* pfCancel | 297 | __inout BOOL* pfCancel |
291 | ) = 0; | 298 | ) = 0; |
292 | 299 | ||
@@ -302,27 +309,38 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
302 | __inout BOOL* pfCancel | 309 | __inout BOOL* pfCancel |
303 | ) = 0; | 310 | ) = 0; |
304 | 311 | ||
305 | // OnResolveSource - called when a payload or container cannot be found locally. | 312 | // OnCacheAcquireResolving - called to allow the BA to override the acquisition action for the payload or container. |
306 | // | 313 | // |
307 | // Parameters: | 314 | // Parameters: |
315 | // wzPackageOrContainerId will be NULL when resolving a layout-only payload. | ||
308 | // wzPayloadId will be NULL when resolving a container. | 316 | // wzPayloadId will be NULL when resolving a container. |
309 | // wzDownloadSource will be NULL if the container or payload does not provide a DownloadURL. | 317 | // wzDownloadUrl will be NULL if the container or payload does not provide a DownloadURL. |
318 | // wzPayloadContainerId will not be NULL if acquiring a payload that is in a container. | ||
310 | // | 319 | // |
311 | // Notes: | 320 | // rgSearchPaths are the search paths used for source resolution. |
312 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | 321 | // fFoundLocal is TRUE when dwRecommendedSearchPath indicates that the file was found. |
313 | // to update the source location before returning BOOTSTRAPPER_RESOLVESOURCE_ACTION_RETRY or BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD. | 322 | // dwRecommendedSearchPath is the index into rgSearchPaths for the recommended local file. |
314 | STDMETHOD(OnResolveSource)( | 323 | // |
315 | __in_z LPCWSTR wzPackageOrContainerId, | 324 | STDMETHOD(OnCacheAcquireResolving)( |
325 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
316 | __in_z_opt LPCWSTR wzPayloadId, | 326 | __in_z_opt LPCWSTR wzPayloadId, |
317 | __in_z LPCWSTR wzLocalSource, | 327 | __in_z LPCWSTR* rgSearchPaths, |
318 | __in_z_opt LPCWSTR wzDownloadSource, | 328 | __in DWORD cSearchPaths, |
319 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION recommendation, | 329 | __in BOOL fFoundLocal, |
320 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* pAction, | 330 | __in DWORD dwRecommendedSearchPath, |
331 | __in_z_opt LPCWSTR wzDownloadUrl, | ||
332 | __in_z_opt LPCWSTR wzPayloadContainerId, | ||
333 | __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION recommendation, | ||
334 | __inout DWORD* pdwChosenSearchPath, | ||
335 | __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pAction, | ||
321 | __inout BOOL* pfCancel | 336 | __inout BOOL* pfCancel |
322 | ) = 0; | 337 | ) = 0; |
323 | 338 | ||
324 | // OnCacheAcquireComplete - called after the engine copied or downloaded | 339 | // OnCacheAcquireComplete - called after the engine acquired the payload or container. |
325 | // a payload to the working folder. | 340 | // |
341 | // Notes: | ||
342 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | ||
343 | // to update the source location before returning BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION_RETRY. | ||
326 | // | 344 | // |
327 | STDMETHOD(OnCacheAcquireComplete)( | 345 | STDMETHOD(OnCacheAcquireComplete)( |
328 | __in_z_opt LPCWSTR wzPackageOrContainerId, | 346 | __in_z_opt LPCWSTR wzPackageOrContainerId, |
diff --git a/src/balutil/inc/balretry.h b/src/balutil/inc/balretry.h index 040ab4ae..35282a7e 100644 --- a/src/balutil/inc/balretry.h +++ b/src/balutil/inc/balretry.h | |||
@@ -6,12 +6,6 @@ | |||
6 | extern "C" { | 6 | extern "C" { |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | typedef enum BALRETRY_TYPE | ||
10 | { | ||
11 | BALRETRY_TYPE_CACHE, | ||
12 | BALRETRY_TYPE_EXECUTE, | ||
13 | } BALRETRY_TYPE; | ||
14 | |||
15 | /******************************************************************* | 9 | /******************************************************************* |
16 | BalRetryInitialize - initialize the retry count and timeout between | 10 | BalRetryInitialize - initialize the retry count and timeout between |
17 | retries (in milliseconds). | 11 | retries (in milliseconds). |
@@ -33,9 +27,7 @@ DAPI_(void) BalRetryUninitialize(); | |||
33 | wait the specified timeout. | 27 | wait the specified timeout. |
34 | ********************************************************************/ | 28 | ********************************************************************/ |
35 | DAPI_(void) BalRetryStartPackage( | 29 | DAPI_(void) BalRetryStartPackage( |
36 | __in BALRETRY_TYPE type, | 30 | __in_z LPCWSTR wzPackageId |
37 | __in_z_opt LPCWSTR wzPackageId, | ||
38 | __in_z_opt LPCWSTR wzPayloadId | ||
39 | ); | 31 | ); |
40 | 32 | ||
41 | /******************************************************************* | 33 | /******************************************************************* |
@@ -43,17 +35,34 @@ DAPI_(void) BalRetryStartPackage( | |||
43 | to consider. | 35 | to consider. |
44 | ********************************************************************/ | 36 | ********************************************************************/ |
45 | DAPI_(void) BalRetryErrorOccurred( | 37 | DAPI_(void) BalRetryErrorOccurred( |
46 | __in_z_opt LPCWSTR wzPackageId, | 38 | __in_z LPCWSTR wzPackageId, |
47 | __in DWORD dwError | 39 | __in DWORD dwError |
48 | ); | 40 | ); |
49 | 41 | ||
50 | /******************************************************************* | 42 | /******************************************************************* |
51 | BalRetryEndPackage - returns IDRETRY is a retry is recommended or | 43 | BalRetryEndPackage - returns TRUE if a retry is recommended. |
52 | IDNOACTION if a retry is not recommended. | ||
53 | ********************************************************************/ | 44 | ********************************************************************/ |
54 | DAPI_(HRESULT) BalRetryEndPackage( | 45 | DAPI_(HRESULT) BalRetryEndPackage( |
55 | __in BALRETRY_TYPE type, | 46 | __in_z LPCWSTR wzPackageId, |
56 | __in_z_opt LPCWSTR wzPackageId, | 47 | __in HRESULT hrError, |
48 | __inout BOOL* pfRetry | ||
49 | ); | ||
50 | |||
51 | /******************************************************************* | ||
52 | BalRetryStartContainerOrPayload - call when a container or payload | ||
53 | begins to be acquired. If the target is being retried, | ||
54 | the function will wait the specified timeout. | ||
55 | ********************************************************************/ | ||
56 | DAPI_(void) BalRetryStartContainerOrPayload( | ||
57 | __in_z_opt LPCWSTR wzContainerOrPackageId, | ||
58 | __in_z_opt LPCWSTR wzPayloadId | ||
59 | ); | ||
60 | |||
61 | /******************************************************************* | ||
62 | BalRetryEndContainerOrPayload - returns TRUE if a retry is recommended. | ||
63 | ********************************************************************/ | ||
64 | DAPI_(HRESULT) BalRetryEndContainerOrPayload( | ||
65 | __in_z_opt LPCWSTR wzContainerOrPackageId, | ||
57 | __in_z_opt LPCWSTR wzPayloadId, | 66 | __in_z_opt LPCWSTR wzPayloadId, |
58 | __in HRESULT hrError, | 67 | __in HRESULT hrError, |
59 | __inout BOOL* pfRetry | 68 | __inout BOOL* pfRetry |