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

Add the struct marshalling attributes to Ancillary.Interop and add an analyzer that validates manual usage. #61

Merged

Conversation

jkoritzinsky
Copy link
Member

Add the struct marshalling attributes discussed in the design doc to Anicllary.Interop.

Adds a Roslyn Analyzer to enable issuing errors/warnings for incorrect usage of these attributes.

Update our test suite to test the analyzer and use the Roslyn SDK test utilities to simplify discovering assemblies to add to our compilations

@jkoritzinsky jkoritzinsky added the area-DllImportGenerator Source Generated stubs for P/Invokes in C# label Aug 20, 2020
<value>The native type for the type '{0}' is null.</value>
</data>
<data name="NativeTypeMustBePointerSizedDescription" xml:space="preserve">
<value>The native type must be pointer sized so we can cast the pinned result of 'GetPinnableReference' to the native type.</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we can

I prefer avoiding first-person for error/warning messages and descriptions like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

DllImportGenerator/DllImportGenerator/Resources.resx Outdated Show resolved Hide resolved
@jkoritzinsky jkoritzinsky merged commit 05d6ef2 into dotnet:DllImportGenerator Sep 1, 2020
@jkoritzinsky jkoritzinsky deleted the struct-marshal-parsing branch September 1, 2020 17:11
scalablecory pushed a commit that referenced this pull request Sep 22, 2020
This PR moves the etwlib to GitHub. Tristan is doing some WPA prototyping with our LTTng events and needs a externally built version of the lib to test it out.
jkoritzinsky added a commit to jkoritzinsky/runtime that referenced this pull request Sep 20, 2021
… analyzer that validates manual usage. (dotnet/runtimelab#61)

Co-authored-by: Elinor Fung <[email protected]>

Commit migrated from dotnet/runtimelab@05d6ef2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DllImportGenerator Source Generated stubs for P/Invokes in C#
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants