Call WSASetLastError() instead of SetLastError()