CheckAndRepair Method

Checks a vault's consistency and repairs it as necessary.

Syntax

ANSI (Cross Platform)
int CheckAndRepair(int iFlags);

Unicode (Windows)
INT CheckAndRepair(INT iFlags);
- (void)checkAndRepair:(int)flags;
#define MID_CBVAULT_CHECKANDREPAIR 3

CBFSSTORAGE_EXTERNAL int CBFSSTORAGE_CALL CBFSStorage_CBVault_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method checks the consistency of a vault and attempts to repair it as necessary.

Applications should call this method if a vault has become corrupted (i.e., if the IsCorrupted property is true, or if a vault operation fails with a "Vault Corrupted" error). Be sure to make a vault backup before calling this method, as its repair efforts may cause data loss in cases of severe corruption. Please refer to the Vault Corruption topic for more information.

The Flags parameter is used to specify additional options, and should be set by OR'ing together zero or more of the following flags:

CBFSSTORAGE_CR_CHECK_ONLY0x00000001Check only, don't attempt any repairs.

CBFSSTORAGE_CR_CHECK_ALL_PAGES0x00000002Check all vault pages, including empty ones.

(When this flag is not present, only the vault pages which are marked as occupied are checked.)

Note: This method cannot be called when Active is true, and cannot be called within events.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Storage 2020 C++ Edition - Version 20.0 [Build 8031]