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

Update SafeHandle codegen to match the approved API. #570

Merged

Conversation

jkoritzinsky
Copy link
Member

Update SafeHandle marshalling to use Activator.CreateInstance and InitHandle.

@jkoritzinsky jkoritzinsky added the area-DllImportGenerator Source Generated stubs for P/Invokes in C# label Jan 19, 2021
@jkoritzinsky jkoritzinsky added this to the 6.0 milestone Jan 19, 2021
@@ -82,9 +82,9 @@ private TypePositionInfo()

public MarshallingInfo MarshallingAttributeInfo { get; init; }

public static TypePositionInfo CreateForParameter(IParameterSymbol paramSymbol, DefaultMarshallingInfo defaultInfo, Compilation compilation, GeneratorDiagnostics diagnostics)
public static TypePositionInfo CreateForParameter(IParameterSymbol paramSymbol, DefaultMarshallingInfo defaultInfo, Compilation compilation, GeneratorDiagnostics diagnostics, INamedTypeSymbol scopeSymbol)
Copy link
Member

Choose a reason for hiding this comment

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

Ugh. These two functions (i.e. CreateForParameter and CreateForType) are hideous... Let's make a mental note that they should not be exposed as is when we enable extending the source generator.

/cc @elinor-fung

Remove the base list from the containing types so we don't need to handle correctly using fully-qualified names for all the types.
@jkoritzinsky jkoritzinsky merged commit 0c64a2a into dotnet:feature/DllImportGenerator Jan 20, 2021
@jkoritzinsky jkoritzinsky deleted the safehandle-updates branch January 20, 2021 19:06
jkoritzinsky added a commit to jkoritzinsky/runtime that referenced this pull request Sep 20, 2021
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.

5 participants