Using the API
The sequence of API calls when using CallbackDisk is
- call SetRegistrationKey to set the license key and enable CallbackDisk. CallbackDisk doesn't work without the license key (either registered or evaluation). You can request the evaluation key via request form.
- Install the driver if it has not been installed yet. You don't need to call InstallDriver every time your application is started.
- Create a virtual disk device using CreateStorage method.
- Create one or more mounting points. Mounting point can be a UNC path (eg. "\\.\MyDisk") or a drive letter (eg. "Z:"). You can add several mounting points to one disk device using AddMountingPoint method.
- Now it's time to ensure, that the driver can read and write from / to the storage. You must implement handlers for OnFileRead, OnFileWrite and OnGetFileSize events.
- Call MountMedia method to "insert a disk" to the virtual device.
- The mounted disk image acts much like a regular hard drive, i.e. it is not formatted and you need to format it using system utilities (CallbackDisk doesn't have built-in functions that would implement a file system). You can format the disk to FAT or NTFS using system utilities. If you need sophisticated file system with compression, encryption and other advanced features (and without royalties), take a look at SolFS Driver Edition SDK, which is a superset of CallbackDisk.
- When you finish your work with the disk, unmount it.
- You can change the "disks" without deleting and recreating a disk device using MountMedia and UnmountMedia methods.
- Delete the storage from the system using DeleteStorage method.
- To remove the driver from the system, call UninstallDriver method.