aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/elevation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/elevation.cpp')
-rw-r--r--src/burn/engine/elevation.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp
index e30a05bb..adc3aad9 100644
--- a/src/burn/engine/elevation.cpp
+++ b/src/burn/engine/elevation.cpp
@@ -91,7 +91,6 @@ typedef struct _BURN_ELEVATION_LAUNCH_APPROVED_EXE_MESSAGE_CONTEXT
91 91
92typedef struct _BURN_ELEVATION_CHILD_MESSAGE_CONTEXT 92typedef struct _BURN_ELEVATION_CHILD_MESSAGE_CONTEXT
93{ 93{
94 DWORD dwLoggingTlsId;
95 HANDLE hPipe; 94 HANDLE hPipe;
96 HANDLE* phLock; 95 HANDLE* phLock;
97 BOOL* pfDisabledAutomaticUpdates; 96 BOOL* pfDisabledAutomaticUpdates;
@@ -397,10 +396,10 @@ extern "C" HRESULT ElevationElevate(
397 Assert(!pEngineState->companionConnection.dwProcessId); 396 Assert(!pEngineState->companionConnection.dwProcessId);
398 Assert(INVALID_HANDLE_VALUE == pEngineState->companionConnection.hPipe); 397 Assert(INVALID_HANDLE_VALUE == pEngineState->companionConnection.hPipe);
399 Assert(INVALID_HANDLE_VALUE == pEngineState->companionConnection.hCachePipe); 398 Assert(INVALID_HANDLE_VALUE == pEngineState->companionConnection.hCachePipe);
399 Assert(INVALID_HANDLE_VALUE == pEngineState->companionConnection.hLoggingPipe);
400 400
401 HRESULT hr = S_OK; 401 HRESULT hr = S_OK;
402 int nResult = IDOK; 402 int nResult = IDOK;
403 HANDLE hPipesCreatedEvent = INVALID_HANDLE_VALUE;
404 403
405 hr = UserExperienceOnElevateBegin(&pEngineState->userExperience); 404 hr = UserExperienceOnElevateBegin(&pEngineState->userExperience);
406 ExitOnRootFailure(hr, "BA aborted elevation requirement."); 405 ExitOnRootFailure(hr, "BA aborted elevation requirement.");
@@ -408,7 +407,7 @@ extern "C" HRESULT ElevationElevate(
408 hr = PipeCreateNameAndSecret(&pEngineState->companionConnection.sczName, &pEngineState->companionConnection.sczSecret); 407 hr = PipeCreateNameAndSecret(&pEngineState->companionConnection.sczName, &pEngineState->companionConnection.sczSecret);
409 ExitOnFailure(hr, "Failed to create pipe name and client token."); 408 ExitOnFailure(hr, "Failed to create pipe name and client token.");
410 409
411 hr = PipeCreatePipes(&pEngineState->companionConnection, TRUE, &hPipesCreatedEvent); 410 hr = PipeCreatePipes(&pEngineState->companionConnection, TRUE);
412 ExitOnFailure(hr, "Failed to create pipe and cache pipe."); 411 ExitOnFailure(hr, "Failed to create pipe and cache pipe.");
413 412
414 LogId(REPORT_STANDARD, MSG_LAUNCH_ELEVATED_ENGINE_STARTING); 413 LogId(REPORT_STANDARD, MSG_LAUNCH_ELEVATED_ENGINE_STARTING);
@@ -442,8 +441,6 @@ extern "C" HRESULT ElevationElevate(
442 ExitOnFailure(hr, "Failed to elevate."); 441 ExitOnFailure(hr, "Failed to elevate.");
443 442
444LExit: 443LExit:
445 ReleaseHandle(hPipesCreatedEvent);
446
447 if (FAILED(hr)) 444 if (FAILED(hr))
448 { 445 {
449 PipeConnectionUninitialize(&pEngineState->companionConnection); 446 PipeConnectionUninitialize(&pEngineState->companionConnection);
@@ -1532,7 +1529,6 @@ LExit:
1532 1529
1533*******************************************************************/ 1530*******************************************************************/
1534extern "C" HRESULT ElevationChildPumpMessages( 1531extern "C" HRESULT ElevationChildPumpMessages(
1535 __in DWORD dwLoggingTlsId,
1536 __in HANDLE hPipe, 1532 __in HANDLE hPipe,
1537 __in HANDLE hCachePipe, 1533 __in HANDLE hCachePipe,
1538 __in BURN_APPROVED_EXES* pApprovedExes, 1534 __in BURN_APPROVED_EXES* pApprovedExes,
@@ -1556,7 +1552,6 @@ extern "C" HRESULT ElevationChildPumpMessages(
1556 BURN_PIPE_RESULT result = { }; 1552 BURN_PIPE_RESULT result = { };
1557 BOOL fDisabledAutomaticUpdates = FALSE; 1553 BOOL fDisabledAutomaticUpdates = FALSE;
1558 1554
1559 cacheContext.dwLoggingTlsId = dwLoggingTlsId;
1560 cacheContext.hPipe = hCachePipe; 1555 cacheContext.hPipe = hCachePipe;
1561 cacheContext.pCache = pCache; 1556 cacheContext.pCache = pCache;
1562 cacheContext.pContainers = pContainers; 1557 cacheContext.pContainers = pContainers;
@@ -1566,7 +1561,6 @@ extern "C" HRESULT ElevationChildPumpMessages(
1566 cacheContext.pRegistration = pRegistration; 1561 cacheContext.pRegistration = pRegistration;
1567 cacheContext.pUserExperience = pUserExperience; 1562 cacheContext.pUserExperience = pUserExperience;
1568 1563
1569 context.dwLoggingTlsId = dwLoggingTlsId;
1570 context.hPipe = hPipe; 1564 context.hPipe = hPipe;
1571 context.phLock = phLock; 1565 context.phLock = phLock;
1572 context.pfDisabledAutomaticUpdates = &fDisabledAutomaticUpdates; 1566 context.pfDisabledAutomaticUpdates = &fDisabledAutomaticUpdates;
@@ -1660,11 +1654,6 @@ static DWORD WINAPI ElevatedChildCacheThreadProc(
1660 BOOL fComInitialized = FALSE; 1654 BOOL fComInitialized = FALSE;
1661 BURN_PIPE_RESULT result = { }; 1655 BURN_PIPE_RESULT result = { };
1662 1656
1663 if (!::TlsSetValue(pContext->dwLoggingTlsId, pContext->hPipe))
1664 {
1665 ExitWithLastError(hr, "Failed to set elevated cache pipe into thread local storage for logging.");
1666 }
1667
1668 // initialize COM 1657 // initialize COM
1669 hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); 1658 hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
1670 ExitOnFailure(hr, "Failed to initialize COM."); 1659 ExitOnFailure(hr, "Failed to initialize COM.");