Adam Nathan, author of ".NET and COM: The Complete Interoperability Guide", has created a website for P/Invoke declarations, as a way to avoid developers writing their own, because "The rules are complex, and if you make a mistake, you’ll probably corrupt memory".
"Therefore, this site is a repository where you can find, edit, and add PInvoke signatures, user-defined types, and any other information that helps us leverage each other’s efforts. Think of this as the 21st century version of VB6’s "API Text Viewer," a standalone application which used static files such as WIN32API.TXT as input. Did you spend hours figuring out how to successfully define & call a given unmanaged API in managed code? Share (and get credit for) your discovery here! Is there an error on this site? Go ahead and fix it!"