windows: make some functions static
code style fixes, mostly windows