-
Notifications
You must be signed in to change notification settings - Fork 113
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
How to use HRESULT with functions returning i32 #603
Comments
I'll chat with @kennykerr about this next week |
Thanks for the background information @riverar. In the meantime I use this pattern (maybe helpful for others as well): let status = InitializeSecurityContextW(...);
let status = HRESULT(status as _);
... |
There are two different issues here.
Transferring this issue to the win32 metadata repo. |
|
For example the function
InitializeSecurityContextW
returns ani32
where the return status code should be tested forSEC_E_OK
which is of typeHRESULT
which is implemented as:Doing:
The above snippet will give compiler errors error[E0308]: mismatched types: since comparing
i32
againstu32
.Did there already a pattern/idiom emerge how to handle such situations, or am I missing something here? It could be a good addition to the FAQ.
The text was updated successfully, but these errors were encountered: