some changes to native code for windows