Windows port

Below is a patches approximative related problem on windows.