-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 SYSLIB prefix for all LibraryImportGenerator diagnostics #68613
Conversation
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsThis also removes an old diagnostic about unsupported target frameworks (from before we did the forwarding) - stolen from #60595.
|
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
[DllImport("netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static extern uint NetUserAdd([MarshalAs(UnmanagedType.LPWStr)]string servername, uint level, ref USER_INFO_1 buf, out uint parm_err); | ||
#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time | ||
[LibraryImport("netapi32.dll", SetLastError = true)] |
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.
Wait so this can marshal p/invoke signatures with Span<char>
as well?
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.
Only if the struct marshalling (with the support for collections) is explicitly specified.
We do have an example of how a marshaller could be implemented for Spans: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs
But it is currently not integrated or exposed.
Failures are dotnet/arcade#9208 |
This also removes an old diagnostic about unsupported target frameworks (from before we did the forwarding) - stolen from #60595.
This should be the last item in #60595. And then it is docs/samples.