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

How to disable file change notification? #1086

Closed onexzero closed 2 years ago

onexzero commented 2 years ago

Feature request can skip this form. Bug report must complete it. Check List must be 100% match or it will be automatically closed without further discussion. Please remove this line.

Environment

Check List

Description

The exact cause is unknown, but sometimes the window is constantly refreshed. For example, after editing a certain ppt file, the NotifiyChangeDirectory->GetFileInformation->CloseFile->NotifyChangeDirectory..... loop continuously repeats for that file until the Explorer is closed. This does not appear to be a problem with DOKAN itself, but we need a way to block it.

Logs

Please attach in separate files: mirror output, library logs and kernel logs. In case of BSOD, please attach minidump or dump analyze output.

Liryna commented 2 years ago

DokanNotifyReportChange is only called when there is a FS action that requires to be notified. GetFileInformation and CloseFile are not events that call DokanNotifyReportChange unless a file is deleted.

Could you enable the driver logs by using the mount option and look for this line to see which action is reported ? https://github.com/dokan-dev/dokany/blob/70f27b2be9f78522ab93878dcf29635ef56db6bf/sys/dokan.c#L539-L541

onexzero commented 2 years ago

Occasionally, after editing, saving and exiting PowerPoint, the log

[DokanNotifyReportChange0][FFFFA503F6317010]: FCB=FFFFA503F5C62CF0 NameOffset=2 FilterMatch=10 Action=3 Success

It keeps repeating. Notify.LOG Notify.PML.log

[VCB][IRP_MJ_DIRECTORY_CONTROL][IRP_MN_NOTIFY_CHANGE_DIRECTORY]: Begin ProcessId=7820

where 7820 is Windows Explorer. Why does Explorer keep requesting changes even though the file is no longer changing and has already reported matching events?

Liryna commented 2 years ago

Thanks for the logs @onexzero ! Very helpful. I was able to find out what is happening and made a fix https://github.com/dokan-dev/dokany/commit/0c1a12157935372b01a3842fb2609eaad0ba34a5 I should schedule a new version in the coming days.

onexzero commented 2 years ago

I tested your patch on 32bit windows. it seems to work so far. When a new version comes out, I will test it on 64-bit as well.

IsaMorphic commented 2 years ago

@Liryna Hello, I'm having an issue with the latest version (2.0.4.1000) where none of the notifications (CreateFile, MoveFile, etc) are happening when using the DokanNet library. I believe it may be related to these changes? If not I will gladly open an issue on the dotnet repo :)

Liryna commented 2 years ago

@yodadude2003 it is unlikely. Could you open an issue ?

IsaMorphic commented 2 years ago

Can do when I'm on my PC next. 👍

IsaMorphic commented 2 years ago

@Liryna https://github.com/dokan-dev/dokan-dotnet/issues/310