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
2.1k stars 90 forks source link

FlagsAttribute missing for VARENUM #806

Closed harborsiem closed 1 year ago

harborsiem commented 1 year ago

Actual behavior

The VARENUM should have a FlagsAttribute because one can define VT_VECTOR | VT_UI4 for example

Expected behavior

The VARENUM should be marked with ` [Flags]
public enum VARENUM : ushort { ...

`

Repro steps

  1. NativeMethods.txt content:

    VARENUM
  2. NativeMethods.json content (if present):

  3. Any of your own code that should be shared?

Context

harborsiem commented 1 year ago

The problem occurs with the ToString method. It needs extra work without the FlagsAttribute.

It is not really Flags