Fixed some issues found by winapi_check.

18 files changed