Modified to build also with MS VisualStudio 2008
Implemented previously un-implemented functions in windows