Win32

* Two fixes for WIN32 compilation
* Add support for XP legacy systems: only enabled if _WIN32_WINNT is set to 0x0501 (XP version)