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

Source generated interop should be unconditionally ExactSpelling=true #69541

Closed
jkotas opened this issue May 19, 2022 · 1 comment · Fixed by #69619
Closed

Source generated interop should be unconditionally ExactSpelling=true #69541

jkotas opened this issue May 19, 2022 · 1 comment · Fixed by #69619
Assignees
Labels
area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented May 19, 2022

Repro:

Inspect source generated interop for CoreLib

Actual behavior:

Some DllImports have ExactSpelling=false and other have ExactSpelling=true

[System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetThreadPriority", ExactSpelling = false)]
extern static unsafe global::Interop.Kernel32.ThreadPriority __PInvoke__(System.IntPtr hThread);
[System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "CreateThreadpoolIo", ExactSpelling = true)]
extern static unsafe System.IntPtr __PInvoke__(System.IntPtr fl, delegate* unmanaged<global::System.IntPtr, global::System.IntPtr, global::System.IntPtr, uint, global::System.UIntPtr, global::System.IntPtr, void> pfnio, global::System.IntPtr context, global::System.IntPtr pcbe);

Expected behavior:

All DllImports have ExactSpelling=true

@ghost
Copy link

ghost commented May 19, 2022

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

Issue Details

Repro: Inspect source generated interop for CoreLib

Actual behavior: Some DllImports have ExactSpelling=false and other have ExactSpelling=true

            [System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetThreadPriority", ExactSpelling = false)]
            extern static unsafe global::Interop.Kernel32.ThreadPriority __PInvoke__(System.IntPtr hThread);
            [System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "CreateThreadpoolIo", ExactSpelling = true)]
            extern static unsafe System.IntPtr __PInvoke__(System.IntPtr fl, delegate* unmanaged<global::System.IntPtr, global::System.IntPtr, global::System.IntPtr, uint, global::System.UIntPtr, global::System.IntPtr, void> pfnio, global::System.IntPtr context, global::System.IntPtr pcbe);

Expected behavior: All DllImports have ExactSpelling=true

Author: jkotas
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 19, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT added source-generator Indicates an issue with a source generator feature and removed untriaged New issue has not been triaged by the area owner labels May 19, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.0 milestone May 19, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT self-assigned this May 20, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 20, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 24, 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 a pull request may close this issue.

2 participants