Is there a possibility that Close() might not be called?

20 views
Skip to first unread message

ai ou

unread,
Apr 22, 2025, 9:22:35 PMApr 22
to WinFsp
Hi, I have a question about passthrough.

When unmounting a network drive mounted with passthrough while it is still open in CMD or Explorer,
it seems that the number of times the Open() function is called does not match the number of times the Close() function is called.
Is this a specification?

Thank you

Bill Zissimopoulos

unread,
Apr 23, 2025, 11:21:45 AMApr 23
to ai ou, WinFsp

When a file system goes away (usually because its control device is closed), the WinFsp FSD tries to cleanup as best as it can. If the file system still has open files, the file system goes into a “zombie” mode, where it fails all file system requests (except for Close) with STATUS_CANCELLED.

 

So it is possible and desirable to terminate a file system while there are still files open on it. For example, the user mode file system process may crash and the WinFsp FSD should still service requests for open files on this file system in a “reasonable” manner (STATUS_CANCELLED).

 

It is also possible for an application to open a file that it then closes, but the Windows OS (or some driver) keeps open indefinitely for a variety of reasons (e.g. caching).

 

So you should not expect that when a file system goes away all files will be closed beforehand.

 

Bill

 

 

--
You received this message because you are subscribed to the Google Groups "WinFsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
winfsp+un...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/winfsp/1f34bb1c-5890-4bc0-aced-07c950b82db7n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages