Skip to content

Start using CsWin32 #7445

Closed
Closed

Description

@elachlan

Is your feature request related to a problem? Please describe

This issue is to be used to help centralize information around the change to implement CsWin32.

Blockers:
microsoft/CsWin32#639
microsoft/CsWin32#605
microsoft/CsWin32#600
microsoft/CsWin32#644
microsoft/CsWin32#624
microsoft/CsWin32#625
microsoft/CsWin32#324
dotnet/runtime#59013

Performance:
microsoft/CsWin32#595

Useful:
microsoft/CsWin32#596
microsoft/CsWin32#606
microsoft/CsWin32#602
microsoft/CsWin32#610
microsoft/CsWin32#122
microsoft/CsWin32#626

Associated Issues/Discussions:
#4751
#7392
#7444
#7446
#7468

Activity

  1. added
    api-suggestion
    untriaged
    on Jul 19, 2022
  2. elachlan commented on Jul 19, 2022

    @elachlan
    ContributorAuthor

    @JeremyKuhne I have created an issue here to help centralize issues/information around CSWin32.

    Before anything gets too deep, the Winforms team should decide on how they want to split up the NativeMethods.txt file.

  3. JeremyKuhne commented on Jul 19, 2022

    @JeremyKuhne
    Member

    Before anything gets too deep, the Winforms team should decide on how they want to split up the NativeMethods.txt file.

    Not sure how we'd want to split this up in ways that make sense given everything going to one class. Any ideas are certainly welcome.

    Note that this is currently a prototype effort targeting .NET 8. We have an intern working on this (@fernandanavamoya) with support from myself and our returning @lonitra.

  4. elachlan commented on Jul 19, 2022

    @elachlan
    ContributorAuthor

    I have asked the CsWin32 team about the NativeMethods.txt in microsoft/CsWin32#606.

    AFAIK, each NativeMethods.txt file needs to be in its own folder and added to additionalfiles. So in the context of winforms, we can place a NativeMethods.txt in each library sub folder. That way each library has its own NativeMethods.txt.

    Another way is have a single file, but add a comment "header" for each separate library.

    I like the idea of separate files as the management is per library.

    Its even more simple if winforms is using every method in a library, we can add them via a single wildcard line. Although, I am unsure if Trimming could then remove the used methods afterwards.

  5. elachlan commented on Jul 19, 2022

    @elachlan
    ContributorAuthor

    @JeremyKuhne do you want all the generated code in one file? If not, you can use the following in NativeMethods.json

    {
      "$schema": "https://aka.ms/CsWin32.schema.json",
      "emitSingleFile": false
    }
    
  6. RussKie commented on Jul 19, 2022

    @RussKie
    Contributor

    Personal opinion: I like how we have separation per containing dll (i.e., Interop.User32, Interop.Gdi32, etc). It'd be great to retain the separation if possible, e.g., /User32/NativeMethods.txt, /Gdi32/NativeMethods.txt, /Kernel32/NativeMethods.txt, etc.

  7. RussKie commented on Jul 19, 2022

    @RussKie
    Contributor

    AFAIK, each NativeMethods.txt file needs to be in its own folder and added to additionalfiles. So in the context of winforms, we can place a NativeMethods.txt in each library sub folder. That way each library has its own NativeMethods.txt.

    👍

  8. removed
    untriaged
    on Jul 19, 2022
  9. added this to the Future milestone on Jul 19, 2022
  10. elachlan commented on Jul 19, 2022

    @elachlan
    ContributorAuthor

    Personal opinion: I like how we have separation per containing dll (i.e., Interop.User32, Interop.Gdi32, etc). It'd be great to retain the separation if possible, e.g., /User32/NativeMethods.txt, /Gdi32/NativeMethods.txt, /Kernel32/NativeMethods.txt, etc.

    I'll proceed on this basis. It seems easier to deal with.

  11. elachlan commented on Jul 19, 2022

    @elachlan
    ContributorAuthor

    So @AArnott suggests we keep a centralized NativeMethods.txt and not split it up. The splitting up was designed for shared project scenarios. Which makes sense.

    I will adjust my PR to move it back to the main NativeMethods.txt as this will allow better management.

  12. 10 remaining items

  13. ghost added a commit that references this issue on Aug 26, 2022
  14. added a commit that references this issue on Sep 8, 2022
  15. added a commit that references this issue on Sep 23, 2022
  16. added a commit that references this issue on Sep 23, 2022
  17. merriemcgaw commented on Jul 27, 2023

    @merriemcgaw
    Contributor

    I'm officially going to tag this for .NET 9, for whatever bits remain after .NET 8. I think we're past where we want to do more in this release, but let's keep going! 😄

  18. modified the milestones: .NET 8.0, .NET 9.0 on Jul 27, 2023
  19. willibrandon commented on Dec 6, 2023

    @willibrandon
    Contributor

    Is the plan to convert the remaining Ole32 functions and Shell32 interfaces to CsWin32?

  20. elachlan commented on Dec 6, 2023

    @elachlan
    ContributorAuthor

    @willibrandon it's been slowly happening. I think it's a lot of com wrapper stuff left.

  21. willibrandon commented on Dec 7, 2023

    @willibrandon
    Contributor

    @elachlan - I'm curious what that will look like, and will keep an eye out, thanks.

  22. removed
    api-suggestion
    on Jan 10, 2024
  23. JeremyKuhne commented on Jul 24, 2024

    @JeremyKuhne
    Member

    Everything has been moved now.

  24. locked and limited conversation to collaborators on Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions