The callbacks (events, delegates) are used in CBFS Disk to let the application provide custom data storage and handling.

The implementor of callback handlers should be aware of the following:

  1. the callback handler procedure must avoid using any file operations in buffered mode (both explicit and implicit). All files, access to which is done from callbacks, should be opened with FILE_FLAG_NO_BUFFERING flag.
  2. no APC (asynchronous procedure calls) should be performed.
Failure to follow the above restrictions will cause the system-wide dead-lock.

We suggest that the application performs all operations asynchronously, i.e. maintains it's own cache and performs all reading/writing to the actual file system outside of the callback procedures.


All callback functions must perform fast in order not to block the whole system. To prevent blocking the driver uses timeouts. If the user-mode process takes too much time to process the callback request, the driver cancels the request and reports error to the OS. The timeout value is set globally as a parameter of MountMedia method.