build protocol on windows
fix many other windows errors