Copied mswin version, expect lols