Constants

All constants are accessible through the callback.CBFSVault.Constants class.

Error Codes

VAULT_ERR_INVALID_VAULT_FILE
Value: -1
The specified file is not a CBFS Vault vault.
VAULT_ERR_INVALID_PAGE_SIZE
Value: -2
The specified page size is not valid.
VAULT_ERR_VAULT_CORRUPTED
Value: -3
The vault is corrupted.
VAULT_ERR_TOO_MANY_TRANSACTIONS
Value: -4
Too many transactions active.
VAULT_ERR_FILE_ALREADY_EXISTS
Value: -5
A file, directory, symbolic link, or alternate stream with the specified name already exists.
VAULT_ERR_TRANSACTIONS_STILL_ACTIVE
Value: -6
One or more transactions are still active.
VAULT_ERR_TAG_ALREADY_EXISTS
Value: -7
The specified file tag already exists.
VAULT_ERR_FILE_NOT_FOUND
Value: -8
The specified file, directory, symbolic link, or alternate stream was not found.
VAULT_ERR_PATH_NOT_FOUND
Value: -9
The specified path was not found.
VAULT_ERR_SHARING_VIOLATION
Value: -10
The specified file or alternate stream is already open in an exclusive access mode.
VAULT_ERR_SEEK_BEYOND_EOF
Value: -11
Cannot seek beyond the end of a file or alternate stream.
VAULT_ERR_NO_MORE_FILES
Value: -12
No other files, directories, symbolic links, or alternate streams match the search criteria.
VAULT_ERR_INVALID_FILE_NAME
Value: -13
The specified name is not valid.
VAULT_ERR_VAULT_ACTIVE
Value: -14
The requested operation cannot be performed while a vault is open.
VAULT_ERR_VAULT_NOT_ACTIVE
Value: -15
A vault must be open before the requested operation can be performed.
VAULT_ERR_INVALID_PASSWORD
Value: -16
The specified password is incorrect.
VAULT_ERR_VAULT_READ_ONLY
Value: -17
The requested operation cannot be performed; the vault is open in read-only mode.
VAULT_ERR_NO_ENCRYPTION_HANDLERS
Value: -18
Cannot use custom encryption; no custom encryption event handlers provided.
VAULT_ERR_OUT_OF_MEMORY
Value: -19
Out of memory.
VAULT_ERR_SYMLINK_DESTINATION_NOT_FOUND
Value: -20
A symbolic link's destination file could not be found.
Value: -21
The specified file is not a symbolic link.
VAULT_ERR_BUFFER_TOO_SMALL
Value: -22
The specified buffer is too small to hold the requested value.
VAULT_ERR_BAD_COMPRESSED_DATA
Value: -23
Decompression failed (possibly due to corruption).
VAULT_ERR_INVALID_PARAMETER
Value: -24
Invalid parameter.
VAULT_ERR_VAULT_FULL
Value: -25
The vault is full (and cannot be automatically resized).
VAULT_ERR_INTERRUPTED_BY_USER
Value: -26
Operation interrupted by user.
VAULT_ERR_TAG_NOT_FOUND
Value: -27
The specified file tag was not found.
VAULT_ERR_DIRECTORY_NOT_EMPTY
Value: -28
The specified directory is not empty.
VAULT_ERR_HANDLE_CLOSED
Value: -29
The file or alternate stream was closed unexpectedly; the handle is no longer valid.
VAULT_ERR_INVALID_STREAM_HANDLE
Value: -30
Invalid file or alternate stream handle.
VAULT_ERR_FILE_ACCESS_DENIED
Value: -31
Access denied.
VAULT_ERR_NO_COMPRESSION_HANDLERS
Value: -32
Cannot use custom compression; no custom compression event handlers provided.
VAULT_ERR_NOT_IMPLEMENTED
Value: -33
Not implemented in this version of CBFS Vault.
VAULT_ERR_DRIVER_NOT_INSTALLED
Value: -35
The CBFS Vault system driver has not been installed.
VAULT_ERR_NEW_VAULT_VERSION
Value: -37
The specified vault cannot be opened, it was created using a newer version of CBFS Vault.
VAULT_ERR_FILE_IS_NOT_DIRECTORY
Value: -38
The specified file is not a directory.
VAULT_ERR_INVALID_TAG_DATA_TYPE
Value: -39
The specified file tag data type is not valid.
VAULT_ERR_VAULT_FILE_DOES_NOT_EXIST
Value: -40
The specified vault storage file does not exist.
VAULT_ERR_VAULT_FILE_ALREADY_EXISTS
Value: -41
The specified vault storage file already exists.
VAULT_ERR_CALLBACK_MODE_FAILURE
Value: -42
Some callback mode event handler has returned an unidentified error.
VAULT_ERR_EXTERNAL_ERROR
Value: -43
External library could not be initialized or used.

File Attributes

VAULT_FATTR_FILE
Value: 0x00000001
The entry is a file.
VAULT_FATTR_DIRECTORY
Value: 0x00000002
The entry is a directory.
VAULT_FATTR_DATA_STREAM
Value: 0x00000004
The entry is an alternate data stream.
VAULT_FATTR_COMPRESSED
Value: 0x00000008
The file or stream is compressed.
VAULT_FATTR_ENCRYPTED
Value: 0x00000010
The file or stream is encrypted.
Value: 0x00000020
The entry is a symbolic link.
VAULT_FATTR_READONLY
Value: 0x00000040
The file is read-only. This attribute is not used by CBFS Vault, but it can be set and retrieved.
VAULT_FATTR_ARCHIVE
Value: 0x00000080
The file requires archiving. This attribute is not used by CBFS Vault, but it can be set and retrieved.
VAULT_FATTR_HIDDEN
Value: 0x00000100
The file is hidden. This attribute is not used by CBFS Vault, but it can be set and retrieved.
VAULT_FATTR_SYSTEM
Value: 0x00000200
The file is a system file. This attribute is not used by CBFS Vault, but it can be set and retrieved.
VAULT_FATTR_TEMPORARY
Value: 0x00000400
The file is temporary. This attribute is not used by CBFS Vault, but it can be set and retrieved.
VAULT_FATTR_DELETE_ON_CLOSE
Value: 0x00000800
The file should be deleted when the last handle to the file is closed. This attribute is currently not supported by CBFS Vault.
VAULT_FATTR_RESERVED_0
Value: 0x00001000
Reserved.
VAULT_FATTR_RESERVED_1
Value: 0x00002000
Reserved.
VAULT_FATTR_RESERVED_2
Value: 0x00004000
Reserved.
VAULT_FATTR_RESERVED_3
Value: 0x00008000
Reserved.
VAULT_FATTR_NO_USER_CHANGE
Value: 0x0000F03F
A mask that includes all attributes that cannot be changed. Applications cannot use the SetFileAttributes method to directly change any of the following attributes: FILE, DIRECTORY, DATA_STREAM, COMPRESSED, ENCRYPTED, SYMLINK, RESERVED_0, RESERVED_1, RESERVED_2, or RESERVED_3.
VAULT_FATTR_USER_DEFINED
Value: 0x7FF00000
A mask for application-defined attributes. Applications can use the SetFileAttributes method to set custom attributes, as long as their values are covered by this mask.
VAULT_FATTR_ANY_FILE
Value: 0x7FFFFFFF
A mask that includes any and all attributes.

Check and Repair Flags

VAULT_CR_CHECK_ONLY
Value: 0x00000001
Check only, do not attempt any repairs.
VAULT_CR_CHECK_ALL_PAGES
Value: 0x00000002
Check all vault pages, including empty ones. When this flag is not present, only the vault pages that are marked as occupied are checked.

Format Flags

VAULT_FMF_FAST_FORMAT
Value: 0x00000001
Perform a fast format; only initialize the pages necessary for storing the filesystem structure. When this flag is not set, all pages of the new vault are initialized.

Vault Journaling Modes

VAULT_JM_NONE
Value: 0
No journaling is used. This mode ensures the fastest operations, but if the application crashes, corruption of the vault is possible.
VAULT_JM_METADATA
Value: 1
Journaling is used only for metadata (filesystem structure and directory contents). This mode is a balance between speed and reliability.
VAULT_JM_FULL
Value: 2
Journaling is used for both filesystem structure and file data and metadata. This mode is the slowest but the most reliable option.

Search Flags

VAULT_FF_NEED_NAME
Value: 0x00000001
Include entry names (without paths) when returning search results.
VAULT_FF_NEED_FULL_NAME
Value: 0x00000002
Include fully qualified entry names when returning search results.
VAULT_FF_NEED_ATTRIBUTES
Value: 0x00000004
Include entry attributes when returning search results.
VAULT_FF_NEED_SIZE
Value: 0x00000008
Include entry sizes when returning search results.
VAULT_FF_NEED_METADATA_SIZE
Value: 0x00000010
Include entry metadata sizes when returning search results.
VAULT_FF_NEED_TIMES
Value: 0x00000020
Include entry times when returning search results.
VAULT_FF_NEED_LINK_DEST
Value: 0x00000040
Include symbolic link destinations when returning search results.
VAULT_FF_EMULATE_FAT
Value: 0x00001000
Inserts . and .. pseudo-entries into search results for all directories except the root one.
VAULT_FF_RECURSIVE
Value: 0x00002000
Search recursively in all subdirectories.
VAULT_FF_CASE_INSENSITIVE
Value: 0x00004000
Forces case-insensitive search, even if the vault is case-sensitive.

Vault Open Modes

VAULT_OM_CREATE_NEW
Value: 0
Creates a new vault if possible, failing if one already exists.
VAULT_OM_CREATE_ALWAYS
Value: 1
Creates a new vault, overwriting an existing one if necessary.
VAULT_OM_OPEN_EXISTING
Value: 2
Opens a vault if it exists; fails otherwise.
VAULT_OM_OPEN_ALWAYS
Value: 3
Opens a vault if it exists; creates a new one otherwise.

Vault State Flags

VAULT_ST_FIXED_SIZE
Value: 0x00000001
The vault is a fixed size.
VAULT_ST_READ_ONLY
Value: 0x00000002
The vault was opened in read-only mode. Please refer to the ReadOnly property for more information.
VAULT_ST_CORRUPTED
Value: 0x00000004
The vault is corrupted. Applications can use the CheckAndRepair method to try to repair vault corruption. Please refer to the Vault Corruption topic for more information.
VAULT_ST_TRANSACTIONS_USED
Value: 0x00000008
The vault was opened in journaling mode. Please refer to the UseJournaling property for more information.
VAULT_ST_ACCESS_TIME_USED
Value: 0x00000010
Last access times are being tracked. Please refer to the UseAccessTime property for more information.
VAULT_ST_ENCRYPTED
Value: 0x00000020
The vault is encrypted with whole-vault encryption. Please refer to the Encryption topic for more information.
VAULT_ST_VALID_PASSWORD_SET
Value: 0x00000040
The correct whole-vault encryption password has been provided. Please refer to the Encryption topic for more information.
VAULT_ST_PARTED
Value: 0x00000100
The vault's contents are split across multiple files on disk. Please refer to the Multipart Vaults topic for more information.

Tag Data Types

VAULT_TDT_RAWDATA
Value: 0x0
The tag is untyped and must be addressed by Id.
VAULT_TDT_BOOLEAN
Value: 0x1
The tag contains Boolean data and must be addressed by name.
VAULT_TDT_STRING
Value: 0x2
The tag contains String (UTF-16LE) data and must be addressed by name.
VAULT_TDT_DATETIME
Value: 0x3
The tag contains DateTime data and must be addressed by name.
VAULT_TDT_NUMBER
Value: 0x4
The tag contains numeric (signed 64-bit) data and must be addressed by name.
VAULT_TDT_ANSISTRING
Value: 0x5
The tag contains AnsiString (8-bit string) data and must be addressed by name.

Path Separator Characters

VAULT_PSC_BACKSLASH
Value: 92
Backslash ('\\'). This character is the Windows path separator.
VAULT_PSC_SLASH
Value: 47
Forward slash ('/'). This character is the Unix-style path separator.

Compression Modes

VAULT_CM_NONE
Value: 0
Do not use compression.
VAULT_CM_DEFAULT
Value: 1
Use default compression (zlib).
VAULT_CM_CUSTOM
Value: 2
Use event-based custom compression. This compression level is not used.
VAULT_CM_ZLIB
Value: 3
Use zlib compression. Valid compression levels are 1-9.
VAULT_CM_RLE
Value: 4
Use RLE compression. This compression level is not used.

Encryption Modes

VAULT_EM_NONE
Value: 0x0
Do not use encryption.
VAULT_EM_DEFAULT
Value: 0x1
Use default encryption (VAULT_EM_XTS_AES256_PBKDF2_HMAC_SHA256).
VAULT_EM_XTS_AES256_PBKDF2_HMAC_SHA256
Value: 0x2
Use AES256 encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash.
VAULT_EM_CUSTOM256_PBKDF2_HMAC_SHA256
Value: 0x3
Use event-based custom 256-bit encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash. A 256-bit (32-byte) block size is used with this encryption mode.
VAULT_EM_CUSTOM512_PBKDF2_HMAC_SHA256
Value: 0x4
Use event-based custom 512-bit encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash. A 512-bit (64-byte) block size is used with this encryption mode.
VAULT_EM_CUSTOM1024_PBKDF2_HMAC_SHA256
Value: 0x5
Use event-based custom 1024-bit encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash. A 1024-bit (128-byte) block size is used with this encryption mode.
VAULT_EM_CUSTOM256_CUSTOM_KEY_DERIVE
Value: 0x23
Use event-based custom 256-bit encryption with custom key derivation. A 256-bit (32-byte) block size is used with this encryption mode.
VAULT_EM_CUSTOM512_CUSTOM_KEY_DERIVE
Value: 0x24
Use event-based custom 512-bit encryption with custom key derivation. A 512-bit (64-byte) block size is used with this encryption mode.
VAULT_EM_CUSTOM1024_CUSTOM_KEY_DERIVE
Value: 0x25
Use event-based custom 1024-bit encryption with custom key derivation. A 1024-bit (128-byte) block size is used with this encryption mode.
VAULT_EM_CUSTOM256_DIRECT_KEY
Value: 0x43
Use event-based custom 256-bit encryption with no key derivation. A 256-bit (32-byte) block size is used with this encryption mode. This mode is useful for cases in which the password is an identifier for an external key and should not be used for key derivation.
VAULT_EM_CUSTOM512_DIRECT_KEY
Value: 0x44
Use event-based custom 512-bit encryption with no key derivation. A 512-bit (64-byte) block size is used with this encryption mode. This mode is useful for cases in which the password is an identifier for an external key and should not be used for key derivation.
VAULT_EM_CUSTOM1024_DIRECT_KEY
Value: 0x45
Use event-based custom 1024-bit encryption with no key derivation. A 1024-bit (128-byte) block size is used with this encryption mode. This mode is useful for cases in which the password is an identifier for an external key and should not be used for key derivation.
VAULT_EM_UNKNOWN
Value: 0xFF
Unidentified or unknown encryption.

File Open Modes

VAULT_FOM_CREATE_NEW
Value: 0
Creates a new file or alternate stream if possible, failing if one already exists.
VAULT_FOM_CREATE_ALWAYS
Value: 1
Creates a new file or stream, overwriting an existing one if necessary.
VAULT_FOM_OPEN_EXISTING
Value: 2
Opens a file or stream if it exists; fails otherwise.
VAULT_FOM_OPEN_ALWAYS
Value: 3
Opens a file or stream if it exists; creates a new one otherwise.

Progress Operations

VAULT_PO_FORMATTING
Value: 0
Formatting a vault.
VAULT_PO_CHECKING_1
Value: 1
Checking a vault (stage 1).
VAULT_PO_CHECKING_2
Value: 2
Checking a vault (stage 2).
VAULT_PO_CHECKING_3
Value: 3
Checking a vault (stage 3).
VAULT_PO_CHECKING_4
Value: 4
Checking a vault (stage 4).
VAULT_PO_CHECKING_5
Value: 5
Checking a vault (stage 5).
VAULT_PO_PAGE_CORRUPTED
Value: 8
Processing a corrupted vault page.
VAULT_PO_PAGE_ORPHANED
Value: 9
Processing an orphaned vault page.
VAULT_PO_COMPRESSING
Value: 10
Compressing a file or alternate stream.
VAULT_PO_DECOMPRESSING
Value: 11
Decompressing a file or alternate stream.
VAULT_PO_ENCRYPTING
Value: 12
Encrypting a vault, file, or alternate stream.
VAULT_PO_DECRYPTING
Value: 13
Decrypting a vault, file, or alternate stream
VAULT_PO_COMPACTING
Value: 14
Compacting a vault.
VAULT_PO_RESIZING
Value: 15
Resizing a vault.
VAULT_PO_CALCULATING_SIZE
Value: 16
Calculating a vault's size.
VAULT_PO_COPYING_FILES_TO_VAULT
Value: 17
Copying files to a vault.
VAULT_PO_COPYING_FILES_FROM_VAULT
Value: 18
Copying files from a vault.

Copy Flags

VAULT_CFF_OVERWRITE_NONE
Value: 0x00000000
Never overwrite destination files.
VAULT_CFF_OVERWRITE_IF_NEWER
Value: 0x00000001
Overwrite a destination file only if the source file is newer.
VAULT_CFF_OVERWRITE_ALL
Value: 0x00000002
Always overwrite destination files.
VAULT_CFF_INCLUDE_SUBDIRS_WITH_CONTENTS
Value: 0x00010000
Include all subdirectories in source directory, and their contents, recursively.
VAULT_CFF_INCLUDE_SUBDIRS_NO_CONTENTS
Value: 0x00020000
Include all subdirectories in the source directory, without their contents.
VAULT_CFF_COPY_DIRS_STRUCTURE
Value: 0x00040000
Include all subdirectories in the source directory, without their contents. Only the directory structure is copied, recursively.
VAULT_CFF_COPY_STRUCTURE
Value: 0x00080000
Include all subdirectories in source directory, and their contents, recursively, but without file content. For files, empty placeholders are created without any original file data.
VAULT_CFF_FIRE_COPY_EVENTS
Value: 0x40000000
Fire events related to file copying. When the flag is set, the component fires the FileBeforeCopy and FileAfterCopy events.