Use _wfopen_s to silence MSVC security warnings