Skip to content
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

Merged
merged 2 commits into from
Apr 28, 2022

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Apr 27, 2022

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.

@elinor-fung elinor-fung added area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature labels Apr 27, 2022
@elinor-fung elinor-fung added this to the 7.0.0 milestone Apr 27, 2022
@ghost ghost assigned elinor-fung Apr 27, 2022
@ghost
Copy link

ghost commented Apr 27, 2022

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

This also removes an old diagnostic about unsupported target frameworks (from before we did the forwarding) - stolen from #60595.

Author: elinor-fung
Assignees: -
Labels:

area-System.Runtime.InteropServices, source-generator

Milestone: 7.0.0

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)]
Copy link
Member

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?

Copy link
Member Author

@elinor-fung elinor-fung Apr 28, 2022

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.

@elinor-fung
Copy link
Member Author

Failures are dotnet/arcade#9208

@elinor-fung elinor-fung merged commit 9342649 into dotnet:main Apr 28, 2022
@elinor-fung elinor-fung deleted the syslibPrefix branch April 28, 2022 16:25
@ghost ghost locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants