-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#45 Change to NTSTATUS #65
Conversation
That was a quick merge. :-) I suppose you know a lot better than me why this is needed and good, so I can't really oppose. I think this is also one of the things that DokanX changed, right? Good that both projects are more aligned, just in case. Since I probably will need to port to the newer version, it will be good to have some minimum comments on porting. The changes in mirror.c are almost all needed. What surprises me, is that more or less you moved from the library to the user applications the win32 to NTSTATUS switch-case that maps one to other. I don't understand what is gained by that. 😮 The switch-case in create.c was in the wiki of my project because I wanted to know which status code I can return from CreateFile, so the user has a moderately useful error message. I suppose there isn't much that you can do, right? The OS will give generic error messages? Thank you! |
You have a much better control what status should be returned to the os. So you can decide what message should be displayed to the user. Depending on NTSTATUS the os behaves different in specific cases. Now it's up to you to decide what happened in your code and how you want report it to the is respective to user. NTSTATUS provides more direct reporting to os and user. It gives you more flexibility. |
Oh, then that's excellent news! I reviewed the differences, but not understanding everything properly I thought there was still some checking of specific return values that were the ones supported. Thank you! |
This commit was in branch since some weeks now, I had one issue that I have only been able to correct yesterday. you can find some information to convert your Win32 error here: or here, but you should be very careful because like @marinkobabic told, there is specific case where you cannot answer what you want.
|
So, now I'm supposed to map Win32 GetLastError() first to NTSTATUS somehow, then have that mapped to errno, pass it to dokan_fuse, which would translate errno back to NTSTATUS? Does not sound like an improvement to me. Nice code sample, but there are >2000 NTSTATUSes en Win32 errors. Don't understand why |
@rustyx Without using NTSTATUS error, dokan would not be able to answer correctly to the kernel windows (Kernel Windows does not use Win32 error). Before dokan was answering the same dummy ntstatus error whatever the user was returning a GetLastError(). Now the mirror sample is much more stable and answer correctly to all request. With the mirror sample and microsoft documentation of this pagen there is no difficulty to make the changes. If you was using dokany/dokan_fuse/src/utils.cpp Lines 265 to 312 in 1534370
that I updated. There is not changes for you if you was already using the wrapper fuse. |
Helper DokanNtStatusFromWin32 has been added in Dokan Library and can be used to translate Win32 Error code to the NtStatus code's corresponding |
No description provided.