From: James Harper Date: Sun, 18 Oct 2009 09:00:39 +0000 (+0200) Subject: fix crash on exchange restore fail X-Git-Tag: Release-5.0.0~282^2~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c6e0b5d36e08c57e8a0a2e0212c800b4d8454da;p=bacula%2Fbacula fix crash on exchange restore fail --- diff --git a/bacula/src/win32/filed/plugins/api.c b/bacula/src/win32/filed/plugins/api.c index cde58e5f8c..1efb35b488 100644 --- a/bacula/src/win32/filed/plugins/api.c +++ b/bacula/src/win32/filed/plugins/api.c @@ -135,6 +135,8 @@ ESEErrorMessage(HRESULT result) return "Exchange backup already in progress."; case hrLogfileNotContiguous: return "Existing log file is not contiguous. Check that no stale files are left in the Exchange data/log directories."; + case hrErrorFromESECall: + return "Error returned from ESE function call. Check the Windows Event Logs for more information."; case hrCBDatabaseNotFound: return "Database not found. Check that the Database you are trying to restore actually exists in the Storage Group you are restoring to."; default: diff --git a/bacula/src/win32/filed/plugins/api.h b/bacula/src/win32/filed/plugins/api.h index e2ced85626..0bcc16a57a 100644 --- a/bacula/src/win32/filed/plugins/api.h +++ b/bacula/src/win32/filed/plugins/api.h @@ -257,6 +257,7 @@ ESEErrorMessage(HRESULT result); #define hrMissingFullBackup (HRESULT)0xC8000230L #define hrBackupInProgress (HRESULT)0xC80001F9L #define hrCBDatabaseNotFound (HRESULT)0xC7FE1F42L +#define hrErrorFromESECall (HRESULT)0xC7FF1004L extern HrESEBackupRestoreGetNodes_t HrESEBackupRestoreGetNodes; extern HrESEBackupPrepare_t HrESEBackupPrepare; diff --git a/bacula/src/win32/filed/plugins/storage_group_node.c b/bacula/src/win32/filed/plugins/storage_group_node.c index e2e45e6825..8604351882 100644 --- a/bacula/src/win32/filed/plugins/storage_group_node.c +++ b/bacula/src/win32/filed/plugins/storage_group_node.c @@ -456,6 +456,8 @@ storage_group_node_t::createFile(exchange_fd_context_t *context, struct restore_ if (result != 0) { _JobMessage(M_ERROR, "HrESERestoreComplete failed with error 0x%08x - %s\n", result, ESEErrorMessage(result)); + _DebugMessage(100, "Calling HrESERestoreClose\n"); + result = HrESERestoreClose(hccx, RESTORE_CLOSE_NORMAL); state = 999; break; } @@ -498,6 +500,7 @@ storage_group_node_t::endRestoreFile(exchange_fd_context_t *context) context->current_node = parent; return bRC_OK; case 999: + context->current_node = parent; return bRC_OK; }