diff options
Diffstat (limited to '')
| -rw-r--r-- | src/burn/engine/elevation.cpp | 24 | ||||
| -rw-r--r-- | src/burn/engine/elevation.h | 1 | ||||
| -rw-r--r-- | src/burn/engine/engine.cpp | 8 |
3 files changed, 20 insertions, 13 deletions
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index ef9c6e97..e30a05bb 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
| @@ -189,7 +189,8 @@ static HRESULT ElevatedProcessDetect( | |||
| 189 | ); | 189 | ); |
| 190 | static HRESULT OnApplyUninitialize( | 190 | static HRESULT OnApplyUninitialize( |
| 191 | __in HANDLE* phLock, | 191 | __in HANDLE* phLock, |
| 192 | __in BOOL* pfApplying | 192 | __in BOOL* pfApplying, |
| 193 | __in BOOL* pfDisabledAutomaticUpdates | ||
| 193 | ); | 194 | ); |
| 194 | static HRESULT OnSessionBegin( | 195 | static HRESULT OnSessionBegin( |
| 195 | __in BURN_CACHE* pCache, | 196 | __in BURN_CACHE* pCache, |
| @@ -1543,7 +1544,6 @@ extern "C" HRESULT ElevationChildPumpMessages( | |||
| 1543 | __in BURN_REGISTRATION* pRegistration, | 1544 | __in BURN_REGISTRATION* pRegistration, |
| 1544 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1545 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 1545 | __out HANDLE* phLock, | 1546 | __out HANDLE* phLock, |
| 1546 | __out BOOL* pfDisabledAutomaticUpdates, | ||
| 1547 | __out DWORD* pdwChildExitCode, | 1547 | __out DWORD* pdwChildExitCode, |
| 1548 | __out BOOL* pfRestart, | 1548 | __out BOOL* pfRestart, |
| 1549 | __out BOOL* pfApplying | 1549 | __out BOOL* pfApplying |
| @@ -1554,6 +1554,7 @@ extern "C" HRESULT ElevationChildPumpMessages( | |||
| 1554 | BURN_ELEVATION_CHILD_MESSAGE_CONTEXT context = { }; | 1554 | BURN_ELEVATION_CHILD_MESSAGE_CONTEXT context = { }; |
| 1555 | HANDLE hCacheThread = NULL; | 1555 | HANDLE hCacheThread = NULL; |
| 1556 | BURN_PIPE_RESULT result = { }; | 1556 | BURN_PIPE_RESULT result = { }; |
| 1557 | BOOL fDisabledAutomaticUpdates = FALSE; | ||
| 1557 | 1558 | ||
| 1558 | cacheContext.dwLoggingTlsId = dwLoggingTlsId; | 1559 | cacheContext.dwLoggingTlsId = dwLoggingTlsId; |
| 1559 | cacheContext.hPipe = hCachePipe; | 1560 | cacheContext.hPipe = hCachePipe; |
| @@ -1568,7 +1569,7 @@ extern "C" HRESULT ElevationChildPumpMessages( | |||
| 1568 | context.dwLoggingTlsId = dwLoggingTlsId; | 1569 | context.dwLoggingTlsId = dwLoggingTlsId; |
| 1569 | context.hPipe = hPipe; | 1570 | context.hPipe = hPipe; |
| 1570 | context.phLock = phLock; | 1571 | context.phLock = phLock; |
| 1571 | context.pfDisabledAutomaticUpdates = pfDisabledAutomaticUpdates; | 1572 | context.pfDisabledAutomaticUpdates = &fDisabledAutomaticUpdates; |
| 1572 | context.pfApplying = pfApplying; | 1573 | context.pfApplying = pfApplying; |
| 1573 | context.pApprovedExes = pApprovedExes; | 1574 | context.pApprovedExes = pApprovedExes; |
| 1574 | context.pCache = pCache; | 1575 | context.pCache = pCache; |
| @@ -1595,6 +1596,11 @@ extern "C" HRESULT ElevationChildPumpMessages( | |||
| 1595 | LExit: | 1596 | LExit: |
| 1596 | ReleaseHandle(hCacheThread); | 1597 | ReleaseHandle(hCacheThread); |
| 1597 | 1598 | ||
| 1599 | if (fDisabledAutomaticUpdates) | ||
| 1600 | { | ||
| 1601 | ElevationChildResumeAutomaticUpdates(); | ||
| 1602 | } | ||
| 1603 | |||
| 1598 | return hr; | 1604 | return hr; |
| 1599 | } | 1605 | } |
| 1600 | 1606 | ||
| @@ -2128,7 +2134,7 @@ static HRESULT ProcessElevatedChildMessage( | |||
| 2128 | break; | 2134 | break; |
| 2129 | 2135 | ||
| 2130 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_UNINITIALIZE: | 2136 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_UNINITIALIZE: |
| 2131 | hrResult = OnApplyUninitialize(pContext->phLock, pContext->pfApplying); | 2137 | hrResult = OnApplyUninitialize(pContext->phLock, pContext->pfApplying, pContext->pfDisabledAutomaticUpdates); |
| 2132 | break; | 2138 | break; |
| 2133 | 2139 | ||
| 2134 | case BURN_ELEVATION_MESSAGE_TYPE_SESSION_BEGIN: | 2140 | case BURN_ELEVATION_MESSAGE_TYPE_SESSION_BEGIN: |
| @@ -2433,7 +2439,8 @@ LExit: | |||
| 2433 | 2439 | ||
| 2434 | static HRESULT OnApplyUninitialize( | 2440 | static HRESULT OnApplyUninitialize( |
| 2435 | __in HANDLE* phLock, | 2441 | __in HANDLE* phLock, |
| 2436 | __in BOOL* pfApplying | 2442 | __in BOOL* pfApplying, |
| 2443 | __in BOOL* pfDisabledAutomaticUpdates | ||
| 2437 | ) | 2444 | ) |
| 2438 | { | 2445 | { |
| 2439 | Assert(phLock); | 2446 | Assert(phLock); |
| @@ -2442,6 +2449,13 @@ static HRESULT OnApplyUninitialize( | |||
| 2442 | 2449 | ||
| 2443 | *pfApplying = FALSE; | 2450 | *pfApplying = FALSE; |
| 2444 | 2451 | ||
| 2452 | if (*pfDisabledAutomaticUpdates) | ||
| 2453 | { | ||
| 2454 | *pfDisabledAutomaticUpdates = FALSE; | ||
| 2455 | |||
| 2456 | ElevationChildResumeAutomaticUpdates(); | ||
| 2457 | } | ||
| 2458 | |||
| 2445 | if (*phLock) | 2459 | if (*phLock) |
| 2446 | { | 2460 | { |
| 2447 | ::ReleaseMutex(*phLock); | 2461 | ::ReleaseMutex(*phLock); |
diff --git a/src/burn/engine/elevation.h b/src/burn/engine/elevation.h index d08d2edc..bda0fdef 100644 --- a/src/burn/engine/elevation.h +++ b/src/burn/engine/elevation.h | |||
| @@ -178,7 +178,6 @@ HRESULT ElevationChildPumpMessages( | |||
| 178 | __in BURN_REGISTRATION* pRegistration, | 178 | __in BURN_REGISTRATION* pRegistration, |
| 179 | __in BURN_USER_EXPERIENCE* pUserExperience, | 179 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 180 | __out HANDLE* phLock, | 180 | __out HANDLE* phLock, |
| 181 | __out BOOL* pfDisabledAutomaticUpdates, | ||
| 182 | __out DWORD* pdwChildExitCode, | 181 | __out DWORD* pdwChildExitCode, |
| 183 | __out BOOL* pfRestart, | 182 | __out BOOL* pfRestart, |
| 184 | __out BOOL* pfApplying | 183 | __out BOOL* pfApplying |
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index 334ea23b..2d2da1d5 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp | |||
| @@ -638,7 +638,6 @@ static HRESULT RunElevated( | |||
| 638 | { | 638 | { |
| 639 | HRESULT hr = S_OK; | 639 | HRESULT hr = S_OK; |
| 640 | HANDLE hLock = NULL; | 640 | HANDLE hLock = NULL; |
| 641 | BOOL fDisabledAutomaticUpdates = FALSE; | ||
| 642 | 641 | ||
| 643 | // connect to per-user process | 642 | // connect to per-user process |
| 644 | hr = PipeChildConnect(&pEngineState->companionConnection, TRUE); | 643 | hr = PipeChildConnect(&pEngineState->companionConnection, TRUE); |
| @@ -666,7 +665,7 @@ static HRESULT RunElevated( | |||
| 666 | SrpInitialize(TRUE); | 665 | SrpInitialize(TRUE); |
| 667 | 666 | ||
| 668 | // Pump messages from parent process. | 667 | // Pump messages from parent process. |
| 669 | hr = ElevationChildPumpMessages(pEngineState->dwElevatedLoggingTlsId, pEngineState->companionConnection.hPipe, pEngineState->companionConnection.hCachePipe, &pEngineState->approvedExes, &pEngineState->cache, &pEngineState->containers, &pEngineState->packages, &pEngineState->payloads, &pEngineState->variables, &pEngineState->registration, &pEngineState->userExperience, &hLock, &fDisabledAutomaticUpdates, &pEngineState->userExperience.dwExitCode, &pEngineState->fRestart, &pEngineState->plan.fApplying); | 668 | hr = ElevationChildPumpMessages(pEngineState->dwElevatedLoggingTlsId, pEngineState->companionConnection.hPipe, pEngineState->companionConnection.hCachePipe, &pEngineState->approvedExes, &pEngineState->cache, &pEngineState->containers, &pEngineState->packages, &pEngineState->payloads, &pEngineState->variables, &pEngineState->registration, &pEngineState->userExperience, &hLock, &pEngineState->userExperience.dwExitCode, &pEngineState->fRestart, &pEngineState->plan.fApplying); |
| 670 | LogRedirect(NULL, NULL); // reset logging so the next failure gets written to "log buffer" for the failure log. | 669 | LogRedirect(NULL, NULL); // reset logging so the next failure gets written to "log buffer" for the failure log. |
| 671 | ExitOnFailure(hr, "Failed to pump messages from parent process."); | 670 | ExitOnFailure(hr, "Failed to pump messages from parent process."); |
| 672 | 671 | ||
| @@ -676,11 +675,6 @@ LExit: | |||
| 676 | // If the message window is still around, close it. | 675 | // If the message window is still around, close it. |
| 677 | UiCloseMessageWindow(pEngineState); | 676 | UiCloseMessageWindow(pEngineState); |
| 678 | 677 | ||
| 679 | if (fDisabledAutomaticUpdates) | ||
| 680 | { | ||
| 681 | ElevationChildResumeAutomaticUpdates(); | ||
| 682 | } | ||
| 683 | |||
| 684 | if (hLock) | 678 | if (hLock) |
| 685 | { | 679 | { |
| 686 | ::ReleaseMutex(hLock); | 680 | ::ReleaseMutex(hLock); |
