Fixed some issues found by winapi_check.

16 files changed