Comments (5)
@suy "FILE_FLAG_DELETE_ON_CLOSE in the dwFlagsAndAttributes parameter of CreateFile. Dokan doesn't support that out of the box, but there are easy to work around."
If I remember Dokan already give you the information during CreateFile.
Line 98 in 8b7742f
This Windows 10 (= 8.1) sample give us a over view of the officiel behaviour for detecting the delete file operation.
https://github.com/Microsoft/Windows-driver-samples/tree/master/filesys/miniFilter/delete
It monitors IRP_MJ_CREATE requests for the FILE_DELETE_ON_CLOSE flag. Also, it detects IRP_MJ_SET_INFORMATION requests for setting FileDispositionInformation. The sample also illustrates how to handle racing deletes (in the form of multiple parallel IRP_MJ_SET_INFORMATION operations), and how to distinguish deletion of an entire file from deletion of just one stream of the file.
I also think that it is the application that should keep a information to handle automaticaly the delete on close.
Maybe we even should remove the flag during CloseFile for the < 8 Windows version to have a "standard" behaviour ?
from dokany.
Removing the DeleteOnClose flag would be a source and binary incompatible change with old applications. That's why I was thinking of using it instead (either setting it in the application or the library/driver). That might be able to "upgrade" old applications that weren't aware of the flag, although you probably will know better if this is safe.
If you think it's the application's duty to do so, I'll implement it in mine, and update the docs.
One question remains, though: how comes that Microsoft introduced this safely? Isn't it breaking all other file system drivers as well?
from dokany.
You are right. Remove the flag would break compatibility.
I have look how to add the flag during close event on Win > 8.
DeleteOnClose is set from the EventContext information:
Line 448 in 741198c
The EvenContext come from DeviceIoControl (dokan driver).
Line 291 in 741198c
I guess Windows break the compatibility :D or the officiel behaviour never was to check delete on close.
The EvenContext is a new instance for every IO call. Thats why it is impossible to store the DeleteOnClose inside.
We should find a way to store it in a clean way inside the DokanLoop
from dokany.
Added with 770d2a7 from BenjaminKim/dokanx#45
The logic is different and more simple 😄 and it work ! 👍
Thanks @marinkobabic
from dokany.
It took me some time to be able to test, but so far, yes, this seems to work. :-) Thank you!
I don't understand, though, what would change the other parts of the change that Marinko did. I see the DeleteFile operation being called before the cleanup anyway.
from dokany.
Related Issues (20)
- Possibility to increase thread count & change DOKAN_OPTION_ALLOW_IPC_BATCHING? (FUSE) HOT 14
- some doubts in dokanfuse HOT 2
- 2.1.0.1000 on Windows 11 hangs Windows Explorer in single thread mode HOT 2
- Stdout not working anymore after fuse_main invocation HOT 2
- `DokanInstanceBuilder.Build` returns before file system is ready HOT 1
- Compatibility with Rising antivirus software HOT 8
- unstable on windews : ceph::buffer::v15_2_0::bad_alloc: Bad allocation [buffer:1] HOT 1
- GetFileInformation Not Called by FileDateTime in VB6 HOT 2
- When is ReadFile() called? HOT 1
- There are some errors when test memfs with winfstest HOT 2
- Dokan2 driver fails to install on Windows 10 HOT 2
- Library - Fail mount with DOKAN_OPTION_CURRENT_SESSION and mount point path
- Install fails on Win11 - Paralles on Mac M1 HOT 5
- Help | How to implement save in dokan HOT 13
- Cannot uninstall Dokan Library - Blocked by pending restart stuck state. HOT 9
- Installer says Dokan 2.1.0.1000 is installed, but it isn't
- dokan limit speed, but windows10 pop-up never displays progress
- How to know the directory update event in memfs when user clicks F5 keyword. HOT 1
- Windows 11 - Saving file by notepad is not working HOT 4
- Need Solution for Error Handling in CloseFile for Remote Drive with FTP Integration
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 dokany.