Added portability to Windows platforms (hopefully) using Windows API functions & types where possible