Replace ThrowWinError with WindowsError class.