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.
Wait so this can marshal p/invoke signatures with Span<char> as well?
There was a problem hiding this comment.
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.