microsoft / CsWin32

A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project.
MIT License
1.99k stars 84 forks source link

`PCWSTR` is not marked with `[GeneratedCode]` #1216

Open colejohnson66 opened 1 week ago

colejohnson66 commented 1 week ago

Actual behavior

The generated type, Windows.Win32.Foundation.PCWSTR is not marked with [GeneratedCode] like the other generated ones are (such as BOOL, CHAR, etc.). This causes it to be flagged as "uncovered" in test coverage reports.

Expected behavior

PCWSTR to be marked with [GeneratedCode] like the other generated types.

Repro steps

  1. NativeMethods.txt content:

    CreateFile
  2. Observe generation of various Windows.Win32.X.g.cs files by CsWin32.

  3. Observe that all types but that in Windows.Win32.PCWSTR.g.cs are marked with [GeneratedCode]

Context