Ported thread and tap to Win32