Checks a vault's consistency and repairs it as necessary.
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
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_ONLY||0x00000001||Check only, don't attempt any repairs.|
|CBFSSTORAGE_CR_CHECK_ALL_PAGES||0x00000002||Check 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.