diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/apply.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index e62db4d2..f3821769 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
| @@ -82,7 +82,8 @@ static HRESULT ApplyLayoutBundle( | |||
| 82 | __in BURN_CACHE_CONTEXT* pContext, | 82 | __in BURN_CACHE_CONTEXT* pContext, |
| 83 | __in BURN_PAYLOAD_GROUP* pPayloads, | 83 | __in BURN_PAYLOAD_GROUP* pPayloads, |
| 84 | __in_z LPCWSTR wzExecutableName, | 84 | __in_z LPCWSTR wzExecutableName, |
| 85 | __in_z LPCWSTR wzUnverifiedPath | 85 | __in_z LPCWSTR wzUnverifiedPath, |
| 86 | __in DWORD64 qwBundleSize | ||
| 86 | ); | 87 | ); |
| 87 | static HRESULT ApplyLayoutContainer( | 88 | static HRESULT ApplyLayoutContainer( |
| 88 | __in BURN_CACHE_CONTEXT* pContext, | 89 | __in BURN_CACHE_CONTEXT* pContext, |
| @@ -100,7 +101,8 @@ static HRESULT ExtractContainer( | |||
| 100 | static HRESULT LayoutBundle( | 101 | static HRESULT LayoutBundle( |
| 101 | __in BURN_CACHE_CONTEXT* pContext, | 102 | __in BURN_CACHE_CONTEXT* pContext, |
| 102 | __in_z LPCWSTR wzExecutableName, | 103 | __in_z LPCWSTR wzExecutableName, |
| 103 | __in_z LPCWSTR wzUnverifiedPath | 104 | __in_z LPCWSTR wzUnverifiedPath, |
| 105 | __in DWORD64 qwBundleSize | ||
| 104 | ); | 106 | ); |
| 105 | static HRESULT ApplyAcquireContainerOrPayload( | 107 | static HRESULT ApplyAcquireContainerOrPayload( |
| 106 | __in BURN_CACHE_CONTEXT* pContext, | 108 | __in BURN_CACHE_CONTEXT* pContext, |
| @@ -504,7 +506,7 @@ extern "C" HRESULT ApplyCache( | |||
| 504 | break; | 506 | break; |
| 505 | 507 | ||
| 506 | case BURN_CACHE_ACTION_TYPE_LAYOUT_BUNDLE: | 508 | case BURN_CACHE_ACTION_TYPE_LAYOUT_BUNDLE: |
| 507 | hr = ApplyLayoutBundle(&cacheContext, pCacheAction->bundleLayout.pPayloadGroup, pCacheAction->bundleLayout.sczExecutableName, pCacheAction->bundleLayout.sczUnverifiedPath); | 509 | hr = ApplyLayoutBundle(&cacheContext, pCacheAction->bundleLayout.pPayloadGroup, pCacheAction->bundleLayout.sczExecutableName, pCacheAction->bundleLayout.sczUnverifiedPath, pCacheAction->bundleLayout.qwBundleSize); |
| 508 | ExitOnFailure(hr, "Failed cache action: %ls", L"layout bundle"); | 510 | ExitOnFailure(hr, "Failed cache action: %ls", L"layout bundle"); |
| 509 | 511 | ||
| 510 | ++(*pcOverallProgressTicks); | 512 | ++(*pcOverallProgressTicks); |
| @@ -866,12 +868,13 @@ static HRESULT ApplyLayoutBundle( | |||
| 866 | __in BURN_CACHE_CONTEXT* pContext, | 868 | __in BURN_CACHE_CONTEXT* pContext, |
| 867 | __in BURN_PAYLOAD_GROUP* pPayloads, | 869 | __in BURN_PAYLOAD_GROUP* pPayloads, |
| 868 | __in_z LPCWSTR wzExecutableName, | 870 | __in_z LPCWSTR wzExecutableName, |
| 869 | __in_z LPCWSTR wzUnverifiedPath | 871 | __in_z LPCWSTR wzUnverifiedPath, |
| 872 | __in DWORD64 qwBundleSize | ||
| 870 | ) | 873 | ) |
| 871 | { | 874 | { |
| 872 | HRESULT hr = S_OK; | 875 | HRESULT hr = S_OK; |
| 873 | 876 | ||
| 874 | hr = LayoutBundle(pContext, wzExecutableName, wzUnverifiedPath); | 877 | hr = LayoutBundle(pContext, wzExecutableName, wzUnverifiedPath, qwBundleSize); |
| 875 | ExitOnFailure(hr, "Failed to layout bundle."); | 878 | ExitOnFailure(hr, "Failed to layout bundle."); |
| 876 | 879 | ||
| 877 | for (DWORD i = 0; i < pPayloads->cPayloads; ++i) | 880 | for (DWORD i = 0; i < pPayloads->cPayloads; ++i) |
| @@ -1073,7 +1076,8 @@ LExit: | |||
| 1073 | static HRESULT LayoutBundle( | 1076 | static HRESULT LayoutBundle( |
| 1074 | __in BURN_CACHE_CONTEXT* pContext, | 1077 | __in BURN_CACHE_CONTEXT* pContext, |
| 1075 | __in_z LPCWSTR wzExecutableName, | 1078 | __in_z LPCWSTR wzExecutableName, |
| 1076 | __in_z LPCWSTR wzUnverifiedPath | 1079 | __in_z LPCWSTR wzUnverifiedPath, |
| 1080 | __in DWORD64 qwBundleSize | ||
| 1077 | ) | 1081 | ) |
| 1078 | { | 1082 | { |
| 1079 | HRESULT hr = S_OK; | 1083 | HRESULT hr = S_OK; |
| @@ -1107,6 +1111,8 @@ static HRESULT LayoutBundle( | |||
| 1107 | 1111 | ||
| 1108 | if (CSTR_EQUAL == nEquivalentPaths && FileExistsEx(sczDestinationPath, NULL)) | 1112 | if (CSTR_EQUAL == nEquivalentPaths && FileExistsEx(sczDestinationPath, NULL)) |
| 1109 | { | 1113 | { |
| 1114 | // TODO: send Acquire and Verify messages to BA? | ||
| 1115 | pContext->qwSuccessfulCacheProgress += 2 * qwBundleSize; | ||
| 1110 | ExitFunction1(hr = S_OK); | 1116 | ExitFunction1(hr = S_OK); |
| 1111 | } | 1117 | } |
| 1112 | 1118 | ||
| @@ -1128,6 +1134,12 @@ static HRESULT LayoutBundle( | |||
| 1128 | hr = CopyPayload(&progress, pContext->hSourceEngineFile, sczBundlePath, wzUnverifiedPath); | 1134 | hr = CopyPayload(&progress, pContext->hSourceEngineFile, sczBundlePath, wzUnverifiedPath); |
| 1129 | // Error handling happens after sending complete message to BA. | 1135 | // Error handling happens after sending complete message to BA. |
| 1130 | 1136 | ||
| 1137 | // If succeeded, send 100% complete here to make sure progress was sent to the BA. | ||
| 1138 | if (SUCCEEDED(hr)) | ||
| 1139 | { | ||
| 1140 | hr = CompleteCacheProgress(&progress, qwBundleSize); | ||
| 1141 | } | ||
| 1142 | |||
| 1131 | UserExperienceOnCacheAcquireComplete(pContext->pUX, NULL, NULL, hr, &fRetryAcquire); | 1143 | UserExperienceOnCacheAcquireComplete(pContext->pUX, NULL, NULL, hr, &fRetryAcquire); |
| 1132 | if (fRetryAcquire) | 1144 | if (fRetryAcquire) |
| 1133 | { | 1145 | { |
| @@ -1163,9 +1175,16 @@ static HRESULT LayoutBundle( | |||
| 1163 | fRetry = TRUE; // go back and retry acquire. | 1175 | fRetry = TRUE; // go back and retry acquire. |
| 1164 | } | 1176 | } |
| 1165 | } while (S_FALSE == hr); | 1177 | } while (S_FALSE == hr); |
| 1178 | |||
| 1179 | if (fRetry) | ||
| 1180 | { | ||
| 1181 | pContext->qwSuccessfulCacheProgress -= qwBundleSize; | ||
| 1182 | } | ||
| 1166 | } while (fRetry); | 1183 | } while (fRetry); |
| 1167 | LogExitOnFailure(hr, MSG_FAILED_LAYOUT_BUNDLE, "Failed to layout bundle: %ls to layout directory: %ls", sczBundlePath, pContext->wzLayoutDirectory); | 1184 | LogExitOnFailure(hr, MSG_FAILED_LAYOUT_BUNDLE, "Failed to layout bundle: %ls to layout directory: %ls", sczBundlePath, pContext->wzLayoutDirectory); |
| 1168 | 1185 | ||
| 1186 | pContext->qwSuccessfulCacheProgress += qwBundleSize; | ||
| 1187 | |||
| 1169 | LExit: | 1188 | LExit: |
| 1170 | ReleaseStr(sczDestinationPath); | 1189 | ReleaseStr(sczDestinationPath); |
| 1171 | ReleaseStr(sczBundleDownloadUrl); | 1190 | ReleaseStr(sczBundleDownloadUrl); |
