Constants

All constants are defined in the cbfsconnect module.

Route Cache Flags

CBFS_ROUTE_FILE_READ_ONLY
Value: 0x00000001
Causes files to be treated as read-only; all write operations will be automatically denied.
CBFS_ROUTE_OPEN_EVENT
Value: 0x00000020
Prevents 'open' requests from being routed automatically. If set, the on_open_file event will fire as usual when such requests arrive.

Note: This flag is implied if any of the other CBFS_ROUTE_*_EVENT flags are present.

CBFS_ROUTE_CLEANUP_EVENT
Value: 0x00000040
Prevents 'cleanup' requests from being routed automatically. If set, the on_cleanup_file event will fire as usual when such requests arrive.
CBFS_ROUTE_CLOSE_EVENT
Value: 0x00000080
Prevents 'close' requests from being routed automatically. If set, the on_close_file event will fire as usual when such requests arrive.

Note: This flag is implied if any of the other CBFS_ROUTE_*_EVENT flags are present.

CBFS_ROUTE_ENUMERATE_DIRECTORY_EVENT
Value: 0x00000200
Prevents 'enumerate directory' requests from being routed automatically. If set, the on_enumerate_directory event will fire as usual when such requests arrive.
CBFS_ROUTE_SET_SECURITY_EVENT
Value: 0x00000400
Prevents 'set security' requests from being routed automatically. If set, the on_set_file_security event will fire as usual when such requests arrive.
CBFS_ROUTE_GET_SECURITY_EVENT
Value: 0x00000800
Prevents 'get security' requests from being routed automatically. If set, the on_get_file_security event will fire as usual when such requests arrive.
CBFS_ROUTE_SET_FILE_ATTRIBUTES_EVENT
Value: 0x00002000
Prevents 'set file attributes' requests from being routed automatically. If set, the on_set_file_attributes event will fire as usual when such requests arrive.
CBFS_ROUTE_SET_FILE_SIZES_EVENT
Value: 0x00004000
Prevents 'set file size' requests from being routed automatically. If set, the on_set_file_size event will fire as usual when such requests arrive.
CBFS_ROUTE_SET_VALID_DATA_LENGTH_EVENT
Value: 0x00008000
Prevents 'set valid data length' requests from being routed automatically. If set, the on_open_file event will fire as usual when such requests arrive.
CBFS_ROUTE_CREATE_HARD_LINK_EVENT
Value: 0x00020000
Prevents 'create hard link' requests from being routed automatically. If set, the on_create_hard_link event will fire as usual when such requests arrive.
CBFS_ROUTE_QUERY_QUOTA_EVENT
Value: 0x00040000
Prevents 'query quota' requests from being routed automatically. If set, the on_query_quotas event will fire as usual when such requests arrive.
CBFS_ROUTE_SET_QUOTA_EVENT
Value: 0x00080000
Prevents 'set quota' requests from being routed automatically. If set, the on_set_quotas event will fire as usual when such requests arrive.
CBFS_ROUTE_CAN_FILE_BE_DELETED_EVENT
Value: 0x00200000
Prevents 'can file be deleted' requests from being routed automatically. If set, the on_can_file_be_deleted event will fire as usual when such requests arrive.
CBFS_ROUTE_IS_DIRECTORY_EMPTY_EVENT
Value: 0x00400000
Prevents 'is directory empty' requests from being routed automatically. If set, the on_is_directory_empty event will fire as usual when such requests arrive.
CBFS_ROUTE_RENAME_EVENT
Value: 0x00800000
Prevents 'rename/move' requests from being routed automatically. If set, the on_rename_or_move_file event will fire as usual when such requests arrive.
CBFS_ROUTE_SET_EA_EVENT
Value: 0x01000000
Prevents 'set ea' requests from being routed automatically. If set, the on_set_ea event will fire as usual when such requests arrive.
CBFS_ROUTE_QUERY_EA_EVENT
Value: 0x02000000
Prevents 'query ea' requests from being routed automatically. If set, the on_query_ea event will fire as usual when such requests arrive.

Notify Change Flags

CBFS_NOTIFY_FLAG_ADDED
Value: 0x00000001
The specified file or directory has been created.
CBFS_NOTIFY_FLAG_REMOVED
Value: 0x00000002
The specified file or directory has been removed. For directories, all handles to files in the directory are immediately closed.
CBFS_NOTIFY_FLAG_MODIFIED
Value: 0x00000003
The specified file or directory has been modified. For files, use this option when the file's contents have changed. For directories, use this option when a change is made in alternate data streams that belong to the directory.

If a directory is reported as modified, all handles to files in the directory are immediately invalidated.

CBFS_NOTIFY_FLAG_METADATA_MODIFIED
Value: 0x00000004
The timestamp or other attributes of the specified file or directory have been modified.
CBFS_NOTIFY_FLAG_ALLOCATION_SIZE_MODIFIED
Value: 0x00000005
The allocation size for the specified file or directory has been modified. This option is applicable only if CorrectAllocationSizes is false.
CBFS_NOTIFY_FLAG_MODIFIED_NOT_INVALIDATE
Value: 0x00000006
The specified file or directory has been modified, but handles should not be invalidated. Note: Using this option can cause other applications to operate using stale data if they keep the specified file or directory open, because they have no way to know about the external changes.
CBFS_NOTIFY_FLAG_RENAMED
Value: 0x00000007
The specified file or directory has been renamed. This flag updates the internally stored name and does not invalidate existing handles (if any exist).
CBFS_NOTIFY_FLAG_SKIP_LOCKED_FILE
Value: 0x00001000
Ignore the request if the file has locked ranges. This supplementary flag may be used together with the CBFS_NOTIFY_FLAG_MODIFIED_NOT_INVALIDATE flag to tell the driver that if the file has locked ranges, the notification should be ignored.

Install Flags

INSTALL_REMOVE_OLD_VERSIONS
Value: 0x00000001
Uninstall drivers and helper DLLs from previous struct versions (e.g., 2017). Note: This functionality is only available in Windows. This flag does not remove the old PnP driver (VPnpBus) from the system because that driver is not versioned. Use the installer DLL of the old version and its Uninstall() function if you need to uninstall the PnP driver.
INSTALL_KEEP_START_TYPE
Value: 0x00000002
Keep the driver's current start type setting in the registry. If this flag is not set (default), the installation logic will reset the driver's start type setting in the Windows registry to the default value. Setting this flag causes the installation logic to preserve the current value, which may be necessary if the user (or the application itself) set it previously.

Note: This functionality is only available in Windows.

INSTALL_OVERWRITE_SAME_VERSION
Value: 0x00000004
Install files when their version is the same as the version of already installed files. If this flag is not set (default), the installation logic will overwrite the existing file only if the version number of the file being installed is larger than the version of the file being overwritten. Setting this flag causes the installation logic to overwrite the file even when it has the same version.

Note: This functionality is only available in Windows.

Uninstall Version Flags

UNINSTALL_VERSION_PREVIOUS
Value: 0x00000001
Uninstall modules from previous product versions.

Note: This functionality is only available in Windows.

UNINSTALL_VERSION_CURRENT
Value: 0x00000002
Uninstall modules from the current product version.

Note: This functionality is only available in Windows.

UNINSTALL_VERSION_ALL
Value: 0x00000003
Uninstall modules from all product versions.

Note: This functionality is only available in Windows.

Module Flags

MODULE_PNP_BUS
Value: 0x00000001
PnP Bus Driver (.sys file). This module must be installed if the application wishes to make use of Plug-and-Play (PnP) storage features. PnP storage devices are those visible as disks in the Device Manager, and the system treats such storage devices differently from other purely virtual devices.

The filesystem driver must be reinstalled any time this module is added or removed.

MODULE_DRIVER
Value: 0x00000002
Core Product Driver (.sys file). The product's filesystem driver module provides the core of its functionality; it must be installed for the product to function correctly.
MODULE_HELPER_DLL
Value: 0x00010000
Shell Helper DLL (CBFSShellHelper24.dll) This module provides supplementary functionality; please refer to the Helper DLL topic for more information.

Note: This module is not applicable when calling the get_driver_status method.

Module Status Flags

MODULE_STATUS_NOT_PRESENT
Value: 0x00000000
The specified module is not present on the system.

Note: This functionality is only available in Windows.

MODULE_STATUS_STOPPED
Value: 0x00000001
The specified module is in the Stopped state.

Note: This functionality is only available in Windows.

MODULE_STATUS_RUNNING
Value: 0x00000004
The specified module is loaded and running.

Note: This functionality is only available in Windows.

Mounting Point Flags in Windows

STGMP_SIMPLE
Value: 0x00010000
Create a simple mounting point. Simple mounting points may be local or global; and when local, can be made visible in either the current user session or another one.

This flag cannot be combined with STGMP_MOUNT_MANAGER or STGMP_NETWORK, and is implied if neither of those flags are present.

STGMP_MOUNT_MANAGER
Value: 0x00020000
Create a mounting point that appears to the system as a physical device. When the storage_type property is set to STGT_DISK_PNP, mounting points created using the system mount manager appear as physical devices in the Disk Management snap-in of the Microsoft Management Console (mmc.exe).

This flag is a necessary prerequisite for creating a folder mounting point, which makes a drive accessible via an otherwise empty directory on another NTFS volume.

This flag cannot be combined with STGMP_SIMPLE, STGMP_NETWORK, or STGMP_LOCAL.

Only one mounting point of this type can be added to a virtual drive.

An application cannot add a STGMP_MOUNT_MANAGER mounting point for a virtual drive created in a Docker container.

STGMP_NETWORK
Value: 0x00040000
Create a network mounting point. Network mounting points can be further configured using the various STGMP_NETWORK_* flags described below. Applications that plan to make use of network mounting points must be sure to install the Helper DLL before doing so, otherwise Windows File Explorer will not correctly recognize the "network" drive.

This flag cannot be combined with STGMP_SIMPLE or STGMP_MOUNT_MANAGER.

When a virtual drive is created in a Docker container by an application running on the host, it cannot add a mounting point of STGMP_NETWORK type. If an application is running in the container, STGMP_NETWORK type may be used.

STGMP_LOCAL
Value: 0x10000000
Specifies that a local mounting point should be created. This flag specifies that a local mounting point should be created rather than a global one. When this flag is set, applications must also pass an appropriate value for the add_mounting_point method's AuthenticationId parameter.

Passing 0 for AuthenticationId will make the mounting point visible in the current user session. To make the mounting point visible in a different user session instead, pass the target session's Authentication ID.

This flag is valid when combined with STGMP_SIMPLE or STGMP_NETWORK; it cannot be combined with STGMP_MOUNT_MANAGER. Please note that a mounting point can be made available to other computers as a network share, and network shares are always globally visible on the local machine, even if this flag is set.

STGMP_NETWORK_ALLOW_MAP_AS_DRIVE
Value: 0x00000001
Indicates that users may assign a drive letter to the share (e.g., using the 'Map network drive...' context menu item in Windows File Explorer).
STGMP_NETWORK_HIDDEN_SHARE
Value: 0x00000002
Indicates that the share should be skipped during enumeration. Such shares are only accessible when their name is already known to the accessor.
STGMP_NETWORK_READ_ACCESS
Value: 0x00000004
Makes a read-only share available for the mounting point. When this flag is specified, the <Server Name> part of the MountingPoint parameter value must be empty. Please refer to the Mounting Points topic for more information. This flag makes the struct use the Windows API's NetShareAdd function. As per MSDN, "Only members of the Administrators, System Operators, or Power Users local group can add file shares with a call to the NetShareAdd function."
STGMP_NETWORK_WRITE_ACCESS
Value: 0x00000008
Makes a read/write share available for the mounting point. When this flag is specified, the <Server Name> part of the MountingPoint parameter value must be empty. Please refer to the Mounting Points topic for more information. This flag makes the struct use the Windows API's NetShareAdd function. As per MSDN, "Only members of the Administrators, System Operators, or Power Users local group can add file shares with a call to the NetShareAdd function."
STGMP_NETWORK_CLAIM_SERVER_NAME
Value: 0x00000010
Specifies that the server name is unique. When this flag is specified, the driver handles IOCTL_REDIR_QUERY_PATH[_EX] requests by instructing the OS to direct all requests going to the <Server Name> part of the MountingPoint parameter's value to the driver instead.

This flag should be used when the <Server Name> is unique within the local system (e.g., when the application's name is used). Using this flag allows the system to avoid delays caused by certain network requests made by various processes.

This flag is also required for "net view" command to be able to show the share in the list.
STGMP_DRIVE_LETTER_NOTIFY_ASYNC
Value: 0x20000000
Causes the method to return immediately without waiting for mounting notifications to be sent to the system.
STGMP_AUTOCREATE_DRIVE_LETTER
Value: 0x40000000
Tells the struct that it should assign the drive letter automatically. When this flag is specified, the struct will automatically assign a drive letter from the list of available letters. The assigned letter is added to the end of the list of mounting points, and can be retrieved from there.

Do not include a drive letter in the MountingPoint parameter's value when specifying this flag.

RequestedInfo Flags

FILEINFO_EA_SIZE
Value: 0x0400
Ea size is requested.
FILEINFO_REAL_NAME
Value: 0x0040
File's actual name is requested. In an on_enumerate_directory event handler, store the name of the file or directory in the FileName parameter. In a on_get_file_info event handler, store the name of the file or directory in the RealFileName parameter. Refer to the corresponding event's help topic for more details.
FILEINFO_SHORT_NAME
Value: 0x0200
Short name is requested.
FILEINFO_TIME
Value: 0x0004
File times are requested.
FILEINFO_SIZE
Value: 0x0008
File size is requested.
FILEINFO_ATTR
Value: 0x0010
File attributes are requested.
FILEINFO_FILEID
Value: 0x0020
File Id is requested. This flag is used when use_file_ids is true.
FILEINFO_REPARSE_TAG
Value: 0x0080
File Reparse Tag is requested. This flag is used when use_reparse_points is true. The reparse tag must be provided if file attributes indicate that the file or directory is a reparse point.

Desired Access Flags

STG_DACCESS_READ
Value: 0x00000001
Grant/deny read access.
STG_DACCESS_WRITE
Value: 0x00000002
Grant/deny write access.
STG_DACCESS_READWRITE
Value: 0x00000003
Grant/deny read and write access.

File Attributes

FILE_SYS_ATTR_READ_ONLY
Value: 0x00000001
The file is read-only. Applications can read the file, but cannot write to it or delete it. This attribute is not honored on directories.
FILE_SYS_ATTR_HIDDEN
Value: 0x00000002
The file or directory is hidden. The file is not included in an ordinary directory listing.
FILE_SYS_ATTR_SYSTEM
Value: 0x00000004
A file or directory that the operating system uses a part of, or uses exclusively.
FILE_SYS_ATTR_DIRECTORY
Value: 0x00000010
The entry is a directory.
FILE_SYS_ATTR_ARCHIVE
Value: 0x00000020
The entry is an archive file or directory. Applications typically use this attribute to mark files for backup or removal.
FILE_SYS_ATTR_NORMAL
Value: 0x00000080
A file doesn't have other attributes set. This attribute is valid only when used alone.
FILE_SYS_ATTR_TEMPORARY
Value: 0x00000100
A file that is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because typically, an application deletes a temporary file after the handle is closed. In that scenario, the system can entirely avoid writing the data. Otherwise, the data are written after the handle is closed.
FILE_SYS_ATTR_SPARSE_FILE
Value: 0x00000200
A file that is a sparse file.
FILE_SYS_ATTR_REPARSE_POINT
Value: 0x00000400
A file that is a reparse point or a symbolic link.
FILE_SYS_ATTR_COMPRESSED
Value: 0x00000800
A file or directory that is compressed. For a file, all of the data in the file are compressed. For a directory, compression is the default for newly created files and subdirectories. A filesystem implementation can make use of this attribute by setting the support_compressed_attribute property to true and then properly handling the on_get_file_info, on_enumerate_directory, and on_set_file_attributes events.
FILE_SYS_ATTR_OFFLINE
Value: 0x00001000
The data of a file are not available immediately. This attribute indicates that the file data are physically moved to offline storage.
FILE_SYS_ATTR_NOT_CONTENT_INDEXED
Value: 0x00002000
The file or directory is not to be indexed by the content indexing service.
FILE_SYS_ATTR_ENCRYPTED
Value: 0x00004000
A file or directory that is encrypted. For a file, all data streams in the file are encrypted. For a directory, encryption is the default for newly created files and subdirectories.

Note: This flag is used by NTFS and the OS sends undocumented requests to the filesystem based on this flag. The flag should not be used for files in custom filesystem implementations.

FILE_SYS_ATTR_VIRTUAL
Value: 0x00010000
Reserved.

Note: This flag is reserved by the OS and should not be used for files in custom filesystem implementations.

FILE_SYS_ATTR_RECALL_ON_OPEN
Value: 0x00040000
The file or directory has no physical representation on the local system; the item is virtual. Opening the item will be more expensive than normal (e.g., it will cause at least some of it to be fetched from a remote store). This flag is reported by filesystems during directory enumerations.

File Desired Access Flags

DESIRED_ACCESS_FILE_LIST_DIRECTORY
Value: 0x00000001
For a directory, the right to list the contents of the directory.
DESIRED_ACCESS_FILE_READ_DATA
Value: 0x00000001
For a file object, the right to read the corresponding file data. For a directory object, the right to read the corresponding directory data.
DESIRED_ACCESS_FILE_ADD_FILE
Value: 0x00000002
For a directory, the right to create a file in the directory.
DESIRED_ACCESS_FILE_WRITE_DATA
Value: 0x00000002
For a file object, the right to write data to the file. For a directory object, the right to create a file in the directory
DESIRED_ACCESS_FILE_ADD_SUBDIRECTORY
Value: 0x00000004
For a directory, the right to create a subdirectory.
DESIRED_ACCESS_FILE_APPEND_DATA
Value: 0x00000004
For a file object, the right to append data to the file. (For local files, write operations will not overwrite existing data if this flag is specified without FILE_WRITE_DATA.) For a directory object, the right to create a subdirectory (FILE_ADD_SUBDIRECTORY).
DESIRED_ACCESS_FILE_READ_EA
Value: 0x00000008
The right to read extended file attributes.
DESIRED_ACCESS_FILE_WRITE_EA
Value: 0x00000010
The right to write extended file attributes.
DESIRED_ACCESS_FILE_EXECUTE
Value: 0x00000020
For a native code file, the right to execute the file. This access right given to scripts may cause the script to be executable, depending on the script interpreter.
DESIRED_ACCESS_FILE_DELETE_CHILD
Value: 0x00000040
For a directory, the right to delete a directory and all the files it contains, including read-only files.
DESIRED_ACCESS_FILE_READ_ATTRIBUTES
Value: 0x00000080
The right to read file attributes.
DESIRED_ACCESS_FILE_WRITE_ATTRIBUTES
Value: 0x00000100
The right to write file attributes.
DESIRED_ACCESS_READ_CONTROL
Value: 0x00020000
The right to read the information in the file or directory object's security descriptor. This does not include the information in the SACL.
DESIRED_ACCESS_STANDARD_RIGHTS_READ
Value: 0x00020000
Includes READ_CONTROL, which is the right to read the information in the file or directory object's security descriptor. This does not include the information in the SACL.
DESIRED_ACCESS_STANDARD_RIGHTS_WRITE
Value: 0x00020000
Same as STANDARD_RIGHTS_READ
DESIRED_ACCESS_STANDARD_RIGHTS_EXECUTE
Value: 0x00020000
Same as STANDARD_RIGHTS_READ
DESIRED_ACCESS_SYNCHRONIZE
Value: 0x00100000
The right to use the object for synchronization. This enables a thread to wait until the object is in the signaled state. Some object types do not support this access right.
DESIRED_ACCESS_FILE_ALL_ACCESS
Value: 0x001F01FF
All possible access rights for a file.
DESIRED_ACCESS_FILE_GENERIC_READ
Value: 0x00120089
A combinarion of flags that allow reading of the file. Note: Don't match received values against this flag. Instead, use flags that specify the rights that you want to verify or add/remove.
DESIRED_ACCESS_FILE_GENERIC_WRITE
Value: 0x00120116
A combinarion of flags that allow modifications to the file. Note: Don't match received values against this flag. Instead, use flags that specify the rights that you want to verify or add/remove.
DESIRED_ACCESS_FILE_GENERIC_EXECUTE
Value: 0x001200A0
A combinarion of flags that allow execution of the file. Note: Don't match received values against this flag. Instead, use flags that specify the rights that you want to verify or add/remove.

Creation Disposition flags

FILE_DISPOSITION_CREATE_NEW
Value: 0x00000001
Creates a new file, only if it does not already exist. If the specified file exists, the operation fails with an "already exists" error.
FILE_DISPOSITION_CREATE_ALWAYS
Value: 0x00000002
Creates a new file, always. If the specified file exists and is writable, the system overwrites the file. If the specified file does not exist and is a valid path, a new file is created.
FILE_DISPOSITION_OPEN_EXISTING
Value: 0x00000003
Opens a file, only if it exists If the specified file does not exist, opening fails.
FILE_DISPOSITION_OPEN_ALWAYS
Value: 0x00000004
Opens a file, always. If the specified file exists, the operation succeeds. If the specified file does not exist and is a valid path to a writable location, the a file is created.
FILE_DISPOSITION_TRUNCATE_EXISTING
Value: 0x00000005
Opens a file and truncates it so that its size is zero bytes, only if it exists. If the specified file does not exist, the operation fails with a "file not found" error.

Share Modes

FILE_SYS_SHARE_READ
Value: 0x00000001
Enables subsequent open operations on a file to request read access. Otherwise, other processes cannot open the file if they request read access. If this flag is not specified, but the file has been opened for read access, file creation or opening fails.
FILE_SYS_SHARE_WRITE
Value: 0x00000002
Enables subsequent open operations on a file to request write access. Otherwise, other processes cannot open the file if they request write access. If this flag is not specified, but the file has been opened for write access or has a file mapping with write access, file creation or opening fails.
FILE_SYS_SHARE_DELETE
Value: 0x00000004
Enables subsequent open operations on a file to request delete access. Otherwise, other processes cannot open the file if they request delete access. If this flag is not specified, but the file has been opened for delete access, the function fails.

Note: Delete access allows both delete and rename operations.

Storage Type Values

STGT_DISK
Value: 0x00000000
Create a regular disk device.
STGT_CDROM
Value: 0x00000001
Create a CD-ROM or DVD device.
STGT_DISK_PNP
Value: 0x00000003
Create a plug-and-play storage device. Important: The CBFS Connect system driver must be installed in PnP mode for this option to function properly.

Storage Characteristics Flags

STGC_FLOPPY_DISKETTE
Value: 0x00000001
The storage is a floppy disk device. This flag is not supported when storage_type is set to STGT_DISK_PNP.
STGC_READONLY_DEVICE
Value: 0x00000002
The storage is a read-only device.
STGC_WRITE_ONCE_MEDIA
Value: 0x00000008
The storage device's media can only be written to once. This flag is not supported when storage_type is set to STGT_DISK_PNP.
STGC_REMOVABLE_MEDIA
Value: 0x00000010
The storage device's media is removable. Users may remove the storage media from the virtual drive at any time. (Note that this flag does not indicate that the virtual drive itself is removable.)
STGC_AUTOCREATE_DRIVE_LETTER
Value: 0x00002000
The system should automatically create a drive letter for the storage device. Deprecated: Include the STGMP_AUTOCREATE_DRIVE_LETTER flag in the value passed for the add_mounting_point method's Flags parameter instead.

When this flag is present, the storage_guid property must be set. This flag only works when storage_type is set to STGT_DISK_PNP.

STGC_SHOW_IN_EJECTION_TRAY
Value: 0x00004000
The storage device should be shown in the 'Safely Remove Hardware and Eject Media' menu in the system notification area (system tray). This flag only works when storage_type is set to STGT_DISK_PNP.
STGC_ALLOW_EJECTION
Value: 0x00008000
The storage device can be ejected. Users may eject the virtual drive at any time. When the virtual drive is ejected, it is destroyed.

This flag only works when storage_type is set to STGT_DISK_PNP.

STGC_RESERVED_1
Value: 0x00010000
Reserved, do not use.
STGC_RESERVED_2
Value: 0x00020000
Reserved, do not use.

SetFileAttributes event origins

SETFA_ORIGIN_CREATE_FILE
Value: 0x0000
The attributes are set as a part of a file create/open operation.
SETFA_ORIGIN_SET_INFORMATION
Value: 0x0006
The attributes are set via the SetFileAttributes or NtSetInformationFile function.
SETFA_ORIGIN_FSCTL
Value: 0x000d
A file's Compressed state is changed using one of the *DeviceIOControl functions.
SETFA_ORIGIN_CLEANUP
Value: 0x0012
A handle to the file is being closed and its attributes are updated .

Possible Lock operation commands

FUSE_GETLK
Value: 0x0005
The lock owner is to be retrieved. This command is not used in Windows. In Linux, the process identifier (PID) of the lock owner must be returned. The constant is the same as the F_GETLK constant used in Linux.
FUSE_SETLK
Value: 0x0006
Set lock. If the lock cannot be set immediately, return immediately with an error (EAGAIN and EACCES are recommended). The constant is the same as the F_SETLK constant used in Linux.
FUSE_SETLKW
Value: 0x0007
Set lock and wait. If the lock cannot be set immediately, wait until this becomes possible. The constant is the same as the F_SETLKW constant used in Linux.

Possible Lock operation types

FUSE_RDLCK
Value: 0x0000
Read lock should be acquired. Other applications may read from the locked range but not write to it. The constant is the same as the F_RDLCK constant used in Linux.
FUSE_WRLCK
Value: 0x0001
Write lock should be acquired. No other application may write to the locked range. The constant is the same as the F_WRLCK constant used in Linux.
FUSE_UNLCK
Value: 0x0002
The lock should be released. The constant is the same as the F_UNLCK constant used in Linux.

Cache Check and Repair Flags

CACHE_CHECK_NO_RECREATE_VAULT
Value: 0x00000000
If the vault is damaged beyond repair, report an error. When this flag is used, the check_and_repair will return an error if the vault could not be repaired.
CACHE_CHECK_RECREATE_VAULT
Value: 0x00000001
If the vault is damaged beyond repair, recreate the vault automatically. When this flag is used, the check_and_repair will delete the damaged vault and create a new one instead.

Cache Cache Operation

CACHE_OP_IDLE
Value: 0
The cache is idle.
CACHE_OP_CLEANUP
Value: 2
Cache cleanup is being performed.
CACHE_OP_COMPACT
Value: 3
The cache's storage file is being compacted.
CACHE_OP_READ
Value: 4
The cache is reading some file's data.
CACHE_OP_WRITE
Value: 5
The cache is writing some file's data.

CBCache Enumeration Mode

ENUM_MODE_ALL
Value: 0
Enumerate all files.
ENUM_MODE_CHANGED
Value: 1
Enumerate files with changed blocks.
ENUM_MODE_UNCHANGED
Value: 2
Enumerate files with no changed blocks.
ENUM_MODE_LOCAL
Value: 4
Enumerate local files. Refer to the Local Files topic for more information.
ENUM_MODE_ORPHAN
Value: 8
Enumerate orphan files. Refer to the Orphan Files topic for more information.
ENUM_MODE_PINNED
Value: 16
Enumerate pinned files.

Cache File Status Kind

FILE_STATUS_CHANGED
Value: 1
Retrieves the value of the Changed state of the file.
FILE_STATUS_UNCHANGED
Value: 2
Retrieves the value of the Unchanged state of the file.
FILE_STATUS_LOCAL
Value: 3
Retrieves the value that indicates whether the file is Local. Refer to the Local Files topic for more information.
FILE_STATUS_ORPHAN
Value: 4
Retrieves the value that indicates whether the file is Orphan. Refer to the Orphan Files topic for more information.
FILE_STATUS_OPEN
Value: 5
Retrieves the value of the Open state of the file.

Cache Flush Action

FLUSH_DELAYED
Value: 0
Flush as usual, taking into account any specified delay. The flush_after_close_delay property specifies the delay. Passing this value to file_close or file_close_ex will cause the method to return immediately; flushing is performed in the background. Passing this value to close_cache has no effect (i.e., the cache is not flushed before being closed).
FLUSH_NONE
Value: 1
Do not flush anything.
FLUSH_IMMEDIATE
Value: 2
Flush immediately. Passing this value to file_close, file_close_ex, and close_cache will cause the method to return only after all flushing operations are complete.

Cache File Flushing Mode

FLUSH_MODE_SYNC
Value: 0
Flush file data synchronously, blocking until finished.
FLUSH_MODE_ASYNC
Value: 1
Flush file data in the background; do not wait until the flush operation completes.
FLUSH_MODE_TEST
Value: 2
Check to see if file data exists and needs to be flushed, but do not actually flush anything.

Cache Flushing Result

FLUSH_RESULT_NOTHING
Value: 0
The file has no data that need flushing.
FLUSH_RESULT_DIRTY
Value: 1
Data in the file need flushing, but no flush operation is running yet.
FLUSH_RESULT_RUNNING
Value: 2
Data in the file are in the process of being flushed.
FLUSH_RESULT_SUCCESS
Value: 3
Data in the file have been flushed successfully.

Cache Prefetch Constants

PREFETCH_NOTHING
Value: 0
Do not prefetch any file data.
PREFETCH_ALL
Value: -1
Prefetch all file data.

Cache Progress Operations

CACHE_PO_CLEANUP
Value: 1
Cache cleanup

Cache Purge Action

PURGE_DELAYED
Value: 0
Purge as usual, taking into account any specified delay. The purge_after_close_delay property specifies the delay. Passing this value to file_close or file_close_ex will cause the method to return immediately; purging is performed in the background. Passing this value to close_cache has no effect; the cache is not purged before being closed.
PURGE_NONE
Value: 1
Do not purge anything.
PURGE_IMMEDIATE
Value: 2
Purge immediately. Passing this value to file_close, file_close_ex, or close_cache will cause the method to return only after all purging operations are complete.

ReadData/WriteData Event Flags

RWEVENT_IN_PROGRESS
Value: 0x00000001
A file's data are being transferred into or out of the cache.
RWEVENT_CANCELED
Value: 0x00000002
A data transfer has been canceled for some reason.
RWEVENT_WHOLE_FILE
Value: 0x00000004
The entire file is being transferred.
RWEVENT_CONTINUOUS_STARTED
Value: 0x00000010
A continuous transfer has started.
RWEVENT_CONTINUOUS_RESTARTED
Value: 0x00000020
A continuous transfer has restarted from the beginning.
RWEVENT_CONTINUOUS_FINISHED
Value: 0x00000040
A continuous transfer is finishing (i.e., the current block is the final one).
RWEVENT_RANDOM_STARTED
Value: 0x00000100
A random-access transfer has started.
RWEVENT_RANDOM_FINISHED
Value: 0x00000200
A random-access transfer is finishing (i.e., the current block is the final one).
RWEVENT_BEFORE_END
Value: 0x00001000
The current transfer will finish before the end of the file.
RWEVENT_TIL_END
Value: 0x00002000
The current transfer will last until the end of the file.

Reading and Writing Capability Flags (Position Related)

RWCAP_POS_SEQUENTIAL_FROM_BOF
Value: 0x00000001
No random access allowed; read/write operations must start at the beginning of a file. When this flag is used in writing capabilities, the struct can initiate reading of missing data before writing the changes to build the complete dataset, which is required for correct write operations.
RWCAP_POS_BLOCK_MULTIPLE
Value: 0x00000004
Reading/writing is possible at positions that are multiple of the corresponding block size. The read and write block sizes are specified by the read_block_size and write_block_size properties . When this flag is used in writing capabilities, the struct can initiate reading of missing data before writing the changes to build the complete dataset, which is required for correct write operations.
RWCAP_POS_RANDOM
Value: 0x00000008
Reading/writing is possible at any position. When this flag is used, other flags can still alter the positions at which reading/writing are possible.
RWCAP_POS_SUPPL_ONLY_WITHIN_FILE
Value: 0x00000010
File position must remain in the range: 0 <= FilePos < FileSize

Reading and Writing Capability Flags (Size Related)

RWCAP_SIZE_WHOLE_FILE
Value: 0x00000100
Only whole-file reads/writes are possible; partial reads/writes are not supported. Note:
  • The read_block_size and write_block_size properties should still be set to reasonable values when using this flag.
  • Use one of the other RWCAP_SIZE_* flags instead of this one if the external storage supports reading subsets of the file.
When this flag is used in writing capabilities, the struct can initiate reading of missing data before writing the changes to build the complete dataset, which is required for correct write operations.
RWCAP_SIZE_FIXED_BLOCKS_WITH_TAIL
Value: 0x00000200
Reads/writes must be done in blocks of a fixed size, except for the last block, which may be of any size. When this flag is used in writing capabilities, the struct can initiate reading of missing data before writing the changes to build the complete dataset, which is required for correct write operations.
RWCAP_SIZE_FIXED_BLOCKS_NO_TAIL
Value: 0x00000400
Reads/writes must be done in blocks of a fixed size, including the last block. Note: Real file sizes, if needed, must be stored elsewhere when using the cache with an external storage medium that has this characteristic.

When this flag is used in writing capabilities, the struct can initiate reading of missing data before writing the changes to build the complete dataset, which is required for correct write operations.

RWCAP_SIZE_ANY
Value: 0x00000800
Reads/writes may be done in blocks of any size.

Reading and Writing Capability Flags (Write Related)

RWCAP_WRITE_APPEND_ONLY
Value: 0x00000002
Append only; write operations must start at the end of a file. To overwrite a file, it must first be truncated, and then written to. (Truncation behavior is defined by the corresponding flags.)
RWCAP_WRITE_SUPPL_NOT_BEYOND_EOF
Value: 0x00000020
File position remain in the range: 0 <= FilePos <= FileSize When writing, appending to the end of the file is supported, but writing at positions past the end of the file is not.
RWCAP_WRITE_TRUNCATES_FILE
Value: 0x00001000
When writes occur, the last data written becomes the new end of the file. Any overwritten data, and any data previously present after the written range, are lost.
RWCAP_WRITE_KEEPS_FILESIZE
Value: 0x00002000
Normal writing behavior (i.e., writes do not alter a file's size, except possibly to expand it).
RWCAP_WRITE_NOT_BEYOND_EOF
Value: 0x00004000
Writes may not extend past the end of a file's current size (i.e., cannot cause a file to grow). Applications may still adjust the file size beforehand.

Resizing Capability Flags

RSZCAP_GROW_TO_ANY
Value: 0x00000001
Files can grow to any size.
RSZCAP_SHRINK_TO_ANY
Value: 0x00000002
Files can shrink to any size.
RSZCAP_GROW_TO_BLOCK_MULTIPLE
Value: 0x00000004
Files can grow to sizes that are a multiple of the block size.
RSZCAP_SHRINK_TO_BLOCK_MULTIPLE
Value: 0x00000008
Files can shrink to sizes that are a multiple of the block size.
RSZCAP_TRUNCATE_ON_OPEN
Value: 0x00000010
The external storage (or application itself) supports truncating a file when it is opened for writing.
RSZCAP_TRUNCATE_AT_ZERO
Value: 0x00000020
The external storage (or application itself) supports truncating a file to zero at any time (not just when it is being opened).

ReadData/WriteData Event Result Codes

RWRESULT_SUCCESS
Value: 0x00000000
Success. Returning this code indicates that all data were successfully transferred.
RWRESULT_PARTIAL
Value: 0x00000080
Partial success. Returning this code indicates that some, but not all, data were successfully transferred. i.e., when BytesRead < BytesToRead (for on_read_data), or BytesWritten < BytesToWrite (for on_write_data).
RWRESULT_RANGE_BEYOND_EOF
Value: 0x00000081
Specified range is beyond the end of the file (EOF). For the on_read_data event, returning this code indicates to the cache that there is no need to request data beyond (Position + BytesRead), and that the tail should be zeroed instead.
RWRESULT_FILE_MODIFIED_EXTERNALLY
Value: 0x00000082
The specified file's size was modified externally. Returning this code indicates that the operation was not completed successfully because of this conflicting situation.
RWRESULT_FILE_MODIFIED_LOCALLY
Value: 0x00000083
The requested file's size was modified locally.
RWRESULT_FAILURE
Value: 0x0000008D
The operation failed for some transient reason. Returning this code indicates that, even though the current request failed, it is safe to continue sending requests for both the specified file and others. (Other operations may continue.)
RWRESULT_FILE_FAILURE
Value: 0x0000008E
The operation failed for some external-file-related reason. Returning this code indicates that some failure related to the external file has occurred, and it is expected that any further requests made against that file will also fail. The struct will not send any more requests for the specified file until the file-specific error is reset as described in Reporting Transfer Errors.
RWRESULT_PERMANENT_FAILURE
Value: 0x0000008F
The operation failed for some external-storage-related reason. Returning this code indicates that some failure related to the external storage has occurred, and it is expected that all further requests will also fail. The struct will not send any more requests for any file until the global error is reset as described in Reporting Transfer Errors.

NFS Access Flags

ACCESS4_READ
Value: 0x00000001
Read data from a file or read a directory.
ACCESS4_LOOKUP
Value: 0x00000002
Look up a name in a directory (no meaning for non-directory objects).
ACCESS4_MODIFY
Value: 0x00000004
Rewrite existing file data or modify existing directory entries.
ACCESS4_EXTEND
Value: 0x00000008
Write new data or add directory entries.
ACCESS4_DELETE
Value: 0x00000010
Delete an existing directory entry.
ACCESS4_EXECUTE
Value: 0x00000020
Execute a file (no meaning for a directory).

NFS Open Type Constants

OPEN4_NOCREATE
Value: 0
Indicates the file should be opened if it exists, but if the file does not exist, the file should not be created. In this case, the operation should fail with the error NFS4ERR_NOENT.
OPEN4_CREATE
Value: 1
Indicates the file should be created using the method specified by the CreateMode parameter.

NFS Create Mode Constants

UNCHECKED4
Value: 0
Indicates the file should be created without checking for the existence of a duplicate file in the associated directory.
GUARDED4
Value: 1
Indicates the file should be created, but the server should check for the presence of a duplicate file before doing so. If the file exists, the open operation should fail with the error NFS4ERR_EXIST.
EXCLUSIVE4
Value: 2
Indicates the file should be exclusively created, or created with the condition that no other client should be concurrently creating or opening a file with the same name. If a file with the same name does exist, the operation should fail with the error NFS4ERR_EXIST.

NFS Share Access Flags

OPEN4_SHARE_ACCESS_READ
Value: 0x00000001
Indicates the client desires read-only access to the file.
OPEN4_SHARE_ACCESS_WRITE
Value: 0x00000002
Indicates the client desires write-only access to the file.
OPEN4_SHARE_ACCESS_BOTH
Value: 0x00000003
Indicates the client desires both read and write access to the file.

NFS Share Deny Flags

OPEN4_SHARE_DENY_NONE
Value: 0x00000000
Indicates no denial of share access to other clients while the file is open.
OPEN4_SHARE_DENY_READ
Value: 0x00000001
Indicates denial of read access to other clients while the file is open.
OPEN4_SHARE_DENY_WRITE
Value: 0x00000002
Indicates denial of write access to other clients while the file is open.
OPEN4_SHARE_DENY_BOTH
Value: 0x00000003
Indicates denial of both read and write access to other clients while the file is open.

NFS Lock Type Constants

READ_LT
Value: 1
Indicates a non-blocking read lock.
WRITE_LT
Value: 2
Indicates a non-blocking write lock.
READW_LT
Value: 3
Indicates a blocking read lock.
WRITEW_LT
Value: 4
Indicates a blocking write lock.

NFS Stable Constants

UNSTABLE4
Value: 0
Indicates the application is free to commit any part of the data written and filesystem metadata before returning any results.
DATA_SYNC4
Value: 1
Indicates the application must commit all of the data to stable storage and enough filesystem metadata to retrieve the data before returning any results.
FILE_SYNC4
Value: 2
Indicates the application must commit the data written plus all filesystem metadata to stable storage before returning any results.

NFS Result Codes

NFS4_OK
Value: 0
Indicates successful completion of the operation, in that all constituent operations completed without error.
NFS4ERR_ACCESS
Value: 13
Indicates that permission has been denied. The client does not have the correct permission to perform the requested operation. Note this differs from NFS4ERR_PERM which is constrained to owner or privileged user permission failures.
NFS4ERR_ADMIN_REVOKED
Value: 10047
A locking state of any type has been revoked due to administrative interaction, possibly while the lease is valid, or because a delegation was revoked because of failure to return it, while the lease was valid.
NFS4ERR_ATTRNOTSUPP
Value: 10032
An attribute specified by the client is not supported by the server. This error must not be returned in the GetAttr event.
NFS4ERR_BADCHAR
Value: 10040
A UTF-8 string contains a character that is not supported by the server in the context in which it is being used.
NFS4ERR_BADNAME
Value: 10041
A name string in a request consisted of valid UTF-8 characters supported by the server, but the name is not supported by the server as a valid name for current operation. An example might be creating a file or directory named ".." on a server whose file system uses that name for links to parent directories. This error should not be returned due to a normalization issue in a string. When a file system keeps names in a particular normalization form, it is the server's responsibility to do the appropriate normalization, rather than rejecting the name.
NFS4ERR_BADOWNER
Value: 10039
This error is returned when an owner or owner_group attribute value cannot be translated to a local representation.
NFS4ERR_BADTYPE
Value: 10007
An attempt was made to create an object with an inappropriate type specified.
NFS4ERR_BAD_COOKIE
Value: 10003
This error should be returned if the client provides an invalid or unusable cookie in the ReadDir event.
NFS4ERR_BAD_RANGE
Value: 10042
The range specified in the Lock event is not appropriate to the allowable range of offsets for the server. For example, this error results when a server that only supports 32-bit ranges receives a range that cannot be handled by that server.
NFS4ERR_DEADLOCK
Value: 10045
The server has been able to determine a file locking deadlock condition for a blocking lock request.
NFS4ERR_DELAY
Value: 10008
For some reason, the application could not process this operation in what was deemed a reasonable time.
NFS4ERR_DENIED
Value: 10010
An attempt to lock a file is denied. Note this may be a temporary condition.
NFS4ERR_DQUOT
Value: 69
Either the resource (quota) hard limit has been exceeded for the server, or the client's resource limit on the server has been exceeded.
NFS4ERR_EXIST
Value: 17
A file system object of the specified target name already exists. Applicable when creating or renaming a file during the Open or Rename operations.
NFS4ERR_EXPIRED
Value: 10011
This error indicates a locking state of any type has been revoked or released due to cancellation of the client's lease, either immediately upon lease expiration, or following a later request for a conflicting lock.
NFS4ERR_FBIG
Value: 27
The file system object is too large. The operation would have caused a file system object to grow beyond the server's limit.
NFS4ERR_FILE_OPEN
Value: 10046
The operation is not allowed because a file system object involved in the operation is currently open. Servers may disallow removing or renaming open file system objects.
NFS4ERR_GRACE
Value: 10013
The server is in its recovery or grace period, which should at least match the lease period of the server. A locking request other than a reclaim could not be granted during that period.
NFS4ERR_INVAL
Value: 22
The arguments for this operation are determined to be invalid by the application.
NFS4ERR_IO
Value: 5
This indicates an unrecoverable I/O error has occurred for the file system.
NFS4ERR_ISDIR
Value: 21
The current object designates a directory when the current operation does not allow a directory to be accepted as the target of this operation.
NFS4ERR_LEASE_MOVED
Value: 10031
A lease being renewed is associated with a file system that has been migrated to a new server.
NFS4ERR_LOCKED
Value: 10012
A READ or WRITE operation was attempted on a file where there was a conflict between the I/O and an existing lock. A conflict may occur if a) there is a share reservation inconsistent with the I/O being done, or b) the range to be read or written intersects an existing mandatory byte-range lock.
NFS4ERR_LOCKS_HELD
Value: 10037
An operation was prevented due to the existence of a lock on the target object.
NFS4ERR_LOCK_NOTSUPP
Value: 10043
A locking request was attempted that would require the upgrade or downgrade of a lock range already held by the owner when the server does not support atomic upgrade or downgrade of locks.
NFS4ERR_LOCK_RANGE
Value: 10028
A lock request is operating on a range that partially overlaps a currently held lock for the current lock-owner and does not precisely match a single such lock, where the server does not support this type of request and thus does not implement POSIX locking semantics.
Value: 31
The request would have caused the server's limit for the number of hard links a file system object may have to be exceeded.
NFS4ERR_NAMETOOLONG
Value: 63
This is returned when the filename in an operation exceeds the server's implementation limit.
NFS4ERR_NOENT
Value: 2
This indicates no such file or directory. The file system object referenced by the name specified does not exist.
NFS4ERR_NOSPC
Value: 28
This indicates no space left on the device. The operation would have caused the server's file system to exceed its limit.
NFS4ERR_NOTDIR
Value: 20
Indicates that the current object is not a directory for an operation in which a directory is required.
NFS4ERR_NOTEMPTY
Value: 66
An attempt was made to remove a directory that was not empty.
NFS4ERR_NOTSUPP
Value: 10004
The operation is not supported, either because the operation is an optional one and is not supported by this server or because the operation must not be implemented in the current minor version.
NFS4ERR_NO_GRACE
Value: 10033
The server cannot guarantee that it has not granted state to another client that may conflict with this client's state. No further reclaims from this client will succeed.
NFS4ERR_OPENMODE
Value: 10038
The client attempted a Read, Write, Lock, or other operation not available to the client (e.g., writing to a file opened only for read).
NFS4ERR_PERM
Value: 1
This indicates that the requester is not the owner. The operation was not allowed because the caller is neither a privileged user nor the owner of the target of the operation.
NFS4ERR_RECLAIM_BAD
Value: 10034
The server cannot guarantee that it has not granted state to another client that may conflict with the requested state. However, this applies only to the state requested in this call; further reclaims may succeed. This result code is only valid for Lock and Open operations.
NFS4ERR_RECLAIM_CONFLICT
Value: 10035
The reclaim attempted by the client conflicts with a lock already held by another client. Unlike NFS4ERR_RECLAIM_BAD, this can only occur if one of the clients misbehaved. This result code is only valid for Lock and Open operations.
NFS4ERR_ROFS
Value: 30
This indicates a read-only file system. A modifying operation was attempted on a read-only file system.
NFS4ERR_SERVERFAULT
Value: 10006
An error that does not map to any of the specific legal NFSv4 protocol error values occurred on the server.
NFS4ERR_SHARE_DENIED
Value: 10015
An attempt to open a file with a share reservation has failed due to an existing share conflict.
Value: 10029
The current object designates a symbolic link when the current operation does not allow a symbolic link as the target.
NFS4ERR_TOOSMALL
Value: 10005
This error is used where an operation returns a variable amount of data, with a limit specified by the client. Where the data returned cannot be fitted within the limit specified by the client, this error results.
NFS4ERR_XDEV
Value: 18
This indicates an attempt to perform an operation, such as linking, has inappropriately crossed a boundary (e.g., across a file system boundary).