Some Win32 API fixes for cygwin64

Again some code that assumes windows types are as long as they look like they are :)