HrESERestoreSaveEnvironment Function

Topic Last Modified: 2006-06-12

The HrESERestoreSaveEnvironment function saves to disk the in-memory state of the restore operation.

Applies To

ESEbcli2 DLL Functions Interface

Syntax

HRESULT HrESERestoreSaveEnvironment
(
        HCCX phccxRestoreContext
);

Parameters

  • phccxRestoreContext
    Input parameter. A handle to a restore context. The handle is passed to the various restore functions, and contains information about the current restore operations.

Return Value

The following return codes can be returned. To retrieve the error string for an Exchange Storage Engine (ESE) error, use the standard FormatMessage function. For the general errors hrErrorFromESECall and hrErrorFromCallbackCall, more information about the error is available using the standard GetLastError function.

S_OK

Success.

ESE-specific error codes

ESE-specific error codes, as defined in esebkmsg.h.

Other

Other Microsoft® Win32® or remote procedure call (RPC) errors.

Remarks

Restore environment files enable an application to suspend or abort a restore operation, and complete it later. This can be useful if the data being restored is stored on multiple storage media, or if the restore application is forced to close during a restore operation. The restore environment file can be retrieved, and the restore completed, at a later time.

This function saves a file in the folder specified in the wszRestoreLogPath parameter to HrESERestoreOpen.

To retrieve the stored restore environment file, use the HrESERestoreLoadEnvironment Function.

This function can only be called before the restore session has been closed with HrESERestoreClose, and before the database recovery starts with the call to HrESERestoreComplete.

Applications that use this function must be run under a user account that has Microsoft Windows® server operating systems Backup and Restore privileges.