Fixed some issues found by winapi_check.

27 files changed