Which Dokan callbacks handle Explorer folder Copy/Paste in DokanNet?

9 views
Skip to first unread message

Gray Jumba

unread,
Sep 27, 2025, 9:01:02 AMSep 27
to Dokan

Hi! Using C# + DokanNet, I’m seeing a paste of a folder create only the top folder—no children get created.

What I expect

  • No special “copy” callback, just a sequence:

    • CreateFile(dest-folder, Directory + CreateNew/OpenOrCreate)

    • FindFiles(source-folder) (enumerate)

    • Then recursively CreateFile for each child (and WriteFile/Flush for files)

What I observe

  • Logs show CreateFile for the dest folder and FindFiles on the source, but I don’t get CreateFile for child files/subfolders afterward; Explorer progress jumps to 100% and stops.

Questions

  1. Is the above sequence correct for Explorer folder copy?

  2. Which return codes/flags during CreateFile (dir) are essential so Explorer continues to recurse?

  3. Can an early FileNotFound or wrong status on parent/dir CreateFile cause Explorer to skip issuing child CreateFiles?

  4. Any must-implement ops for copy to proceed reliably (SetFileTime, SetFileAttributes, SetEndOfFile, etc.)?

Env

  • Dokan/DokanNet: [version]

  • Windows: [version]

  • .NET: [version]

Thanks!

Liryna

unread,
Sep 28, 2025, 4:50:58 PMSep 28
to Dokan
Hi,

This is usually due to Explorer receiving information during the GetFileInformation or other IO which isn't expected and prevent to the creation of a child.
For example, the  GetFileInformation on the newly created folder could have (wrongly) the read only attribute or GetFileSecurity has permission to prevent the current user to proceed.
The best to debug is to print all the data returned during the IO you listed and compare with the C# mirror sample.

Procmon is also always a great too to use!

  1. Is the above sequence correct for Explorer folder copy? Yes

  2. Which return codes/flags during CreateFile (dir) are essential so Explorer continues to recurse? The best is to compare with the mirror sample

  3. Can an early FileNotFound or wrong status on parent/dir CreateFile cause Explorer to skip issuing child CreateFiles? Yes

  4. Any must-implement ops for copy to proceed reliably (SetFileTime, SetFileAttributes, SetEndOfFile, etc.)? All should be implemented except stream and  GetFileSecurity / SetFileSecurity.


Hope that help!
Reply all
Reply to author
Forward
0 new messages