Fix #6:correct allocation size of WriteAll on Windows