-
Notifications
You must be signed in to change notification settings - Fork 673
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
Return STATUS_INVALID_PARAMETER where appropriate #933
Conversation
Thanks @reidrankin for the PR and the extra changes 🚀 !!! Changing the default return value in Lines 542 to 548 in 91e8782
I know that not the case yet but some projects do not directly use the library code so fixing in the driver would also be fixing the issue for them. Could you add all the previous list of supported infoclass in the kernel here and return the status in the default behaviour ? Lines 122 to 145 in f7161d7
If you could this for the other cases it would be great 👍 I know that might be too much to ask but it would definitely solve the issue. Rename other commit to: |
d313dad
to
c4530dd
Compare
According to [MS-FSCC] sections 2.4/2.5, the appropriate NTSTATUS code to report the use of an unimplemented information class value with an otherwise implemented IRP type is STATUS_INVALID_PARAMETER rather than STATUS_NOT_IMPLEMENTED. Some parts of Windows rely on this distinction to determine when to retry calls with more common information class values.
c4530dd
to
592f7eb
Compare
I don't think it's necessarily a good idea to limit the range of info classes that the user-mode code can choose to handle. See for example #835, where a new class was implemented without touching the kernel code. So instead I went on a journey trying to figure out how I could intercept My reasoning is that Dokan clients use I used I've left the library changes that return Finally, I've added support for In fact, because the WSL2 Plan 9 server actually comes from the Windows Containers infrastructure, I would bet that issue #834 is caused by a similar setup that would have fallen back to other info classes if it had gotten a slightly different error code. I know that the virtual DVD drive driver doesn't support (Now the only question is if any of this will break anything. I'm not afraid to say that I'm not experienced enough with the way Dokan is used in the field to understand the compatibility implications here, even if I do think that the approach is theoretically sound.) |
e656dfc
to
9c62a45
Compare
OK, so now that the stupid thing works, let's talk about whether this approach is a good idea or not. (And I love the Appveyor setup's automagic Driver Verifier test suite, though I love the hour-and-a-half CI pipeline somewhat less.) |
Glad you like the CI :)! I also agree that it is pretty slow... Making the test running side by side would be a good start but thats a premium feature :( Awesome that you added the support for this infoclass! Have you been able to build and test it against WSL 2? You made a good point of not restricting the infoclass sent by the kernel and for the same reason I would prefer to not override the status sent by the library in the kernel. If other libraries want to get this fix, they will need to import it themselves and that's fine. |
9c62a45
to
4a5087e
Compare
Really by thanks to you @reidrankin for taking your valuable time on this! 🏆 ... failed with the merging. Github as squashed them all by default 😢 |
Checklist
Changes proposed in this pull request:
STATUS_INVALID_PARAMETER
rather thanSTATUS_NOT_IMPLEMENTED
to report the use of an unimplemented information class value with an otherwise implemented IRP type. (Fixes Can't list directories in WSL2 #932.)DokanSetAllocationInformation
to normalize style of code.