diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-04-22 16:57:18 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-04-23 15:40:21 -0500 |
| commit | 0ee63890d8eacd044115524476eb9419114500a7 (patch) | |
| tree | 63f7794f98a6438d29b8aae881c20c4de583a1a2 /src/burn/engine/elevation.cpp | |
| parent | a981e29d7a3df566754356c3fe1eb938a5cac4c1 (diff) | |
| download | wix-0ee63890d8eacd044115524476eb9419114500a7.tar.gz wix-0ee63890d8eacd044115524476eb9419114500a7.tar.bz2 wix-0ee63890d8eacd044115524476eb9419114500a7.zip | |
Always reset the system component status when registering the bundle.
Finishes 4454
Diffstat (limited to 'src/burn/engine/elevation.cpp')
| -rw-r--r-- | src/burn/engine/elevation.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 3305cf62..d2c5c8c6 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
| @@ -11,7 +11,6 @@ typedef enum _BURN_ELEVATION_MESSAGE_TYPE | |||
| 11 | BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE, | 11 | BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE, |
| 12 | BURN_ELEVATION_MESSAGE_TYPE_APPLY_UNINITIALIZE, | 12 | BURN_ELEVATION_MESSAGE_TYPE_APPLY_UNINITIALIZE, |
| 13 | BURN_ELEVATION_MESSAGE_TYPE_SESSION_BEGIN, | 13 | BURN_ELEVATION_MESSAGE_TYPE_SESSION_BEGIN, |
| 14 | BURN_ELEVATION_MESSAGE_TYPE_SESSION_RESUME, | ||
| 15 | BURN_ELEVATION_MESSAGE_TYPE_SESSION_END, | 14 | BURN_ELEVATION_MESSAGE_TYPE_SESSION_END, |
| 16 | BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE, | 15 | BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE, |
| 17 | BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE, | 16 | BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE, |
| @@ -195,12 +194,6 @@ static HRESULT OnSessionBegin( | |||
| 195 | __in BYTE* pbData, | 194 | __in BYTE* pbData, |
| 196 | __in SIZE_T cbData | 195 | __in SIZE_T cbData |
| 197 | ); | 196 | ); |
| 198 | static HRESULT OnSessionResume( | ||
| 199 | __in BURN_REGISTRATION* pRegistration, | ||
| 200 | __in BURN_VARIABLES* pVariables, | ||
| 201 | __in BYTE* pbData, | ||
| 202 | __in SIZE_T cbData | ||
| 203 | ); | ||
| 204 | static HRESULT OnSessionEnd( | 197 | static HRESULT OnSessionEnd( |
| 205 | __in BURN_CACHE* pCache, | 198 | __in BURN_CACHE* pCache, |
| 206 | __in BURN_PACKAGES* pPackages, | 199 | __in BURN_PACKAGES* pPackages, |
| @@ -586,48 +579,6 @@ LExit: | |||
| 586 | } | 579 | } |
| 587 | 580 | ||
| 588 | /******************************************************************* | 581 | /******************************************************************* |
| 589 | ElevationSessionResume - | ||
| 590 | |||
| 591 | *******************************************************************/ | ||
| 592 | extern "C" HRESULT ElevationSessionResume( | ||
| 593 | __in HANDLE hPipe, | ||
| 594 | __in_z LPCWSTR wzResumeCommandLine, | ||
| 595 | __in BOOL fDisableResume, | ||
| 596 | __in BURN_VARIABLES* pVariables, | ||
| 597 | __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType | ||
| 598 | ) | ||
| 599 | { | ||
| 600 | HRESULT hr = S_OK; | ||
| 601 | BYTE* pbData = NULL; | ||
| 602 | SIZE_T cbData = 0; | ||
| 603 | DWORD dwResult = 0; | ||
| 604 | |||
| 605 | // serialize message data | ||
| 606 | hr = BuffWriteString(&pbData, &cbData, wzResumeCommandLine); | ||
| 607 | ExitOnFailure(hr, "Failed to write resume command line to message buffer."); | ||
| 608 | |||
| 609 | hr = BuffWriteNumber(&pbData, &cbData, fDisableResume); | ||
| 610 | ExitOnFailure(hr, "Failed to write resume flag."); | ||
| 611 | |||
| 612 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)registrationType); | ||
| 613 | ExitOnFailure(hr, "Failed to write registration type to message buffer."); | ||
| 614 | |||
| 615 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | ||
| 616 | ExitOnFailure(hr, "Failed to write variables."); | ||
| 617 | |||
| 618 | // send message | ||
| 619 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_RESUME, pbData, cbData, NULL, NULL, &dwResult); | ||
| 620 | ExitOnFailure(hr, "Failed to send message to per-machine process."); | ||
| 621 | |||
| 622 | hr = (HRESULT)dwResult; | ||
| 623 | |||
| 624 | LExit: | ||
| 625 | ReleaseBuffer(pbData); | ||
| 626 | |||
| 627 | return hr; | ||
| 628 | } | ||
| 629 | |||
| 630 | /******************************************************************* | ||
| 631 | ElevationSessionEnd - | 582 | ElevationSessionEnd - |
| 632 | 583 | ||
| 633 | *******************************************************************/ | 584 | *******************************************************************/ |
| @@ -2174,10 +2125,6 @@ static HRESULT ProcessElevatedChildMessage( | |||
| 2174 | hrResult = OnSessionBegin(pContext->pCache, pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData); | 2125 | hrResult = OnSessionBegin(pContext->pCache, pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData); |
| 2175 | break; | 2126 | break; |
| 2176 | 2127 | ||
| 2177 | case BURN_ELEVATION_MESSAGE_TYPE_SESSION_RESUME: | ||
| 2178 | hrResult = OnSessionResume(pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData); | ||
| 2179 | break; | ||
| 2180 | |||
| 2181 | case BURN_ELEVATION_MESSAGE_TYPE_SESSION_END: | 2128 | case BURN_ELEVATION_MESSAGE_TYPE_SESSION_END: |
| 2182 | hrResult = OnSessionEnd(pContext->pCache, pContext->pPackages, pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData); | 2129 | hrResult = OnSessionEnd(pContext->pCache, pContext->pPackages, pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData); |
| 2183 | break; | 2130 | break; |
| @@ -2539,38 +2486,6 @@ LExit: | |||
| 2539 | return hr; | 2486 | return hr; |
| 2540 | } | 2487 | } |
| 2541 | 2488 | ||
| 2542 | static HRESULT OnSessionResume( | ||
| 2543 | __in BURN_REGISTRATION* pRegistration, | ||
| 2544 | __in BURN_VARIABLES* pVariables, | ||
| 2545 | __in BYTE* pbData, | ||
| 2546 | __in SIZE_T cbData | ||
| 2547 | ) | ||
| 2548 | { | ||
| 2549 | HRESULT hr = S_OK; | ||
| 2550 | SIZE_T iData = 0; | ||
| 2551 | DWORD dwRegistrationType = 0; | ||
| 2552 | |||
| 2553 | // Deserialize message data. | ||
| 2554 | hr = BuffReadString(pbData, cbData, &iData, &pRegistration->sczResumeCommandLine); | ||
| 2555 | ExitOnFailure(hr, "Failed to read resume command line."); | ||
| 2556 | |||
| 2557 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDisableResume); | ||
| 2558 | ExitOnFailure(hr, "Failed to read resume flag."); | ||
| 2559 | |||
| 2560 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRegistrationType); | ||
| 2561 | ExitOnFailure(hr, "Failed to read dependency registration action."); | ||
| 2562 | |||
| 2563 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); | ||
| 2564 | ExitOnFailure(hr, "Failed to read variables."); | ||
| 2565 | |||
| 2566 | // resume session in per-machine process | ||
| 2567 | hr = RegistrationSessionResume(pRegistration, pVariables, (BOOTSTRAPPER_REGISTRATION_TYPE)dwRegistrationType); | ||
| 2568 | ExitOnFailure(hr, "Failed to resume registration session."); | ||
| 2569 | |||
| 2570 | LExit: | ||
| 2571 | return hr; | ||
| 2572 | } | ||
| 2573 | |||
| 2574 | static HRESULT OnSessionEnd( | 2489 | static HRESULT OnSessionEnd( |
| 2575 | __in BURN_CACHE* pCache, | 2490 | __in BURN_CACHE* pCache, |
| 2576 | __in BURN_PACKAGES* pPackages, | 2491 | __in BURN_PACKAGES* pPackages, |
