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

Use HandleOrNull and HandleOrInvalid in the Windows FFI bindings. #94572

Merged
merged 1 commit into from
Mar 4, 2022

Commits on Mar 3, 2022

  1. Use HandleOrNull and HandleOrInvalid in the Windows FFI bindings.

    Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced
    as part of [I/O safety] in a few functions in the Windows FFI bindings.
    
    This factors out an `unsafe` block and two `unsafe` function calls in the
    Windows implementation code.
    
    And, it helps test `HandleOrNull` and `HandleOrInvalid`, which indeed turned
    up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`, as it's
    used inside of `HandleOrNull` and `HandleOrInvalid` which are also
    `#[repr(transparent)]`.
    
    [I/O safety]: rust-lang#87074
    sunfishcode committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    3560649 View commit details
    Browse the repository at this point in the history