Make readFileToBuffer more robust by calling CreateFileA with FILE_SHARE_READ share mode.