Skip to content
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

Release request for windows-rs 0.49.0 for WDK additions. #2603

Closed
chyyran opened this issue Aug 12, 2023 · 8 comments · Fixed by #2605
Closed

Release request for windows-rs 0.49.0 for WDK additions. #2603

chyyran opened this issue Aug 12, 2023 · 8 comments · Fixed by #2605

Comments

@chyyran
Copy link

chyyran commented Aug 12, 2023

Requesting a new release of windows-rs for WDK additions, particularly ntifs.h headers in Wdk_Storage_FileSystem.

@kennykerr
Copy link
Collaborator

Which crate are you using?

@chyyran
Copy link
Author

chyyran commented Aug 13, 2023

I’m using windows

@kennykerr
Copy link
Collaborator

Thanks, have you tested against github? Happy to release an update if you've validated that the APIs you need work as expected.

@chyyran
Copy link
Author

chyyran commented Aug 13, 2023

Tested against GitHub and it seems to be working fine with one caveat. WDK functions convert their NTSTATUS errors to HRESULT so they can return Result<T, windows::core::Error>. My particular use case requires the base NTSTATUS in case of errors. Could WDK functions be made to return Result<T, NTSTATUS> or a wrapped version such that the original NTSTATUS is recoverable where relevant? (Should I file a new issue for this?)

For now my current workaround is to use functions from windows-sys but wrap the return values in windows::Win32::Foundation::NTSTATUS but this doesn't feel like a great workaround.

@tim-weis
Copy link
Contributor

@chyyran NTSTATUS values can be losslessly represented as HRESULT values. To recover the corresponding NTSTATUS value from a windows::core::Error you would call code() to get the HRESULT value, and then unset bit 4 (N).

@chyyran
Copy link
Author

chyyran commented Aug 13, 2023

Thanks @tim-weis, in which case everything works as expected.

@riverar
Copy link
Collaborator

riverar commented Aug 13, 2023

Heads up, the documentation linked above numbers the most significant bit as bit 0. Bit 4 in this case is really bit 28.

@kennykerr
Copy link
Collaborator

kennykerr commented Aug 14, 2023

Thanks for testing. Will publish #2605 today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants