Fix a lot of warnings

_WIN32_WINNT undefined
Unused arguments(C4100)
Unsafe string functions