- Notifications
You must be signed in to change notification settings - Fork5.1k
Switch over miscellaneous DllImports to GeneratedDllImport.#62353
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
These P/Invokes slipped through the cracks for their respective libraries because they're either only used on platforms where getting the analyzer to run in VS is more difficult (CoreLib for mobile platforms) or they were missed in the first pass.
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/Common/src/Interop/Windows/User32/Interop.ReleaseDC.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/Common/src/Interop/Windows/User32/Interop.WindowFromDC.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
....Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
....Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
…eference the live ref pack.
…er makes doing it during property evaluation difficult
a99926d
toc0022e1
Comparesrc/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNodeName.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
[DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] | ||
#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time | ||
// TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Would be better to reference tracking issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is the comment pattern we've used even migrating over the rest of the DllImports, so I'd prefer to match that.
Curious why don't we have code analyzers/fixers for this? |
See the opening PR comment: It's not blanketly enabled as a warning for the whole repo yet as the team has been working through the changeover library by library. |
Great news. I didn't know there is an analyzer available already. |
These P/Invokes slipped through the cracks for their respective libraries because they're either only used on platforms where getting the analyzer to run in VS is more difficult (CoreLib for mobile platforms) or they were missed in the first pass.