ASP.NET Tips: Finding the layout of functions and structs for pinvoke

So when you start working with .NET a lot, you will find out quickly that there are some things that you just can't do in .NET and you will need to drop back down to the Win32 API to do something.  When you need to do that, you pinvoke the function that you need to call, setting up the various parameters to pass to it.  This can get very tricky to setup, while some things are easy to transfer, strings for example, others are much harder.

Fortunately, there is a solution.  This site does a great job of listing virtually any command you may want to call, you can find them by which DLL they are in, or searching for it.  It will then give you the signature of what it should look like.  For example, if you want to use the OSVERSIONINFO struct:


You will notice that the site gives both C# and VB code examples.  It also sometimes gives a code example of how to use the structures or functions.  This is a great resource for anyone that needs to call the Win32 API.  There is even an add-in for Visual Studio 2003 and 2005 that you can install.  Download the Add-in here

kick it on

Comments (7)

  1. You’ve been kicked (a good thing) – Trackback from

  2. That is a great tool.  If anyone has others that can help, feel free to post them as well.

  3. In those scenarios C++/CLI is your friend 🙂

    Nice tool by rkpatrick 🙂

  4. gOODiDEA.NET says:

    Web: markItUp! – Lightweight Text Editor CSS Message Box collection Absolute Positioning inside of a

  5. gOODiDEA says:


  6. Josh Coswell says:

    Thanks for great pointers.

    Josh Coswell

Skip to main content