Constants

All constants are defined in the cbfsvault package.

File Attributes

CBFSSTORAGE_FATTR_FILE 0x00000001 The entry is a file.

CBFSSTORAGE_FATTR_DIRECTORY 0x00000002 The entry is a directory.

CBFSSTORAGE_FATTR_DATA_STREAM 0x00000004 The entry is an alternate data stream.

CBFSSTORAGE_FATTR_COMPRESSED 0x00000008 The file or stream is compressed.

CBFSSTORAGE_FATTR_ENCRYPTED 0x00000010 The file or stream is encrypted.

CBFSSTORAGE_FATTR_SYMLINK 0x00000020 The entry is a symbolic link.

CBFSSTORAGE_FATTR_READONLY 0x00000040 The file is read-only.

This attribute is not used by CBFS Vault, but it can be set and retrieved.

CBFSSTORAGE_FATTR_ARCHIVE 0x00000080 The file requires archiving.

This attribute is not used by CBFS Vault, but it can be set and retrieved.

CBFSSTORAGE_FATTR_HIDDEN 0x00000100 The file is hidden.

This attribute is not used by CBFS Vault, but it can be set and retrieved.

CBFSSTORAGE_FATTR_SYSTEM 0x00000200 The file is a system file.

This attribute is not used by CBFS Vault, but it can be set and retrieved.

CBFSSTORAGE_FATTR_TEMPORARY 0x00000400 The file is temporary.

This attribute is not used by CBFS Vault, but it can be set and retrieved.

CBFSSTORAGE_FATTR_DELETE_ON_CLOSE 0x00000800 The file should be deleted when the last handle to the file is closed.

This attribute is currently not supported by CBFS Vault.

CBFSSTORAGE_FATTR_RESERVED_0 0x00001000 Reserved.

CBFSSTORAGE_FATTR_RESERVED_1 0x00002000 Reserved.

CBFSSTORAGE_FATTR_RESERVED_2 0x00004000 Reserved.

CBFSSTORAGE_FATTR_RESERVED_3 0x00008000 Reserved.

CBFSSTORAGE_FATTR_NO_USER_CHANGE 0x0000F03F A mask which 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, RESERVED_3.

CBFSSTORAGE_FATTR_USER_DEFINED 0x7FF00000 A mask for application-defined attributes.

Applications can use the SetFileAttributes method to set custom attributes, so long as their values are covered by this mask.

CBFSSTORAGE_FATTR_ANY_FILE 0x7FFFFFFF A mask which includes any and all attributes.

Check and Repair 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.)

Format Flags

CBFSSTORAGE_FMF_FAST_FORMAT 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.

Search Flags

CBFSSTORAGE_FF_NEED_NAME 0x00000001 Include entry names (without paths) when returning search results.

CBFSSTORAGE_FF_NEED_FULL_NAME 0x00000002 Include fully-qualified entry names when returning search results.

CBFSSTORAGE_FF_NEED_ATTRIBUTES 0x00000004 Include entry attributes when returning search results.

CBFSSTORAGE_FF_NEED_SIZE 0x00000008 Include entry sizes when returning search results.

CBFSSTORAGE_FF_NEED_METADATA_SIZE 0x00000010 Include entry metadata sizes when returning search results.

CBFSSTORAGE_FF_NEED_TIMES 0x00000020 Include entry times when returning search results.

CBFSSTORAGE_FF_NEED_LINK_DEST 0x00000040 Include symbolic link destinations when returning search results.

CBFSSTORAGE_FF_EMULATE_FAT 0x00001000 Inserts . and .. pseudo-entries into search results for all directories except the root one.

CBFSSTORAGE_FF_RECURSIVE 0x00002000 Search recursively in all subdirectories.

CBFSSTORAGE_FF_CASE_INSENSITIVE 0x00004000 Forces case-insensitive search, even if the vault is case-sensitive.

Vault Open Modes

CBFSSTORAGE_OM_CREATE_NEW 0 Creates a new vault if possible, failing if one already exists.

CBFSSTORAGE_OM_CREATE_ALWAYS 1 Creates a new vault, overwriting an existing one if necessary.

CBFSSTORAGE_OM_OPEN_EXISTING 2 Opens a vault if it exists; fails otherwise.

CBFSSTORAGE_OM_OPEN_ALWAYS 3 Opens a vault if it exists; creates a new one otherwise.

Vault State Flags

CBFSSTORAGE_ST_FIXED_SIZE 0x00000001 The vault is fixed-size.

CBFSSTORAGE_ST_READ_ONLY 0x00000002 The vault was opened in read-only mode.

Please refer to the ReadOnly property for more information.

CBFSSTORAGE_ST_CORRUPTED 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.

CBFSSTORAGE_ST_TRANSACTIONS_USED 0x00000008 The vault was opened in journaling mode.

Please refer to the UseJournaling property for more information.

CBFSSTORAGE_ST_ACCESS_TIME_USED 0x00000010 Last access times are being tracked.

Please refer to the UseAccessTime property for more information.

CBFSSTORAGE_ST_ENCRYPTED 0x00000020 The vault is encrypted with whole-vault encryption.

Please refer to the Encryption topic for more information.

CBFSSTORAGE_ST_VALID_PASSWORD_SET 0x00000040 The correct whole-vault encryption password has been provided.

Please refer to the Encryption topic for more information.

CBFSSTORAGE_ST_PARTED 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

CBFSSTORAGE_TDT_RAWDATA 0x0 The tag is untyped and must be addressed by Id.

CBFSSTORAGE_TDT_BOOLEAN 0x1 The tag contains Boolean data and must be addressed by name.

CBFSSTORAGE_TDT_STRING 0x2 The tag contains String (UTF-16LE) data and must be addressed by name.

CBFSSTORAGE_TDT_DATETIME 0x3 The tag contains DateTime data and must be addressed by name.

CBFSSTORAGE_TDT_NUMBER 0x4 The tag contains numeric (signed 64-bit) data and must be addressed by name.

CBFSSTORAGE_TDT_ANSISTRING 0x5 The tag contains AnsiString (8-bit string) data and must be addressed by name.

Path Separator Characters

CBFSSTORAGE_PSC_BACKSLASH 92 Backslash ('\\').

Windows path separator.

CBFSSTORAGE_PSC_SLASH 47 Forward slash ('/').

Unix-style path separator.

Compression Modes

CBFSSTORAGE_CM_NONE 0 Don't use compression.

CBFSSTORAGE_CM_DEFAULT 1 Use default compression (zlib).

CBFSSTORAGE_CM_CUSTOM 2 Use event-based custom compression.

Compression level is not used.

CBFSSTORAGE_CM_ZLIB 3 Use zlib compression.

Valid compression levels are 1-9.

CBFSSTORAGE_CM_RLE 4 Use RLE compression.

Compression level is not used.

Encryption Modes

CBFSSTORAGE_EM_NONE 0x0 Don't use encryption.

CBFSSTORAGE_EM_DEFAULT 0x1 Use default encryption (CBFSSTORAGE_EM_XTS_AES256_PBKDF2_HMAC_SHA256).

CBFSSTORAGE_EM_XTS_AES256_PBKDF2_HMAC_SHA256 0x2 Use AES256 encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash.

CBFSSTORAGE_EM_CUSTOM256_PBKDF2_HMAC_SHA256 0x3 Use event-based custom 256-bit encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash.

256-bit (32-byte) block size.

CBFSSTORAGE_EM_CUSTOM512_PBKDF2_HMAC_SHA256 0x4 Use event-based custom 512-bit encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash.

512-bit (64-byte) block size.

CBFSSTORAGE_EM_CUSTOM1024_PBKDF2_HMAC_SHA256 0x5 Use event-based custom 1024-bit encryption with PBKDF2 key derivation based on a HMAC_SHA256 key hash.

1024-bit (128-byte) block size.

CBFSSTORAGE_EM_CUSTOM256_CUSTOM_KEY_DERIVE 0x23 Use event-based custom 256-bit encryption with custom key derivation.

256-bit (32-byte) block size.

CBFSSTORAGE_EM_CUSTOM512_CUSTOM_KEY_DERIVE 0x24 Use event-based custom 512-bit encryption with custom key derivation.

512-bit (64-byte) block size.

CBFSSTORAGE_EM_CUSTOM1024_CUSTOM_KEY_DERIVE 0x25 Use event-based custom 1024-bit encryption with custom key derivation.

1024-bit (128-byte) block size.

CBFSSTORAGE_EM_CUSTOM256_DIRECT_KEY 0x43 Use event-based custom 256-bit encryption with no key derivation.

256-bit (32-byte) block size. Useful for cases where the password is an identifier for an external key and should not be used for key derivation.

CBFSSTORAGE_EM_CUSTOM512_DIRECT_KEY 0x44 Use event-based custom 512-bit encryption with no key derivation.

512-bit (64-byte) block size. Useful for cases where the password is an identifier for an external key and should not be used for key derivation.

CBFSSTORAGE_EM_CUSTOM1024_DIRECT_KEY 0x45 Use event-based custom 1024-bit encryption with no key derivation.

1024-bit (128-byte) block size. Useful for cases where the password is an identifier for an external key and should not be used for key derivation.

CBFSSTORAGE_EM_UNKNOWN 0xFF Unidentified or unknown encryption.

File Open Modes

CBFSSTORAGE_FOM_CREATE_NEW 0 Creates a new file or alternate stream if possible, failing if one already exists.

CBFSSTORAGE_FOM_CREATE_ALWAYS 1 Creates a new file or stream, overwriting an existing one if necessary.

CBFSSTORAGE_FOM_OPEN_EXISTING 2 Opens a file or stream if it exists; fails otherwise.

CBFSSTORAGE_FOM_OPEN_ALWAYS 3 Opens a file or stream if it exists; creates a new one otherwise.

Progress Operations

CBFSSTORAGE_PO_FORMATTING 0 Formatting a vault.

CBFSSTORAGE_PO_CHECKING_1 1 Checking a vault (stage 1).

CBFSSTORAGE_PO_CHECKING_2 2 Checking a vault (stage 2).

CBFSSTORAGE_PO_CHECKING_3 3 Checking a vault (stage 3).

CBFSSTORAGE_PO_CHECKING_4 4 Checking a vault (stage 4).

CBFSSTORAGE_PO_CHECKING_5 5 Checking a vault (stage 5).

CBFSSTORAGE_PO_PAGE_CORRUPTED 8 Processing a corrupted vault page.

CBFSSTORAGE_PO_PAGE_ORPHANED 9 Processing an orphaned vault page.

CBFSSTORAGE_PO_COMPRESSING 10 Compressing a file or alternate stream.

CBFSSTORAGE_PO_DECOMPRESSING 11 Decompressing a file or alternate stream.

CBFSSTORAGE_PO_ENCRYPTING 12 Encrypting a vault, file, or alternate stream.

CBFSSTORAGE_PO_DECRYPTING 13 Decrypting a vault, file, or alternate stream

CBFSSTORAGE_PO_COMPACTING 14 Compacting a vault.

CBFSSTORAGE_PO_RESIZING 15 Resizing a vault.

CBFSSTORAGE_PO_CALCULATING_SIZE 16 Calculating a vault's size.

CBFSSTORAGE_PO_COPYING_FILES_TO_VAULT 17 Copying files to a vault.

CBFSSTORAGE_PO_COPYING_FILES_FROM_VAULT 18 Copying files from a vault.

Copy Flags

CBFSSTORAGE_CFF_OVERWRITE_NONE 0x00000000 Never overwrite destination files.

CBFSSTORAGE_CFF_OVERWRITE_IF_NEWER 0x00000001 Overwrite a destination file only if the source file is newer.

CBFSSTORAGE_CFF_OVERWRITE_ALL 0x00000002 Always overwrite destination files.

CBFSSTORAGE_CFF_INCLUDE_SUBDIRS_WITH_CONTENTS 0x00010000 Include all subdirectories in source directory, and their contents, recursively.

CBFSSTORAGE_CFF_INCLUDE_SUBDIRS_NO_CONTENTS 0x00020000 Include all subdirectories in the source directory, without their contents.

Error Codes

CBFSSTORAGE_ERR_INVALID_VAULT_FILE -1 The specified file is not a CBFS Vault vault.

CBFSSTORAGE_ERR_INVALID_PAGE_SIZE -2 The specified page size is not valid.

CBFSSTORAGE_ERR_VAULT_CORRUPTED -3 The vault is corrupted.

CBFSSTORAGE_ERR_TOO_MANY_TRANSACTIONS -4 Too many transactions active.

CBFSSTORAGE_ERR_FILE_ALREADY_EXISTS -5 A file, directory, symbolic link, or alternate stream with the specified name already exists.

CBFSSTORAGE_ERR_TRANSACTIONS_STILL_ACTIVE -6 One or more transactions are still active.

CBFSSTORAGE_ERR_TAG_ALREADY_EXISTS -7 The specified file tag already exists.

CBFSSTORAGE_ERR_FILE_NOT_FOUND -8 The specified file, directory, symbolic link, or alternate stream was not found.

CBFSSTORAGE_ERR_PATH_NOT_FOUND -9 The specified path was not found.

CBFSSTORAGE_ERR_SHARING_VIOLATION -10 The specified file or alternate stream is already open in an exclusive access mode.

CBFSSTORAGE_ERR_SEEK_BEYOND_EOF -11 Cannot seek beyond the end of a file or alternate stream.

CBFSSTORAGE_ERR_NO_MORE_FILES -12 There are no other files, directories, symbolic links, or alternate streams that match the search criteria.

CBFSSTORAGE_ERR_INVALID_FILE_NAME -13 The specified name is not valid.

CBFSSTORAGE_ERR_VAULT_ACTIVE -14 The requested operation cannot be performed while a vault is open.

CBFSSTORAGE_ERR_VAULT_NOT_ACTIVE -15 A vault must be open before the requested operation can be performed.

CBFSSTORAGE_ERR_INVALID_PASSWORD -16 The specified password is incorrect.

CBFSSTORAGE_ERR_VAULT_READ_ONLY -17 The requested operation cannot be performed; the vault is open in read-only mode.

CBFSSTORAGE_ERR_NO_ENCRYPTION_HANDLERS -18 Can't use custom encryption; no custom encryption event handlers provided.

CBFSSTORAGE_ERR_OUT_OF_MEMORY -19 Out of memory.

CBFSSTORAGE_ERR_SYMLINK_DESTINATION_NOT_FOUND -20 A symbolic link's destination file could not be found.

CBFSSTORAGE_ERR_FILE_IS_NOT_SYMLINK -21 The specified file is not a symbolic link.

CBFSSTORAGE_ERR_BUFFER_TOO_SMALL -22 The specified buffer is too small to hold the requested value.

CBFSSTORAGE_ERR_BAD_COMPRESSED_DATA -23 Decompression failed (possible due to corruption).

CBFSSTORAGE_ERR_INVALID_PARAMETER -24 Invalid parameter.

CBFSSTORAGE_ERR_VAULT_FULL -25 The vault is full (and cannot be automatically resized).

CBFSSTORAGE_ERR_INTERRUPTED_BY_USER -26 Operation interrupted by user.

CBFSSTORAGE_ERR_TAG_NOT_FOUND -27 The specified file tag was not found.

CBFSSTORAGE_ERR_DIRECTORY_NOT_EMPTY -28 The specified directory is not empty.

CBFSSTORAGE_ERR_HANDLE_CLOSED -29 The file or alternate stream was closed unexpectedly; the handle is no longer valid.

CBFSSTORAGE_ERR_INVALID_STREAM_HANDLE -30 Invalid file or alternate stream handle.

CBFSSTORAGE_ERR_FILE_ACCESS_DENIED -31 Access denied.

CBFSSTORAGE_ERR_NO_COMPRESSION_HANDLERS -32 Can't use custom compression; no custom compression event handlers provided.

CBFSSTORAGE_ERR_NOT_IMPLEMENTED -33 Not implemented in this version of CBFS Vault.

CBFSSTORAGE_ERR_DRIVER_NOT_INSTALLED -35 The CBFS Vault system driver has not been installed.

CBFSSTORAGE_ERR_NEW_VAULT_VERSION -37 The specified vault cannot be opened, it was created using a newer version of CBFS Vault.

CBFSSTORAGE_ERR_FILE_IS_NOT_DIRECTORY -38 The specified file is not a directory.

CBFSSTORAGE_ERR_INVALID_TAG_DATA_TYPE -39 The specified file tag data type is not valid.

CBFSSTORAGE_ERR_VAULT_FILE_DOES_NOT_EXIST -40 The specified vault storage file does not exist.

CBFSSTORAGE_ERR_VAULT_FILE_ALREADY_EXISTS -41 The specified vault storage file already exists.

CBFSSTORAGE_ERR_CALLBACK_MODE_FAILURE -42 Some callback mode event handler has returned an unidentified error.

CBFSSTORAGE_ERR_EXTERNAL_ERROR -43 External library could not be initialized or used.

Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Vault 2020 Go Edition - Version 20.0 [Build 7982]