Skip to content

Update Dokan 1.1.0 application to Dokany 2.0.0

Liryna edited this page Jun 7, 2022 · 8 revisions

Moving from Dokan 1.1.0 to 2.0.0:

This page does not contain the new features / API added in 2.0.0. It just described how to migrate your 1.1.0 Dokan filesystem to 2.0.0. See the Changelog for the added features and API.

  • DokanInit needs to be called before DokanMain and when Dokan is no longer used by your application you will need to call DokanShutdown to release the allocated internal resource by DokanInit.
  • DOKAN_OPTION_ENABLE_FCB_GARBAGE_COLLECTION no longer exists and was enabled by default.
  • DOKAN_OPTION_* values were reassigned. Be sure to use them from dokan.h or update your values.
  • DOKAN_OPTIONS.ThreadCount was replaced by DOKAN_OPTIONS.SingleThread if single thread mode is wanted. Otherwise the library will allocate the number of threads regarding the workload.
  • PFillFindStreamData used by DOKAN_OPERATIONS.FindStreams now returns FALSE if the buffer is full, otherwise TRUE. Also the second parameter is no longer the DOKAN_FILE_INFO but the new pointer FindStreamContext provided by DOKAN_OPERATIONS.FindStreams.
  • DOKAN_OPERATIONS.FindStreams has a new parameter MountPoint that contains the requested mount point at mount time or a possible new assign drive letter if DOKAN_OPTION_MOUNT_MANAGER was used and the requested drive letter was not available.
  • DokanGetMountPointList now returns the new DOKAN_MOUNT_POINT_INFO struct instead of DOKAN_CONTROL which can also be freed by DokanReleaseMountPointList.
  • DokanNotify* functions now require the DOKAN_HANDLE created by the new API DokanCreateFileSystem.
  • Previously FindFilesWithPattern could return STATUS_NOT_IMPLEMENTED and FindFiles would be called right after to process the request. This is no longer the case. If FindFilesWithPattern is assigned to the DOKAN_OPERATIONS struct, it will be called and STATUS_NOT_IMPLEMENTED will fail the request. So if FindFilesWithPattern is not implemented, it must not be assigned to DOKAN_OPERATIONS struct. Note: This has changed in future release see next section.
  • It is now mandatory to provide an DOKAN_OPTIONS.UNCName when DOKAN_OPTION_NETWORK is enabled.

Moving from Dokan 2.x.x to 2.0.5:

  • FindFilesWithPattern Dokan v1 logic where STATUS_NOT_IMPLEMENTED could be returned to force the FindFiles usage and let the library do the filtering is again possible.