diff options
Diffstat (limited to 'src/engine/elevation.cpp')
-rw-r--r-- | src/engine/elevation.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index e4af1840..c9ed9810 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp | |||
@@ -855,6 +855,9 @@ extern "C" HRESULT ElevationExecuteMsiPackage( | |||
855 | DWORD dwResult = 0; | 855 | DWORD dwResult = 0; |
856 | 856 | ||
857 | // serialize message data | 857 | // serialize message data |
858 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fRollback); | ||
859 | ExitOnFailure(hr, "Failed to write rollback flag to message buffer."); | ||
860 | |||
858 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->msiPackage.pPackage->sczId); | 861 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->msiPackage.pPackage->sczId); |
859 | ExitOnFailure(hr, "Failed to write package id to message buffer."); | 862 | ExitOnFailure(hr, "Failed to write package id to message buffer."); |
860 | 863 | ||
@@ -886,16 +889,15 @@ extern "C" HRESULT ElevationExecuteMsiPackage( | |||
886 | // Slipstream patches actions. | 889 | // Slipstream patches actions. |
887 | for (DWORD i = 0; i < pExecuteAction->msiPackage.pPackage->Msi.cSlipstreamMspPackages; ++i) | 890 | for (DWORD i = 0; i < pExecuteAction->msiPackage.pPackage->Msi.cSlipstreamMspPackages; ++i) |
888 | { | 891 | { |
889 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.rgSlipstreamPatches[i]); | 892 | BURN_SLIPSTREAM_MSP* pSlipstreamMsp = pExecuteAction->msiPackage.pPackage->Msi.rgSlipstreamMsps + i; |
893 | BOOTSTRAPPER_ACTION_STATE* pAction = fRollback ? &pSlipstreamMsp->rollback : &pSlipstreamMsp->execute; | ||
894 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)*pAction); | ||
890 | ExitOnFailure(hr, "Failed to write slipstream patch action to message buffer."); | 895 | ExitOnFailure(hr, "Failed to write slipstream patch action to message buffer."); |
891 | } | 896 | } |
892 | 897 | ||
893 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | 898 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); |
894 | ExitOnFailure(hr, "Failed to write variables."); | 899 | ExitOnFailure(hr, "Failed to write variables."); |
895 | 900 | ||
896 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fRollback); | ||
897 | ExitOnFailure(hr, "Failed to write rollback flag to message buffer."); | ||
898 | |||
899 | 901 | ||
900 | // send message | 902 | // send message |
901 | context.pfnMessageHandler = pfnMessageHandler; | 903 | context.pfnMessageHandler = pfnMessageHandler; |
@@ -2263,6 +2265,9 @@ static HRESULT OnExecuteMsiPackage( | |||
2263 | executeAction.type = BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE; | 2265 | executeAction.type = BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE; |
2264 | 2266 | ||
2265 | // Deserialize message data. | 2267 | // Deserialize message data. |
2268 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&fRollback); | ||
2269 | ExitOnFailure(hr, "Failed to read rollback flag."); | ||
2270 | |||
2266 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); | 2271 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); |
2267 | ExitOnFailure(hr, "Failed to read MSI package id."); | 2272 | ExitOnFailure(hr, "Failed to read MSI package id."); |
2268 | 2273 | ||
@@ -2303,12 +2308,11 @@ static HRESULT OnExecuteMsiPackage( | |||
2303 | // Read slipstream patches actions. | 2308 | // Read slipstream patches actions. |
2304 | if (executeAction.msiPackage.pPackage->Msi.cSlipstreamMspPackages) | 2309 | if (executeAction.msiPackage.pPackage->Msi.cSlipstreamMspPackages) |
2305 | { | 2310 | { |
2306 | executeAction.msiPackage.rgSlipstreamPatches = (BOOTSTRAPPER_ACTION_STATE*)MemAlloc(executeAction.msiPackage.pPackage->Msi.cSlipstreamMspPackages * sizeof(BOOTSTRAPPER_ACTION_STATE), TRUE); | ||
2307 | ExitOnNull(executeAction.msiPackage.rgSlipstreamPatches, hr, E_OUTOFMEMORY, "Failed to allocate memory for slipstream patch actions."); | ||
2308 | |||
2309 | for (DWORD i = 0; i < executeAction.msiPackage.pPackage->Msi.cSlipstreamMspPackages; ++i) | 2311 | for (DWORD i = 0; i < executeAction.msiPackage.pPackage->Msi.cSlipstreamMspPackages; ++i) |
2310 | { | 2312 | { |
2311 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.rgSlipstreamPatches[i]); | 2313 | BURN_SLIPSTREAM_MSP* pSlipstreamMsp = executeAction.msiPackage.pPackage->Msi.rgSlipstreamMsps + i; |
2314 | BOOTSTRAPPER_ACTION_STATE* pAction = fRollback ? &pSlipstreamMsp->rollback : &pSlipstreamMsp->execute; | ||
2315 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)pAction); | ||
2312 | ExitOnFailure(hr, "Failed to read slipstream action."); | 2316 | ExitOnFailure(hr, "Failed to read slipstream action."); |
2313 | } | 2317 | } |
2314 | } | 2318 | } |
@@ -2316,9 +2320,6 @@ static HRESULT OnExecuteMsiPackage( | |||
2316 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); | 2320 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); |
2317 | ExitOnFailure(hr, "Failed to read variables."); | 2321 | ExitOnFailure(hr, "Failed to read variables."); |
2318 | 2322 | ||
2319 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&fRollback); | ||
2320 | ExitOnFailure(hr, "Failed to read rollback flag."); | ||
2321 | |||
2322 | // Execute MSI package. | 2323 | // Execute MSI package. |
2323 | hr = MsiEngineExecutePackage(hwndParent, &executeAction, pVariables, fRollback, MsiExecuteMessageHandler, hPipe, &msiRestart); | 2324 | hr = MsiEngineExecutePackage(hwndParent, &executeAction, pVariables, fRollback, MsiExecuteMessageHandler, hPipe, &msiRestart); |
2324 | ExitOnFailure(hr, "Failed to execute MSI package."); | 2325 | ExitOnFailure(hr, "Failed to execute MSI package."); |