Copypaste resolving functions from unix.c to win32.c