https://github.com/smourier/win32interopbuilder
A tool to generate .NET AOT-friendly Win32 interop code from Microsoft.Windows.SDK.Win32Metadata package.
https://github.com/smourier/win32interopbuilder
aot dotnet dotnet-core interop win32
Last synced: 14 days ago
JSON representation
A tool to generate .NET AOT-friendly Win32 interop code from Microsoft.Windows.SDK.Win32Metadata package.
- Host: GitHub
- URL: https://github.com/smourier/win32interopbuilder
- Owner: smourier
- License: mit
- Created: 2024-04-17T16:25:33.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-03T17:36:41.000Z (23 days ago)
- Last Synced: 2025-04-12T17:14:29.889Z (14 days ago)
- Topics: aot, dotnet, dotnet-core, interop, win32
- Language: C#
- Homepage:
- Size: 201 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Win32InteropBuilder
A tool to generate .NET AOT-friendly Win32 interop code from Microsoft.Windows.SDK.Win32Metadata package.An example of this is [DirectNAot](https://github.com/smourier/DirectNAot) which is an AOT-friendly version of [DirectN](https://github.com/smourier/DirectN).
The key points that drive how code is generated and built:
* modern code exclusively based on .NET 8 newer source-generated LibraryImport, source-generated ComWrappers, etc. Note the result is the a .dll size is significantly bigger than what it was before.
* unsafe usage is limited.
* raw pointers usage is not exposed, only interface types, object types, or nint depending on the situation.
* doing interop is inherently unsafe but we want to keep a.NET-like programming whenever possible. The generated code serves a similar purpose to the CsWin32 project, but the generated code and how we program it are quite different.