diff options
Diffstat (limited to 'src/burn/engine/elevation.cpp')
-rw-r--r-- | src/burn/engine/elevation.cpp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 85e4b692..db2a82a6 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
@@ -477,7 +477,8 @@ extern "C" HRESULT ElevationSessionBegin( | |||
477 | __in BURN_VARIABLES* pVariables, | 477 | __in BURN_VARIABLES* pVariables, |
478 | __in DWORD dwRegistrationOperations, | 478 | __in DWORD dwRegistrationOperations, |
479 | __in BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction, | 479 | __in BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction, |
480 | __in DWORD64 qwEstimatedSize | 480 | __in DWORD64 qwEstimatedSize, |
481 | __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType | ||
481 | ) | 482 | ) |
482 | { | 483 | { |
483 | HRESULT hr = S_OK; | 484 | HRESULT hr = S_OK; |
@@ -504,6 +505,9 @@ extern "C" HRESULT ElevationSessionBegin( | |||
504 | hr = BuffWriteNumber64(&pbData, &cbData, qwEstimatedSize); | 505 | hr = BuffWriteNumber64(&pbData, &cbData, qwEstimatedSize); |
505 | ExitOnFailure(hr, "Failed to write estimated size to message buffer."); | 506 | ExitOnFailure(hr, "Failed to write estimated size to message buffer."); |
506 | 507 | ||
508 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)registrationType); | ||
509 | ExitOnFailure(hr, "Failed to write registration type to message buffer."); | ||
510 | |||
507 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | 511 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); |
508 | ExitOnFailure(hr, "Failed to write variables."); | 512 | ExitOnFailure(hr, "Failed to write variables."); |
509 | 513 | ||
@@ -527,7 +531,8 @@ extern "C" HRESULT ElevationSessionResume( | |||
527 | __in HANDLE hPipe, | 531 | __in HANDLE hPipe, |
528 | __in_z LPCWSTR wzResumeCommandLine, | 532 | __in_z LPCWSTR wzResumeCommandLine, |
529 | __in BOOL fDisableResume, | 533 | __in BOOL fDisableResume, |
530 | __in BURN_VARIABLES* pVariables | 534 | __in BURN_VARIABLES* pVariables, |
535 | __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType | ||
531 | ) | 536 | ) |
532 | { | 537 | { |
533 | HRESULT hr = S_OK; | 538 | HRESULT hr = S_OK; |
@@ -542,6 +547,9 @@ extern "C" HRESULT ElevationSessionResume( | |||
542 | hr = BuffWriteNumber(&pbData, &cbData, fDisableResume); | 547 | hr = BuffWriteNumber(&pbData, &cbData, fDisableResume); |
543 | ExitOnFailure(hr, "Failed to write resume flag."); | 548 | ExitOnFailure(hr, "Failed to write resume flag."); |
544 | 549 | ||
550 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)registrationType); | ||
551 | ExitOnFailure(hr, "Failed to write registration type to message buffer."); | ||
552 | |||
545 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | 553 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); |
546 | ExitOnFailure(hr, "Failed to write variables."); | 554 | ExitOnFailure(hr, "Failed to write variables."); |
547 | 555 | ||
@@ -565,7 +573,8 @@ extern "C" HRESULT ElevationSessionEnd( | |||
565 | __in HANDLE hPipe, | 573 | __in HANDLE hPipe, |
566 | __in BURN_RESUME_MODE resumeMode, | 574 | __in BURN_RESUME_MODE resumeMode, |
567 | __in BOOTSTRAPPER_APPLY_RESTART restart, | 575 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
568 | __in BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction | 576 | __in BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction, |
577 | __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType | ||
569 | ) | 578 | ) |
570 | { | 579 | { |
571 | HRESULT hr = S_OK; | 580 | HRESULT hr = S_OK; |
@@ -583,6 +592,9 @@ extern "C" HRESULT ElevationSessionEnd( | |||
583 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)dependencyRegistrationAction); | 592 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)dependencyRegistrationAction); |
584 | ExitOnFailure(hr, "Failed to write dependency registration action to message buffer."); | 593 | ExitOnFailure(hr, "Failed to write dependency registration action to message buffer."); |
585 | 594 | ||
595 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)registrationType); | ||
596 | ExitOnFailure(hr, "Failed to write registration type to message buffer."); | ||
597 | |||
586 | // send message | 598 | // send message |
587 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_END, pbData, cbData, NULL, NULL, &dwResult); | 599 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_END, pbData, cbData, NULL, NULL, &dwResult); |
588 | ExitOnFailure(hr, "Failed to send message to per-machine process."); | 600 | ExitOnFailure(hr, "Failed to send message to per-machine process."); |
@@ -2080,6 +2092,7 @@ static HRESULT OnSessionBegin( | |||
2080 | DWORD dwRegistrationOperations = 0; | 2092 | DWORD dwRegistrationOperations = 0; |
2081 | DWORD dwDependencyRegistrationAction = 0; | 2093 | DWORD dwDependencyRegistrationAction = 0; |
2082 | DWORD64 qwEstimatedSize = 0; | 2094 | DWORD64 qwEstimatedSize = 0; |
2095 | DWORD dwRegistrationType = 0; | ||
2083 | 2096 | ||
2084 | // Deserialize message data. | 2097 | // Deserialize message data. |
2085 | hr = BuffReadString(pbData, cbData, &iData, &sczEngineWorkingPath); | 2098 | hr = BuffReadString(pbData, cbData, &iData, &sczEngineWorkingPath); |
@@ -2100,11 +2113,14 @@ static HRESULT OnSessionBegin( | |||
2100 | hr = BuffReadNumber64(pbData, cbData, &iData, &qwEstimatedSize); | 2113 | hr = BuffReadNumber64(pbData, cbData, &iData, &qwEstimatedSize); |
2101 | ExitOnFailure(hr, "Failed to read estimated size."); | 2114 | ExitOnFailure(hr, "Failed to read estimated size."); |
2102 | 2115 | ||
2116 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRegistrationType); | ||
2117 | ExitOnFailure(hr, "Failed to read dependency registration action."); | ||
2118 | |||
2103 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); | 2119 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); |
2104 | ExitOnFailure(hr, "Failed to read variables."); | 2120 | ExitOnFailure(hr, "Failed to read variables."); |
2105 | 2121 | ||
2106 | // Begin session in per-machine process. | 2122 | // Begin session in per-machine process. |
2107 | hr = RegistrationSessionBegin(sczEngineWorkingPath, pRegistration, pVariables, dwRegistrationOperations, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction, qwEstimatedSize); | 2123 | hr = RegistrationSessionBegin(sczEngineWorkingPath, pRegistration, pVariables, dwRegistrationOperations, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction, qwEstimatedSize, (BOOTSTRAPPER_REGISTRATION_TYPE)dwRegistrationType); |
2108 | ExitOnFailure(hr, "Failed to begin registration session."); | 2124 | ExitOnFailure(hr, "Failed to begin registration session."); |
2109 | 2125 | ||
2110 | LExit: | 2126 | LExit: |
@@ -2122,6 +2138,7 @@ static HRESULT OnSessionResume( | |||
2122 | { | 2138 | { |
2123 | HRESULT hr = S_OK; | 2139 | HRESULT hr = S_OK; |
2124 | SIZE_T iData = 0; | 2140 | SIZE_T iData = 0; |
2141 | DWORD dwRegistrationType = 0; | ||
2125 | 2142 | ||
2126 | // Deserialize message data. | 2143 | // Deserialize message data. |
2127 | hr = BuffReadString(pbData, cbData, &iData, &pRegistration->sczResumeCommandLine); | 2144 | hr = BuffReadString(pbData, cbData, &iData, &pRegistration->sczResumeCommandLine); |
@@ -2130,11 +2147,14 @@ static HRESULT OnSessionResume( | |||
2130 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDisableResume); | 2147 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDisableResume); |
2131 | ExitOnFailure(hr, "Failed to read resume flag."); | 2148 | ExitOnFailure(hr, "Failed to read resume flag."); |
2132 | 2149 | ||
2150 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRegistrationType); | ||
2151 | ExitOnFailure(hr, "Failed to read dependency registration action."); | ||
2152 | |||
2133 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); | 2153 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); |
2134 | ExitOnFailure(hr, "Failed to read variables."); | 2154 | ExitOnFailure(hr, "Failed to read variables."); |
2135 | 2155 | ||
2136 | // resume session in per-machine process | 2156 | // resume session in per-machine process |
2137 | hr = RegistrationSessionResume(pRegistration, pVariables); | 2157 | hr = RegistrationSessionResume(pRegistration, pVariables, (BOOTSTRAPPER_REGISTRATION_TYPE)dwRegistrationType); |
2138 | ExitOnFailure(hr, "Failed to resume registration session."); | 2158 | ExitOnFailure(hr, "Failed to resume registration session."); |
2139 | 2159 | ||
2140 | LExit: | 2160 | LExit: |
@@ -2154,6 +2174,7 @@ static HRESULT OnSessionEnd( | |||
2154 | DWORD dwResumeMode = 0; | 2174 | DWORD dwResumeMode = 0; |
2155 | DWORD dwRestart = 0; | 2175 | DWORD dwRestart = 0; |
2156 | DWORD dwDependencyRegistrationAction = 0; | 2176 | DWORD dwDependencyRegistrationAction = 0; |
2177 | DWORD dwRegistrationType = 0; | ||
2157 | 2178 | ||
2158 | // Deserialize message data. | 2179 | // Deserialize message data. |
2159 | hr = BuffReadNumber(pbData, cbData, &iData, &dwResumeMode); | 2180 | hr = BuffReadNumber(pbData, cbData, &iData, &dwResumeMode); |
@@ -2165,8 +2186,11 @@ static HRESULT OnSessionEnd( | |||
2165 | hr = BuffReadNumber(pbData, cbData, &iData, &dwDependencyRegistrationAction); | 2186 | hr = BuffReadNumber(pbData, cbData, &iData, &dwDependencyRegistrationAction); |
2166 | ExitOnFailure(hr, "Failed to read dependency registration action."); | 2187 | ExitOnFailure(hr, "Failed to read dependency registration action."); |
2167 | 2188 | ||
2189 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRegistrationType); | ||
2190 | ExitOnFailure(hr, "Failed to read dependency registration action."); | ||
2191 | |||
2168 | // suspend session in per-machine process | 2192 | // suspend session in per-machine process |
2169 | hr = RegistrationSessionEnd(pRegistration, pVariables, pPackages, (BURN_RESUME_MODE)dwResumeMode, (BOOTSTRAPPER_APPLY_RESTART)dwRestart, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction); | 2193 | hr = RegistrationSessionEnd(pRegistration, pVariables, pPackages, (BURN_RESUME_MODE)dwResumeMode, (BOOTSTRAPPER_APPLY_RESTART)dwRestart, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction, (BOOTSTRAPPER_REGISTRATION_TYPE)dwRegistrationType); |
2170 | ExitOnFailure(hr, "Failed to suspend registration session."); | 2194 | ExitOnFailure(hr, "Failed to suspend registration session."); |
2171 | 2195 | ||
2172 | LExit: | 2196 | LExit: |