write with win32 api