microsoft / microsoft/CsWin32

Consider specifying a given architecture for APIs when targetting AnyCPU

Open
#882 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement partner
Dominant language
C#
Stars
2.5k
Forks
124
Avg merge
1d 3h
Merged PRs (30d)
9

Description

Is your feature request related to a problem? Please describe.
Windows Forms needs to build for AnyCPU so customers can continue to build for AnyCPU. Some Win32 APIs are not really portable (notably the Pack = 1 versions), but for WinForms internal purposes the x86/x64 definitions are equivalent.

Describe the solution you'd like
The ability to specify in the settings json that we want specific listed APIs to come from a given architecture. This would also allow us to address things like Get/SetWindowLong/Ptr.

Describe alternatives you've considered
The only real alternative is to manually define things- which is very much not desirable. :)

Additional context
I spoke with @tannergooding a bit about this and he helped me understand this is not something we can really deal with at the Win32Metadata level as it has to allow for all consumers (can't presume .NET) and uses of the data structures (composition within other types, etc.).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the settings JSON handling and the API-generation path, then examine how architecture is represented for AnyCPU targets. Compare the behavior of Get/SetWindowLong/Ptr and the Pack = 1 APIs; done means listed APIs can be assigned a requested architecture without relying on manual definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.