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.05k stars 85 forks source link

Prepare for multi-metadata input to source generator #944

Closed AArnott closed 1 year ago

AArnott commented 1 year ago

This is in preparation for #895.

This involved refactoring to extract an IGenerator interface that Generator and SuperGenerator share so tests could switch as-is to a multi-input generator.

Lots of fixes were required in following type references across winmd files. I'm certain there are more bugs in this area, but this gets the WDK metadata to work. Although it has a fix coming, so CsWin32 will pick it up when that fix is available on nuget.org.