Giter Club home page Giter Club logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
from Dokan readme
--
Cleanup is invoked when the function CloseHandle in Windows API is executed. If 
the 
file system application stored file handle in the Context variable when the 
function 
CreateFile is invoked, this should be closed in the Cleanup function, not in 
CloseFile function. If the user application calls CloseHandle and subsequently 
open 
the same file, the CloseFile function of the file system application may not be 
invoked before the CreateFile API is called. This may cause sharing violation 
error. 
Note: when user uses memory mapped file, WriteFile or ReadFile function may be 
invoked after Cleanup in order to complete the I/O operations. The file system 
application should also properly work in this case.


Original comment by [email protected] on 8 Sep 2008 at 3:03

  • Changed title: want to ensure CloseFile is called

from dokan.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024

Original comment by [email protected] on 15 Sep 2008 at 7:21

  • Added labels: DokanLibrary
  • Removed labels: Dokan

from dokan.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
It's a bit confusing before you read up on Close and CleanUp. Shouldn't this be
hidden from the user? To do a FUSE API compatible it will have to be anyway. I'm
still looking for a way to force Windows to remove the file from it's cache to 
truly
release it. 

Some of the file systems on http://www.acc.umu.se/~bosse/ only implement
IRP_MJ_CLOSE, but that doesn't strike me as a good solution as it could be a 
long
time after all the handles are closed before IRP_MJ_CLOSE is called.

I see CcFlushCache, CcPurgeCacheSection and CcUninitializeCacheMap are already 
called
after IRP_MJ_CLEANUP has completed, and I would have expected this functions to 
force
Windows' caching to let go over all references to the file so IRP_MJ_CLOSE is 
called.
But looks like this isn't happening, so there must be more to forcing Windows 
to let
go....

Original comment by [email protected] on 10 Nov 2008 at 11:33

from dokan.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
I agree with you. CreateFile and Cleanup are confusing.
I found a bug relating CloseFile and fixed it onDokan library 0.3.9. I think 
CloseFile is certainly called.
If you find an example that CloseFile is never called, please let me know.
I might miss something on cache manager.


Original comment by [email protected] on 10 Nov 2008 at 4:30

from dokan.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
It seems now the CloseFile should be called instead of cleanup to deal with both
memory mapped files and regular files. I noticed when closing my context in
Cleanup(), the Dokan lib will cause ReadFile to be sent after cleanup() but 
before
CloseFile(). That would cause error in REadFile as handle was no longer valid. I
shifted my cleanup code to CloseFile and it appears to work! So perhaps the docs
should be changed to indicate that Cleanup() is no longer necessary ?

Original comment by [email protected] on 15 Jan 2009 at 6:21

from dokan.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
I've gotten the same thing with ReadFile after cleanup.  It's not intuitive 
what to 
do here for the filesystem implementor.  The 'Mirror' example shows that you 
should 
re-open the file and read again.  This doesn't seem right.  How do you know how 
to 
re-open the file with the same permissisons as the original CreateFile?

So, all of my handle closing happens in Cleanup, and my CloseFile does 
virtually 
nothing!

Original comment by [email protected] on 4 Mar 2010 at 9:04

from dokan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.