vs2012 fixes

I've got some follow-up patch regarding the vs2012 windows.h story, if you don't mind ;)

Tested with mingw and vs2012 on win7. Would be great if @authenticate could have a look though, just to be sure.