Closed Lucasq11 closed 10 months ago
I noticed that dokan made another create operation upon directory A, which is the parent of file I truncated. Is it because parent directory says the file acturely has truncate right? If so, can I prevent this? I want to aquire the right of a file by sending http requests to the server and use the response to judge whether the file has right rather than asking its parent dir, is it able to do so?
Hi @Lucasq11 , This seems to be one of these cases where it is difficult to perfectly map Window perm and cloud. Yes, the parent permission does count when looking at the child permission.
What kind of error do you expect from the SetEndOfFile
failure ? I believe Dokan does correctly forward your error code but it is up to the OS / App to display an error after receiving it.
Hi @Liryna, I'd like the windows to pop up an error box says something like: "no access to truncate the file" after SetEndOfFile returns STATUS_ACCESS_DENIED
In this case, the application doing the call would have to check the value we returned it and display this error. There is not much we can do here. You can use procmon to confirm the error is correctly returned to user land.
Environment
Check List
Description
I want to disable truncate operation for some specific files, and SetEndOfFile returned c0000022 like what I expected, but windows still don't know that this file shouldn't be cleared and give no report. How should I get a report windows after truncate operation is failed?
Logs