Reduced the dependency on non-Windows routines.