microsoft / microsoft/CsWin32

Support `public`/`internal` scoping on a per NativeMethod basis.

Open
#1,652 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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.

All too often, I'm having to clone CsWin32 enums that I want to publicly expose within my project, which resorts in me effectively cloning the enum by hand, such as here. This is time-consuming and bloats my codebase.

Describe the solution you'd like

Consider a BannedApiAnalyzers line of M:System.String.IsNullOrEmpty(System.String);Use string.IsNullOrWhiteSpace() instead., a solution could be Public:IMAGE_SUBSYSTEM.

Describe alternatives you've considered

Creating a new project where I can have the entirety of CsWin32 publicised, limited down to what symbols I want, but it doesn't help me here as there'd then be a disconnect between the types used in my internal CsWin32 project and the public CsWin32 project.

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 locating the NativeMethod generation path and how CsWin32 currently determines generated visibility. Compare the proposed Public:IMAGE_SUBSYSTEM syntax with the existing BannedApiAnalyzers-style configuration, then define acceptance cases for per-method public and internal scoping without requiring users to clone generated enums.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.