Changed back to a function for the cyg-to-win conversion, for performance reasons.