moved win32 functions interally