@joebigelow / wix-1 / commits / 8ed8ca07

Don't close handles from MsiBeginTransaction.

Assume that MsiEndTransaction must be called exactly once for each MsiBeginTransaction. Fixes 6695

Sean Hall committed Mar 14, 2022 at 15:20 UTC 8ed8ca0721e08ea953f4751086c4845c98551c46
2 files changed +4 -7
src/burn/engine/apply.cpp
+3 -5
@@ -3123,12 +3123,10 @@ static HRESULT ExecuteMsiCommitTransaction(
3123 hr = MsiEngineCommitTransaction(pRollbackBoundary);
3124 }
3125
3126 - if (SUCCEEDED(hr))
3127 - {
3128 - pRollbackBoundary->fActiveTransaction = FALSE;
3126 + // Assume that MsiEndTransaction can only be called once for each MsiBeginTransaction.
3127 + pRollbackBoundary->fActiveTransaction = FALSE;
3128
3130 - ResetTransactionRegistrationState(pEngineState, TRUE);
3131 - }
3129 + ResetTransactionRegistrationState(pEngineState, TRUE);
3130
3131 LExit:
3132 if (fCommitBeginCalled)
src/burn/engine/msiengine.cpp
+1 -2
@@ -1129,8 +1129,7 @@ extern "C" HRESULT MsiEngineBeginTransaction(
1129 ExitOnFailure(hr, "Failed to begin an MSI transaction");
1130
1131 LExit:
1132 - ReleaseMsi(hTransactionHandle);
1133 - ReleaseHandle(hChangeOfOwnerEvent);
1132 + // Assume that MsiEndTransaction cleans up the handles.
1133
1134 return hr;
1135 }