microsoft/CsWin32
View on GitHub ↗ ★ 2,527 C#
A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project.
9 mentions on Hacker News by 5 people: 1 story, 8 comments · first 2022-06-10 · latest 2026-03-22
20082026
-
Thanfully, you don't need to write p/invoke stuff yourself anymore. https://github.com/microsoft/cswin32 creates methods and all related structs for you. It's also AOT compatible (if you specify it). It works for calling C and COM…
comment by Pesthuf · 2026-03-22 · in Windows native app development is a mess -
…spans, et. al., make the overhead undetectable in many cases. https://github.com/prasannavl/WinApi https://github.com/microsoft/CsWin32
comment by bob1029 · 2026-02-15 · in I fixed Windows native development -
…libraries. Some time ago I described this process on my blog for the detours library [2] [1] https://github.com/microsoft/CsWin32 [2] https://lowleveldesign.org/2023/11/23/generating-c-bindings-...
comment by lowleveldesign · 2025-07-30 · in .NET 10 Preview 6 brings JIT improvements, one-shot tool execution -
▲ 4
C#/Win32 P/Invoke Source Generatorstory by bob1029 · 2025-05-14 · 0 comments
-
…ttps://github.com/dotnet/ClangSharp?tab=readme-ov-file#gene... Also because this is Windows, there is https://github.com/microsoft/CsWin32 already (and adjacent libraries) which rely on the same generator.
comment by neonsunset · 2024-12-01 · in WinDepends – A Rewrite of the Dependency Walker -
…with native memory blocks is straightforward and intuitive for people with C/C++ background. [1] https://github.com/microsoft/CsWin32 [2] https://lowleveldesign.wordpress.com/2024/07/11/implementing...
comment by lowleveldesign · 2024-10-31 · in A comparison of Rust’s borrow checker to the one in C# -
…mine recently got rid of C++ component thanks to the former, simplifying the solution build. [0]: https://github.com/microsoft/CsWin32 [1]: https://github.com/microsoft/CsWinRT
comment by neonsunset · 2024-06-24 · in LINQPad – The .NET Programmer's Playground -
…COM interests only a limited part of community, and there also exists actively maintained https://github.com/microsoft/CsWin32 A popular (if not the most, depending on location) choice to use EF Core with is PostgreSQL. Meanwhile, ASP.NET…
comment by neonsunset · 2024-03-26 · in Tech Debt: My Rust Library Is Now a CDO -
…implementations for my own amusement. A quick Google Search netted the following project ( https://github.com/microsoft/CsWin32 ). Looks like my evening is gone.
comment by jdsfighter · 2022-06-10 · in Show HN: My small program from 2007 that gave Internet Explorer tabs