Fixed some issues found by winapi_check.

23 files changed