A Complete PInvoke Wrapper for .NET - arcdev/engram404 GitHub Wiki

originally posted 2016-04-17 at https://engram404.net/a-complete-pinvoke-wrapper-for-net/

Many, many moons ago…

I was a VB6 developer and was just introduced to the idea of PInvoke (aka Platform Invocation Services).  At the time, this was pushing the limits of what I could do and translating the Win32 C/C++ definitions in VB6 was a nightmare.  I looked and looked for references and found one that (at the time) I really liked: Windows NT 32 Win32 API SuperBible.  (I think I found my copy at Half Price Books.)  Keep in mind that MSDN sucked in those days.

At the time, it occurred to me that it would be really great it someone created the various struct, const and DllImport statements necessary to simply use this library without having to know all of the nitty-gritty detail.  I actually started on that project, but soon got overwhelmed and other things in life took priority.

Fast forward to a few days back.

I found myself, again, needing the power of the direct windows functions and PInvoke.  While MSDN is far better than it was at my introduction, and pinvoke.net is an awesome reference, and many, many more functions are wrapped for us by the .NET Framework, I wondered if anyone finally wrote an entire wrapper.

I thought I had found one in  http://www.xinterop.com/, but alas this just seems to be a tool to generate some type of wrapper (and still requires the header file).

I searched a bit more and still nothing.  I'm admittedly surprised that I haven't come across anything, yet.  Maybe it's worth trying again…

Update – 2016.05.03

I think I found it!

Managed Windows API on SourceForge  appears to have created exactly what I was looking for. There's more documentation here.

I'll look into it some more as time permits and probably write a bit more…

Update - 2022.03.13

Microsoft is creating their own!! check it out at dotnet/pinvoke