-
Notifications
You must be signed in to change notification settings - Fork 94
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
Reconsider null SafeHandle handling #755
Comments
Well, my fix for this may not address this particular feedback related to monitors, because |
Also throw when the handle is not optional, but null is provided. Fixes #755
Also throw when the handle is not optional, but null is provided. Fixes #755
Also throw when the handle is not optional, but null is provided. Fixes #755
@User1785604260 I don't know why a 0 HANDLE would represent something valid, considering HANDLE is documented as using 0 and -1 to represent an invalid handle. I tried in #760 to prefer -1 over 0 where both were 'invalid' to avoid the monitor issue, but doing so led to #810 so I'm going to revert to preferring 0 when it is a documented invalid value. |
Originally posted by @User1785604260 in #753 (comment)
We should throw on null SafeHandle if the metadata does not include
[Optional]
for that parameter.When it is optional, we should use a handle value that is documented as an invalid handle value the metadata rather than assume
default(T)
is suitable for a missing handle.The text was updated successfully, but these errors were encountered: