You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to restrict deletion of file in some predefined cases. We tried returning STATUSS_ACCESS_DENIED from delete_file if the predefined condition are met. But later we got to know that delete_file is not getting called all the time when a file is getting deleted. So we also tried returning STATUSS_ACCESS_DENIED in create_file if delete_on_close is to true and predefined conditions met, but this also not preventing the file from getting deleted.
The text was updated successfully, but these errors were encountered:
ajaykumargdr
changed the title
File is getting deleted even when CreateFile and DeleteFile returns STATUS_ACCESS_DENIED
File is getting deleted even when create_file and delete_file returns STATUS_ACCESS_DENIED
Oct 25, 2024
Based on this suggestion we tried checking the desired_access and returning STATUS_ACCESS_DENIED if it contains DELETE from the create_file. However this approach is making dokan throwing a error error: process didn't exit successfully: 'target\release\webdrive-app.exe' (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION).
It seems like even after we return the Err(STATUS_ACCESS_DENIED) from the create_file it is somehow continuing the cycle and trying to access the context from other functions like get_file_information. We doubt that since the context is assigned at the end of create_file function, returning error before that causes this issue.
We tried commenting all other code where we use context and this time it didn't give any errors, but it also didn't showed any popup in the explorer such as access denied.
Environment
Description
We are trying to restrict deletion of file in some predefined cases. We tried returning
STATUSS_ACCESS_DENIED
fromdelete_file
if the predefined condition are met. But later we got to know thatdelete_file
is not getting called all the time when a file is getting deleted. So we also tried returningSTATUSS_ACCESS_DENIED
increate_file
ifdelete_on_close
is to true and predefined conditions met, but this also not preventing the file from getting deleted.We also went thought the Question about preventing dokan delete a file discussion. We tried this fix but it didn't work for us.
The text was updated successfully, but these errors were encountered: