Comments (9)
Hi @marinkobabic,
I am currently changing NTSTATUS as plained. (https://github.com/dokan-dev/dokany/compare/NTSTATUS)
I am facing a issue with CreateFile that it seems you faced too 😃
###Create 0000
CreateDisposition 0x00000001
CreateFile : C:\Users\autorun.inf
AccountName: Adrien, DomainName: WIN-9RM07VT4S97
OPEN_EXISTING
ShareMode = 0x7
FILE_SHARE_READ
FILE_SHARE_WRITE
FILE_SHARE_DELETE
AccessMode = 0x80
FILE_READ_ATTRIBUTES
FlagsAndAttributes = 0x0
error code = 2
CreateFile status = 2
error openInfo is NULL
###GetFileInfo -001
GetFileInfo : C:\Users\autorun.inf
invalid handle
**MIRROR CRASH**
This happened since in mirror I return the error from getLastError.
https://github.com/dokan-dev/dokany/blob/NTSTATUS/dokan_mirror/mirror.c#L220
error openInfo is NULL
happen here
https://github.com/dokan-dev/dokany/blob/NTSTATUS/dokan/dokan.c#L487
because openInfo is free here
https://github.com/dokan-dev/dokany/blob/NTSTATUS/dokan/create.c#L212
By removing the free like you, I was surprised to have no crash.
marinkobabic/dokanx@eeb692a#diff-d7735925422d2f0b4a057d4f1ec7a0d5R261
It seems that dokanx have chosen to fix it in a different way...
https://github.com/BenjaminKim/dokanx/blob/develop/mirrorfs/mirrorfs.cpp#L227
By the way, the comment say that Close is never called...but I get a Cleanup and close after GetFileInfo.
Do you have a reason for removing this lines ? Are they important ?
Otherwise mirror is correctly running without problem. I will run dokan-net.Test before merging it.
from dokany.
@Liryna
The comment says "Needs to free openInfo because Close is never called." The developer expected that the close will not be executed because of the status pEventInfo->Status != STATUS_SUCCESS
The fact is, that even in this case the cleanup is executed. Therefore the pOpenInfo should not be freed during create. Cleanup requires the pOpenInfo.
Here you have the mapping table Win32 to NTSTATUS https://support.microsoft.com/en-us/kb/113996
GetLastError code should not be passed directly to the driver. GetLastError is the Win32 error and not NTSTATUS.
from dokany.
Thank you for the clear answer 👍
Do you think we should let the user return Win32 error and we convert it in NTSTATUS (dokan.dll)?
from dokany.
No. Then you will have always a discussion of mapping. Which win32 errors do you map to which code. Please add this code as well and so on...
from dokany.
Ok ! I agree 😃
I remove the free and continue the changes.
from dokany.
@marinkobabic, I finished the NTSTATUS changes. I tested it with the mirror and it seems to work good / without crash.
I would like your review before merging it 😃 and know if it fit your request ! (and If you have the time ofc)
https://github.com/dokan-dev/dokany/compare/NTSTATUS
from dokany.
@Liryna
Wow, a lot of changes. You had also to remove a lot of code 😄 Great job! 👍
- Please check your code for return 0 and replace it using the STATUS_SUCCESS.
- Also check where result == 0 is used and change the code if possible.
- In generally is the question if status > 0 should be used. Inside of the driver NT_SUCCESS and NT_ERROR is used http://rogerkar.blogspot.ch/2009/06/nterror-ntsuccess-identifier-not-found.html. Here the definition https://msdn.microsoft.com/en-us/library/windows/hardware/ff565436(v=vs.85).aspx
from dokany.
Thank @marinkobabic for your feedback and informations !
I made the changes as you suggested !
I will merge it in master when I finish to change dokan-net with NtStatus.
from dokany.
The todo has been split to different tickets.
from dokany.
Related Issues (20)
- [Question] Too many Guid keys in MountPoint2
- [QUESTION] cannot access the network mapped drive remotely.
- Kernel - Allow passing the session information for the targeted mount
- How to safely remove ISO mount? HOT 4
- There is no certificate in dokan2.sys for version 2.1.0.1000. HOT 2
- Error Installing version 2.1.0.1000 HOT 17
- Error Uninstalling Dokan Library 1.5.1.1000 Bundle (0x80070643) HOT 3
- Possibility to increase thread count & change DOKAN_OPTION_ALLOW_IPC_BATCHING? (FUSE) HOT 10
- 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 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 dokany.