diff options
Diffstat (limited to 'src/engine/msiengine.cpp')
| -rw-r--r-- | src/engine/msiengine.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/engine/msiengine.cpp b/src/engine/msiengine.cpp index b056cb7e..c298e219 100644 --- a/src/engine/msiengine.cpp +++ b/src/engine/msiengine.cpp | |||
| @@ -1147,18 +1147,30 @@ extern "C" HRESULT MsiEngineBeginTransaction( | |||
| 1147 | MSIHANDLE hTransactionHandle = NULL; | 1147 | MSIHANDLE hTransactionHandle = NULL; |
| 1148 | HANDLE hChangeOfOwnerEvent = NULL; | 1148 | HANDLE hChangeOfOwnerEvent = NULL; |
| 1149 | 1149 | ||
| 1150 | LogId(REPORT_STANDARD, MSG_MSI_TRANSACTION_BEGIN, wzName); | ||
| 1151 | |||
| 1150 | uResult = ::MsiBeginTransaction(wzName, 0, &hTransactionHandle, &hChangeOfOwnerEvent); | 1152 | uResult = ::MsiBeginTransaction(wzName, 0, &hTransactionHandle, &hChangeOfOwnerEvent); |
| 1153 | |||
| 1154 | if (ERROR_ROLLBACK_DISABLED == uResult) | ||
| 1155 | { | ||
| 1156 | LogId(REPORT_ERROR, MSG_MSI_TRANSACTIONS_DISABLED); | ||
| 1157 | } | ||
| 1158 | |||
| 1151 | ExitOnWin32Error(uResult, hr, "Failed to begin an MSI transaction"); | 1159 | ExitOnWin32Error(uResult, hr, "Failed to begin an MSI transaction"); |
| 1152 | 1160 | ||
| 1153 | LExit: | 1161 | LExit: |
| 1154 | return hr; | 1162 | return hr; |
| 1155 | } | 1163 | } |
| 1156 | 1164 | ||
| 1157 | extern "C" HRESULT MsiEngineCommitTransaction() | 1165 | extern "C" HRESULT MsiEngineCommitTransaction( |
| 1166 | __in LPCWSTR wzName | ||
| 1167 | ) | ||
| 1158 | { | 1168 | { |
| 1159 | HRESULT hr = S_OK; | 1169 | HRESULT hr = S_OK; |
| 1160 | UINT uResult = ERROR_SUCCESS; | 1170 | UINT uResult = ERROR_SUCCESS; |
| 1161 | 1171 | ||
| 1172 | LogId(REPORT_STANDARD, MSG_MSI_TRANSACTION_COMMIT, wzName); | ||
| 1173 | |||
| 1162 | uResult = ::MsiEndTransaction(MSITRANSACTIONSTATE_COMMIT); | 1174 | uResult = ::MsiEndTransaction(MSITRANSACTIONSTATE_COMMIT); |
| 1163 | ExitOnWin32Error(uResult, hr, "Failed to commit the MSI transaction"); | 1175 | ExitOnWin32Error(uResult, hr, "Failed to commit the MSI transaction"); |
| 1164 | 1176 | ||
| @@ -1167,11 +1179,15 @@ LExit: | |||
| 1167 | return hr; | 1179 | return hr; |
| 1168 | } | 1180 | } |
| 1169 | 1181 | ||
| 1170 | extern "C" HRESULT MsiEngineRollbackTransaction() | 1182 | extern "C" HRESULT MsiEngineRollbackTransaction( |
| 1183 | __in LPCWSTR wzName | ||
| 1184 | ) | ||
| 1171 | { | 1185 | { |
| 1172 | HRESULT hr = S_OK; | 1186 | HRESULT hr = S_OK; |
| 1173 | UINT uResult = ERROR_SUCCESS; | 1187 | UINT uResult = ERROR_SUCCESS; |
| 1174 | 1188 | ||
| 1189 | LogId(REPORT_WARNING, MSG_MSI_TRANSACTION_ROLLBACK, wzName); | ||
| 1190 | |||
| 1175 | uResult = ::MsiEndTransaction(MSITRANSACTIONSTATE_ROLLBACK); | 1191 | uResult = ::MsiEndTransaction(MSITRANSACTIONSTATE_ROLLBACK); |
| 1176 | ExitOnWin32Error(uResult, hr, "Failed to rollback the MSI transaction"); | 1192 | ExitOnWin32Error(uResult, hr, "Failed to rollback the MSI transaction"); |
| 1177 | 1193 | ||
