Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Add option to output all P/Invokes from managed code #985

Closed

Description

@marek-safar

There should be a new option --output-pinvokes FILE which when used will generate output file (JSON) which will include the following data

{
  "entryPoint" : "MessageBox",
  "moduleName" : "user32.dll"
}

Activity

  1. added this to the .NET5.0 milestone on Mar 10, 2020
  2. self-assigned this
    on Mar 10, 2020
  3. MichalStrehovsky commented on Mar 13, 2020

    @MichalStrehovsky
    Member

    What will this list be used for? Should it also include information about whether the app contains a call to NativeLibrary.SetDllImportResolver that could redirect the module part to any other file at runtime?

  4. marek-safar commented on Mar 13, 2020

    @marek-safar
    ContributorAuthor

    One of the purposes will be to use the data for static linking

  5. vitek-karas commented on Mar 16, 2020

    @vitek-karas
    Member

    Is this for AOT scenarios?
    If so, we could mark NatvieLibrary.SetDllImportResolver as potentially dangerous for AOT - if AOT uses static linking of native dependencies then it's definitely dangerous.

  6. marek-safar commented on Mar 16, 2020

    @marek-safar
    ContributorAuthor

    Yes, this primary for static linking AOT scenarios

  7. marek-safar commented on Mar 26, 2020

    @marek-safar
    ContributorAuthor

    Implemented for .net5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions