Constants
All constants are accessible through the cbfsconnect.Constants class.
Route Cache Flags |
||
CBFS_ROUTE_FILE_READ_ONLY | 0x00000001 |
Causes files to be treated as read-only; all write operations will be automatically denied.
|
CBFS_ROUTE_OPEN_EVENT | 0x00000020 |
Prevents 'open' requests from being routed automatically.
If set, the OpenFile 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 | 0x00000040 |
Prevents 'cleanup' requests from being routed automatically.
If set, the CleanupFile event will fire as usual when such requests arrive. |
CBFS_ROUTE_CLOSE_EVENT | 0x00000080 |
Prevents 'close' requests from being routed automatically.
If set, the CloseFile 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 | 0x00000200 |
Prevents 'enumerate directory' requests from being routed automatically.
If set, the EnumerateDirectory event will fire as usual when such requests arrive. |
CBFS_ROUTE_SET_SECURITY_EVENT | 0x00000400 |
Prevents 'set security' requests from being routed automatically.
If set, the SetFileSecurity event will fire as usual when such requests arrive. |
CBFS_ROUTE_GET_SECURITY_EVENT | 0x00000800 |
Prevents 'get security' requests from being routed automatically.
If set, the GetFileSecurity event will fire as usual when such requests arrive. |
CBFS_ROUTE_SET_FILE_ATTRIBUTES_EVENT | 0x00002000 |
Prevents 'set file attributes' requests from being routed automatically.
If set, the SetFileAttributes event will fire as usual when such requests arrive. |
CBFS_ROUTE_SET_FILE_SIZES_EVENT | 0x00004000 |
Prevents 'set file size' requests from being routed automatically.
If set, the SetFileSize event will fire as usual when such requests arrive. |
CBFS_ROUTE_SET_VALID_DATA_LENGTH_EVENT | 0x00008000 |
Prevents 'set valid data length' requests from being routed automatically.
If set, the OpenFile event will fire as usual when such requests arrive. |
CBFS_ROUTE_CREATE_HARD_LINK_EVENT | 0x00020000 |
Prevents 'create hard link' requests from being routed automatically.
If set, the CreateHardLink event will fire as usual when such requests arrive. |
CBFS_ROUTE_QUERY_QUOTA_EVENT | 0x00040000 |
Prevents 'query quota' requests from being routed automatically.
If set, the QueryQuotas event will fire as usual when such requests arrive. |
CBFS_ROUTE_SET_QUOTA_EVENT | 0x00080000 |
Prevents 'set quota' requests from being routed automatically.
If set, the SetQuotas event will fire as usual when such requests arrive. |
CBFS_ROUTE_CAN_FILE_BE_DELETED_EVENT | 0x00200000 |
Prevents 'can file be deleted' requests from being routed automatically.
If set, the CanFileBeDeleted event will fire as usual when such requests arrive. |
CBFS_ROUTE_IS_DIRECTORY_EMPTY_EVENT | 0x00400000 |
Prevents 'is directory empty' requests from being routed automatically.
If set, the IsDirectoryEmpty event will fire as usual when such requests arrive. |
CBFS_ROUTE_RENAME_EVENT | 0x00800000 |
Prevents 'rename/move' requests from being routed automatically.
If set, the RenameOrMoveFile event will fire as usual when such requests arrive. |
Module Flags |
||
MODULE_PNP_BUS | 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 re-installed anytime this module is added or removed. |
MODULE_DRIVER | 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 | 0x00010000 |
Shell Helper DLL (CBFSShellHelper20.dll)
This module provides supplementary functionality; please refer to the Helper DLL topic for more information. Note: Not applicable when calling the GetDriverStatus method. |
Notify Change Flags |
||
CBFS_NOTIFY_FLAG_ADDED | 0x00000001 |
The specified file or directory has been created.
|
CBFS_NOTIFY_FLAG_REMOVED | 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 | 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 there is a change 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 | 0x00000004 |
The timestamp or other attributes of the specified file or directory have been modified.
|
CBFS_NOTIFY_FLAG_ALLOCATION_SIZE_MODIFIED | 0x00000005 |
The allocation size for the specified file or directory has been modified.
This option is only applicable if CorrectAllocationSizes is false. |
CBFS_NOTIFY_FLAG_MODIFIED_NOT_INVALIDATE | 0x00000006 |
The specified file or directory has been modified, but handles should not be invalidated.
Note that using this option can cause other applications to operate using stale data if they keep the specified file or directory open, since they have no way to know about the external changes. |
Install Flags |
||
INSTALL_REMOVE_OLD_VERSIONS | 0x00000001 |
Uninstall drivers and helper DLLs from previous component versions (e.g., 2017).
|
INSTALL_KEEP_START_TYPE | 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. |
INSTALL_OVERWRITE_SAME_VERSION | 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. |
Uninstall Version Flags |
||
UNINSTALL_VERSION_PREVIOUS | 0x00000001 |
Uninstall modules from previous product versions.
|
UNINSTALL_VERSION_CURRENT | 0x00000002 |
Uninstall modules from the current product version.
|
UNINSTALL_VERSION_ALL | 0x00000003 |
Uninstall modules from all product versions.
|
Module Status Flags |
||
MODULE_STATUS_NOT_PRESENT | 0x00000000 |
The specified module is not present on the system.
|
MODULE_STATUS_STOPPED | 0x00000001 |
The specified module is in the Stopped state.
|
MODULE_STATUS_RUNNING | 0x00000004 |
The specified module is loaded and running.
|
Mounting Point Flags |
||
STGMP_SIMPLE | 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 | 0x00020000 |
Create a mounting point that appears to the system as a physical device.
When the StorageType 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. |
STGMP_NETWORK | 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 Explorer will not correctly recognize the "network" drive. This flag cannot be combined with STGMP_SIMPLE or STGMP_MOUNT_MANAGER. |
STGMP_LOCAL | 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 AddMountingPoint 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 | 0x00000001 |
Indicates that users may assign a drive letter to the share (e.g., using the 'Map network drive...' context menu item in Windows Explorer).
|
STGMP_NETWORK_HIDDEN_SHARE | 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 | 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 class 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 | 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 class 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 | 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 | 0x20000000 |
Causes the method to return immediately without waiting for mounting notifications to be sent to the system.
|
STGMP_AUTOCREATE_DRIVE_LETTER | 0x40000000 |
Tells the component that it should assign the drive letter automatically.
When this flag is specified, the class 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. |
Desired Access Flags |
||
STG_DACCESS_READ | 0x00000001 |
Grant/deny read access.
|
STG_DACCESS_WRITE | 0x00000002 |
Grant/deny write access.
|
STG_DACCESS_READWRITE | 0x00000003 |
Grant/deny read and write access.
|
File Attributes |
||
FILE_SYS_ATTR_READ_ONLY | 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 | 0x00000002 |
The file or directory is hidden.
It is not included in an ordinary directory listing. |
FILE_SYS_ATTR_SYSTEM | 0x00000004 |
A file or directory that the operating system uses a part of, or uses exclusively.
|
FILE_SYS_ATTR_DIRECTORY | 0x00000010 |
The entry is a directory.
|
FILE_SYS_ATTR_ARCHIVE | 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 | 0x00000080 |
A file doesn't have other attributes set.
This attribute is only valid when used alone. |
FILE_SYS_ATTR_TEMPORARY | 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 is written after the handle is closed. |
FILE_SYS_ATTR_SPARSE_FILE | 0x00000200 |
A file that is a sparse file.
|
FILE_SYS_ATTR_REPARSE_POINT | 0x00000400 |
A file that is a reparse point or a symbolic link.
|
FILE_SYS_ATTR_COMPRESSED | 0x00000800 |
A file or directory that is compressed.
For a file, all of the data in the file is compressed. For a directory, compression is the default for newly created files and subdirectories. |
FILE_SYS_ATTR_OFFLINE | 0x00001000 |
The data of a file is not available immediately.
This attribute indicates that the file data is physically moved to offline storage. |
FILE_SYS_ATTR_NOT_CONTENT_INDEXED | 0x00002000 |
The file or directory is not to be indexed by the content indexing service.
|
FILE_SYS_ATTR_ENCRYPTED | 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.
|
FILE_SYS_ATTR_VIRTUAL | 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 | 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 | 0x00000001 |
For a directory, the right to list the contents of the directory.
|
DESIRED_ACCESS_FILE_READ_DATA | 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 | 0x00000002 |
For a directory, the right to create a file in the directory.
|
DESIRED_ACCESS_FILE_WRITE_DATA | 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 | 0x00000004 |
For a directory, the right to create a subdirectory.
|
DESIRED_ACCESS_FILE_APPEND_DATA | 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 | 0x00000008 |
The right to read extended file attributes.
|
DESIRED_ACCESS_FILE_WRITE_EA | 0x00000010 |
The right to write extended file attributes.
|
DESIRED_ACCESS_FILE_EXECUTE | 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 | 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 | 0x00000080 |
The right to read file attributes.
|
DESIRED_ACCESS_FILE_WRITE_ATTRIBUTES | 0x00000100 |
The right to write file attributes.
|
DESIRED_ACCESS_READ_CONTROL | 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 | 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 | 0x00020000 |
Same as STANDARD_RIGHTS_READ
|
DESIRED_ACCESS_STANDARD_RIGHTS_EXECUTE | 0x00020000 |
Same as STANDARD_RIGHTS_READ
|
DESIRED_ACCESS_SYNCHRONIZE | 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 | 0x001F01FF |
All possible access rights for a file.
|
DESIRED_ACCESS_FILE_GENERIC_READ | 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 | 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 | 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 | 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 | 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 | 0x00000003 |
Opens a file, only if it exists
If the specified file does not exist, opening fails. |
FILE_DISPOSITION_OPEN_ALWAYS | 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 | 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 | 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 | 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 | 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.
|
Storage Type Values |
||
STGT_DISK | 0x00000000 |
Create a regular disk device.
|
STGT_CDROM | 0x00000001 |
Create a CD-ROM or DVD device.
|
STGT_DISK_PNP | 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 | 0x00000001 |
The storage is a floppy disk device.
This flag is not supported when StorageType is set to STGT_DISK_PNP. |
STGC_READONLY_DEVICE | 0x00000002 |
The storage is a read-only device.
|
STGC_WRITE_ONCE_MEDIA | 0x00000008 |
The storage device's media can only be written to once.
This flag is not supported when StorageType is set to STGT_DISK_PNP. |
STGC_REMOVABLE_MEDIA | 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 | 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 AddMountingPoint method's Flags parameter instead. When this flag is present, the StorageGUID property must be set. This flag only works when StorageType is set to STGT_DISK_PNP. |
STGC_SHOW_IN_EJECTION_TRAY | 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 StorageType is set to STGT_DISK_PNP. |
STGC_ALLOW_EJECTION | 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 StorageType is set to STGT_DISK_PNP. |
STGC_RESERVED_1 | 0x00010000 |
Reserved, do not use.
|
STGC_RESERVED_2 | 0x00020000 |
Reserved, do not use.
|