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.06k stars 87 forks source link

Regression for `CreateFileW` (no `FILE_ACCESS_FLAG` enum) #914

Closed alexrp closed 1 year ago

alexrp commented 1 year ago

Actual behavior

image image

I suspect that this might actually be a Win32Metadata issue, since various other APIs still get their associated enums as expected, but filing this here as I'm unsure.

Expected behavior

This code used to work. The enum seems to have vanished.

Repro steps

  1. NativeMethods.txt content:

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

    {
    "className": "WindowsPInvoke",
    "allowMarshaling": false,
    "wideCharOnly": false,
    "emitSingleFile": true
    }

Context

AArnott commented 1 year ago

Duplicate of #893