Skip to content

Update Dokan legacy application to Dokany

Rondom edited this page Sep 22, 2016 · 1 revision

Moving your Dokan legacy application to Dokany >= 0.8.0:

  • Change Win32 errors to NTSTATUS. You can use DokanNtStatusFromWin32 to translate Win32 Error codes to the corresponding NtStatus codes (More info and help here)
  • Remove the KeepAlive option that no longer exists.
  • Add Mounted and Unmounted DokanOperations
  • Use new CreateFile -> ZwCreateFile - To get CreateFile parameters from ZwCreateFile, you simply need to call DokanMapKernelToUserCreateFileFlags like this:
DokanMapKernelToUserCreateFileFlags(
      FileAttributes, CreateOptions, CreateDisposition, &fileAttributesAndFlags,
      &creationDisposition);

Dokany 0.7.4 is the last version that is compatible with Dokan legacy. 0.7.4 has lots of fixes that make it more stable than Dokan 0.6.0. You can use it if you don't want to update your code but keep in mind that Dokany does not maintain this version anymore..