Constants

All constants are defined in the cbfsdisk package.

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 (CBDiskShellHelper24.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 GetDriverStatus method.

Install Flags

INSTALL_REMOVE_OLD_VERSIONS
Value: 0x00000001
Uninstall drivers and helper DLLs from previous class 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 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

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

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

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 Disk 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 StorageType 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 StorageType 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 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
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 StorageType 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 StorageType is set to STGT_DISK_PNP.

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