diff options
Diffstat (limited to 'src/burn/engine/apply.cpp')
-rw-r--r-- | src/burn/engine/apply.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index e5b978f1..dd99a5cd 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp | |||
@@ -2333,6 +2333,8 @@ static HRESULT DoExecuteAction( | |||
2333 | 2333 | ||
2334 | HRESULT hr = S_OK; | 2334 | HRESULT hr = S_OK; |
2335 | HANDLE rghWait[2] = { }; | 2335 | HANDLE rghWait[2] = { }; |
2336 | DWORD dwSignaledIndex = 0; | ||
2337 | DWORD dwExitCode = 0; | ||
2336 | BOOTSTRAPPER_APPLY_RESTART restart = BOOTSTRAPPER_APPLY_RESTART_NONE; | 2338 | BOOTSTRAPPER_APPLY_RESTART restart = BOOTSTRAPPER_APPLY_RESTART_NONE; |
2337 | BOOL fRetry = FALSE; | 2339 | BOOL fRetry = FALSE; |
2338 | BOOL fStopWusaService = FALSE; | 2340 | BOOL fStopWusaService = FALSE; |
@@ -2356,27 +2358,23 @@ static HRESULT DoExecuteAction( | |||
2356 | // wait for cache sync-point | 2358 | // wait for cache sync-point |
2357 | rghWait[0] = pExecuteAction->waitCachePackage.pPackage->hCacheEvent; | 2359 | rghWait[0] = pExecuteAction->waitCachePackage.pPackage->hCacheEvent; |
2358 | rghWait[1] = pContext->pApplyContext->hCacheThread; | 2360 | rghWait[1] = pContext->pApplyContext->hCacheThread; |
2359 | switch (::WaitForMultipleObjects(rghWait[1] ? 2 : 1, rghWait, FALSE, INFINITE)) | 2361 | |
2362 | hr = AppWaitForMultipleObjects(rghWait[1] ? 2 : 1, rghWait, FALSE, INFINITE, &dwSignaledIndex); | ||
2363 | ExitOnFailure(hr, "Failed to wait for cache check-point."); | ||
2364 | |||
2365 | switch (dwSignaledIndex) | ||
2360 | { | 2366 | { |
2361 | case WAIT_OBJECT_0: | 2367 | case 0: |
2362 | break; | 2368 | break; |
2363 | 2369 | case 1: | |
2364 | case WAIT_OBJECT_0 + 1: | 2370 | if (!::GetExitCodeThread(pContext->pApplyContext->hCacheThread, &dwExitCode)) |
2365 | if (!::GetExitCodeThread(pContext->pApplyContext->hCacheThread, (DWORD*)&hr)) | ||
2366 | { | 2371 | { |
2367 | ExitWithLastError(hr, "Failed to get cache thread exit code."); | 2372 | ExitWithLastError(hr, "Failed to get cache thread exit code."); |
2368 | } | 2373 | } |
2369 | 2374 | ||
2370 | if (SUCCEEDED(hr)) | 2375 | ExitWithRootFailure(hr, E_UNEXPECTED, "Cache thread exited unexpectedly with exit code: %u.", dwExitCode); |
2371 | { | ||
2372 | hr = E_UNEXPECTED; | ||
2373 | } | ||
2374 | ExitOnFailure(hr, "Cache thread exited unexpectedly."); | ||
2375 | |||
2376 | case WAIT_FAILED: __fallthrough; | ||
2377 | default: | ||
2378 | ExitWithLastError(hr, "Failed to wait for cache check-point."); | ||
2379 | } | 2376 | } |
2377 | |||
2380 | break; | 2378 | break; |
2381 | 2379 | ||
2382 | case BURN_EXECUTE_ACTION_TYPE_RELATED_BUNDLE: | 2380 | case BURN_EXECUTE_ACTION_TYPE_RELATED_BUNDLE: |