P/Invoke is like a poke in the eye. Sure the P/Invoke wiki made life a lot more palatable, but it’s at best incomplete, at worst inaccurate, and invariably you’ll find yourself hand-crafting signatures based on Win32 API doco and bringing a production server to its knees because of a stack imbalance.
In my idler moments I’ve often thought that surely parsing the source-of-truth Win32 header files and spitting out P/Invoke signatures couldn’t be that hard. Fortunately for everyone, the Microsoft Interop Team thought so too, and released the P/Invoke Interop Assistant to Codeplex. Actually that was about 2 years ago, but I only just noticed, so it’s still exciting for me.
As I understand it this has been made easier because Microsoft have been standardizing their header files and adding some additional metadata , which makes it possible to generate accurate signatures (and, presumably, to generate MSDN doco).
Sadly of course, none of this does anything to make any of the underlying API’s any easier to use…
 Actually if you look on Wikipedia, turn’s out there’s a fair few around.
 In retrospect you wonder why managed code took so long to take off as a concept, given how enormously fragile the previous paradigm actually was. SAL’s a great idea, but only highlights how fundamental the problem is.