-
Notifications
You must be signed in to change notification settings - Fork 513
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
Transform BOOL
and Win32
return values
#2476
Conversation
CC @talagrand and @riverar if you'd like to spot check. |
Thank you @kennykerr! I spot checked all the APIs I was using and they're all covered by this PR. Now, I can open a separate issue for this but it would be ideal if APIs that use the pattern sentinel + GetLastError() were also covered. Things like ExpandEnvironmentStringsW (returns 0 on failure) or ResumeThread (returns -1) or GlobalLock (returns NULL). |
This will require additional metadata support; do file an issue at https://github.com/microsoft/win32metadata/issues thanks! |
# Description Bump `windows` to 0.52.0 and fix `is_admin` microsoft/windows-rs#2476 # User-Facing Changes N/A --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Description Bump `windows` to 0.52.0 and fix `is_admin` microsoft/windows-rs#2476 # User-Facing Changes N/A --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Currently, the
windows
crate will transform API functions that returnHRESULT
orNTSTATUS
intoResult<T>
to provide a more idiomatic developer experience.This update extends that transformation to functions that return
WIN32_ERROR
, likeRegOpenKeyExW
, as well as functions that returnBOOL
and also have metadata that indicates they callSetLastError
on failure, likeLookupPrivilegeNameW
.Fixes: #2467