Comments (6)
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.
Original comment by [email protected]
on 15 Sep 2008 at 7:21
- Added labels: DokanLibrary
- Removed labels: Dokan
from dokan.
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.
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.
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.
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)
- JPEG file taking Vary long file for opening
- unable to delete completey
- Overlay is not working
- Can't compile with win 8 and Vs 2012 HOT 1
- Feature request: mount to a directory instead of a drive
- Windows 8 Metro Apps HOT 3
- Get/Set Volume Information
- Filesystems link on website is broken
- Recent comments is full of spam
- Outlook *.PST Save ERROR HOT 1
- Broken Link: https://groups.google.com/group/dokan/web/filesystems-using-dokan
- Non-administrator users cannot view contents within a dokan filesystem.
- Can't unmount
- Unable to add vmdk file to VMPlayer (using sample Mirror code) HOT 2
- Listing files in a chain
- Null pointer check on create.c openInfo free
- Threats Mal/HTMLGen-A
- Unable to share the mounted Dokan drive as Network File System
- Setup reports XPx64 not supported HOT 1
- countdown to extinction HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokan.