dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.2k stars 661 forks source link

Question about preventing dokan delete a file. #1145

Closed Lucasq11 closed 1 year ago

Lucasq11 commented 1 year ago
          @zqlustc Per microsoft documentation, cleanup cannot fail. If delete must fail, it must be during createfile or set delete that everything need to put in place for the delete to work during cleanup.

Originally posted by @Liryna in https://github.com/dokan-dev/dokany/issues/970#issuecomment-774614866

I want to control the right of deleting a file, I know that cleanup can't be stopped and try to use another fuction: DeleteFile in dokan_operations.

the interface comment says: DeleteFile will also be called with DOKAN_FILE_INFO.DeleteOnClose set to \c FALSE to notify the driver when the file is no longer requested to be deleted. And DeleteFile can return STATUS_ACCESS_DENIED to stop delete.

But I find DeleteFile is not called when I delete a file in a file system created by the memfs.exe, so how can I control the right of delete.