support windows.

some functions are disabled on windows.