-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Update SafeHandle types to have public parameterless constructors and add InitHandle API #47189
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I would also add a test for the new Marshal
API.
/cc @eerhardt |
Can you delete the following files along with this, as they are no longer necessary? https://github.com/dotnet/runtime/blob/master/src/libraries/System.Net.Sockets/src/ILLink/ILLinkTrim_LibraryBuild.xml |
src/installer/managed/Microsoft.NET.HostModel/ResourceUpdater.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/src/Interop/Windows/SspiCli/SafeDeleteContext.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/Microsoft/Win32/SafeHandles/SafeProcessHandle.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeWaitHandle.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs
Outdated
Show resolved
Hide resolved
…ors. Remove now-unneeded ILLink trim files. Make public abstract SafeHandle constructors protected. Remove comment on SafeWaitHandle
790c886
to
cdb9780
Compare
Make internal abstract SafeHandle default constructors protected. Make non-abstract internal SafeHandles sealed when possible. More internal SafeHandle types.
Fix SetHandle accessibility Fix test. Use Marshal.InitHandle.
cdb9780
to
7b99f90
Compare
@eerhardt @stephentoub any more changes needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just missed a couple sealed
classes.
src/installer/managed/Microsoft.NET.HostModel/ResourceUpdater.cs
Outdated
Show resolved
Hide resolved
...braries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.cs
Show resolved
Hide resolved
...braries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.cs
Show resolved
Hide resolved
Hello @jkoritzinsky! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Implements the API changes described in #46830.
Make all non-abstract SafeHandle types have public parameterless constructors. Add the InitHandle API that initializes the underlying handle of the SafeHandle object.
Contributes to #46830
See #45633 for linker context.