Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbar committed Apr 26, 2021
1 parent eb6592e commit a54fc13
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/engine/apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,7 @@ static HRESULT ExecuteMsiCommitTransaction(
}
else
{
hr = MsiEngineCommitTransaction();
hr = MsiEngineCommitTransaction(NULL, NULL, NULL);
}

if (SUCCEEDED(hr))
Expand Down Expand Up @@ -2905,7 +2905,7 @@ static HRESULT ExecuteMsiRollbackTransaction(
}
else
{
hr = MsiEngineRollbackTransaction();
hr = MsiEngineRollbackTransaction(NULL, NULL, NULL);
}

LExit:
Expand Down
19 changes: 2 additions & 17 deletions src/engine/elevation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3045,11 +3045,6 @@ static HRESULT OnMsiBeginTransaction(
ReleaseHandle(hMsiTrnsEvent);
ReleaseMsi(hMsiTrns);

if (pRollbackBoundary)
{
pRollbackBoundary->sczLogPath = NULL;
}

return hr;
}

Expand All @@ -3061,16 +3056,11 @@ static HRESULT OnMsiCommitTransaction(
{
HRESULT hr = S_OK;

hr = MsiEngineCommitTransaction();
hr = MsiEngineCommitTransaction(NULL, NULL, NULL);
ExitOnFailure(hr, "Failed committing an MSI transaction");

LExit:

if (pRollbackBoundary)
{
pRollbackBoundary->sczLogPath = NULL;
}

return hr;
}

Expand All @@ -3082,16 +3072,11 @@ static HRESULT OnMsiRollbackTransaction(
{
HRESULT hr = S_OK;

hr = MsiEngineRollbackTransaction();
hr = MsiEngineRollbackTransaction(NULL, NULL, NULL);
ExitOnFailure(hr, "Failed rolling back an MSI transaction");

LExit:

if (pRollbackBoundary)
{
pRollbackBoundary->sczLogPath = NULL;
}

return hr;
}

Expand Down
32 changes: 21 additions & 11 deletions src/engine/msiengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,15 +1045,28 @@ extern "C" HRESULT MsiEngineBeginTransaction(
}

extern "C" HRESULT MsiEngineCommitTransaction(
__inout MSIHANDLE * phTransactionHandle,
__inout HANDLE * phChangeOfOwnerEvent,
__in_z LPCWSTR szLogPath
)
{
HRESULT hr = S_OK;

hr = WiuEndTransaction(MSITRANSACTIONSTATE_COMMIT, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, NULL);
hr = WiuEndTransaction(MSITRANSACTIONSTATE_COMMIT, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, szLogPath);
ExitOnFailure(hr, "Failed to commit the MSI transaction");

LExit:
if (phChangeOfOwnerEvent && *phChangeOfOwnerEvent && INVALID_HANDLE_VALUE != *phChangeOfOwnerEvent)
{
::CloseHandle(phChangeOfOwnerEvent);
*phChangeOfOwnerEvent = NULL;
}
if (phTransactionHandle && *phTransactionHandle)
{
::MsiCloseHandle(*phTransactionHandle);
*phTransactionHandle = NULL;
}

LExit:
return hr;
}

Expand All @@ -1065,23 +1078,20 @@ extern "C" HRESULT MsiEngineRollbackTransaction(
{
HRESULT hr = S_OK;


hr = WiuEndTransaction(MSITRANSACTIONSTATE_ROLLBACK, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, szLogPath);
ExitOnFailure(hr, "Failed to rollback the MSI transaction");

if (*phTransactionHandle)
if (phChangeOfOwnerEvent && *phChangeOfOwnerEvent && INVALID_HANDLE_VALUE != *phChangeOfOwnerEvent)
{
::MsiCloseHandle(*phTransactionHandle);
*phTransactionHandle = NULL;
::CloseHandle(phChangeOfOwnerEvent);
*phChangeOfOwnerEvent = NULL;
}

if (*phChangeOfOwnerEvent && (*phChangeOfOwnerEvent != INVALID_HANDLE_VALUE))
if (phTransactionHandle && *phTransactionHandle)
{
::CloseHandle(*phChangeOfOwnerEvent);
*phChangeOfOwnerEvent = NULL;
::MsiCloseHandle(*phTransactionHandle);
*phTransactionHandle = NULL;
}


LExit:

return hr;
Expand Down
1 change: 0 additions & 1 deletion src/engine/plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,6 @@ static void ResetPlannedRollbackBoundaryState(
)
{
pRollbackBoundary->fActiveTransaction = FALSE;
ReleaseNullStr(pRollbackBoundary->sczLogPath);
}

static HRESULT GetActionDefaultRequestState(
Expand Down

0 comments on commit a54fc13

Please sign in to comment.