Added platform independent implementation for win32 native code