Metasploit’s Railgun is awesome, but getting things to work correctly can be a pain. Here are some of the resources that have helped me out:
System Error Codes.aspx”) - This is hands down the best resource you have, it will tell you what that stupid “5” or “1314” means in your return value. Keep this tab open to circumvent crazed bovine attacks.
theForger’s Win32 API Programming Tutorial - A really good place to start when you are getting to know the Windows API and the frustrations that come along with it. I highly recommend going through it first.
MS Windows API Reference - Gigantic, and not the easiest to navigate, but really good for knowing what calls were added with each version of Windows as well as a basic (alphabetic) list of calls. Good if you know where you are going.
The Undocumented Functions - Win NT/2k/XP/2k3 - A really old link but has good references to undocumented functions that have helped circumvent some of the stupidity of other more complicated functions.
WineAPI Documentation - A great resource of API calls that mimic the Microsoft ones (Undocumented and Documented).
Hope this helps and I look forward to seeing what you come up with…