-
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
Cleanup Interop in System.Drawing.Common to follow repo guidelines #49469
Comments
Tagging subscribers to this area: @safern, @tarekgh Issue DetailsI just submitted a PR to cleanup some of the System.Drawing.Common Interop. Having that model lead to a bug where we called a Windows PInvoke in Unix causing an exception. I partially cleaned this up as part of the fix in: #49405
|
Working on it. @safern some questions related to interop: It's targeting down level frameworks. Can function pointers be used for interop in this case? It's using |
@jkotas could you help with those questions? I don't know the answer. |
Function pointers can be used for targets prior .NET 5 with some limitations. In particular, the unmanaged calling convention has to be always explicitly specified prior to .NET 5.
No, it is not strictly required to avoid HandleRefs. The code written using SafeHandles tends to be more robust (less chance of handle leaks or use-after-free bugs). |
Closing as dup of #51565 |
I just submitted a PR to cleanup some of the System.Drawing.Common Interop. Having that model lead to a bug where we called a Windows PInvoke in Unix causing an exception.
I partially cleaned this up as part of the fix in: #49405
The text was updated successfully, but these errors were encountered: