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

Leverage AlsoUsableForAttribute for more interoperable typedefs #930

Closed mikebattista closed 1 year ago

mikebattista commented 1 year ago

Fixed #199 Fixed #924

Adds implicit conversion operators between AlsoUsableFor types. An existing example included in the tests is BCRYPT_KEY_HANDLE -> BCRYPT_HANDLE.

When https://github.com/microsoft/win32metadata/issues/1517 is fixed, this will also support HMODULE <=> HINSTANCE conversions.