Discuss this help topic in CBFS Forum

How To Start using the API

You can use Mapper sample as a template for your virtual disk code. Just remove WinAPI calls or Stream object operations from the callback / event handlers and replace them with your own logic.

If you start from scratch, here's the sequence of calls to CallbackFileSystem API to use:

  1. Call SetRegistrationKey to set the license key and enable Callback File System. Callback File System doesn't work without the license key (either registered or evaluation). You can request the evaluation key via the request form.
  2. Install the driver if it has not been installed yet. You don't need to call Install every time your application is started. In production you can install the driver by calling Installer DLL functions from your application installation script.
  3. Call Initialize method to initialize CBFS. Initialize method must be called on each application start.
  4. Create a virtual disk device using CreateStorage method.
  5. Call MountMedia method to "insert a disk" to the virtual device.
  6. Create one or more mounting points (this can be drive letter, UNC path or directory on existing NTFS drive). You can add several mounting points to one disk device using AddMountingPoint method.
  7. Now it's time to ensure, that the driver can read and write from / to the storage. You must implement handlers for events present in CallbackFileSystem class. Some events are optional and they are marked as such. All other events are mandatory.
  8. When you finish work with the disk, unmount it.
  9. You can change the "disks" without deleting and recreating a disk device using MountMedia and UnmountMedia methods.
  10. Delete the storage from the system using DeleteStorage method.
  11. To remove the driver from the system, call Uninstall method.

Discuss this help topic in CBFS Forum