ws2_32: Rearrange the code to avoid a needless release_sock_fd().
This commit is contained in:
parent
5c05b14167
commit
e0bbcea6fb
|
@ -1902,22 +1902,23 @@ int WINAPI WSAConnect( SOCKET s, const struct WS_sockaddr* name, int namelen,
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ConnectEx
|
* ConnectEx
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int namelen,
|
static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int namelen,
|
||||||
PVOID sendBuf, DWORD sendBufLen, LPDWORD sent, LPOVERLAPPED ov)
|
PVOID sendBuf, DWORD sendBufLen, LPDWORD sent, LPOVERLAPPED ov)
|
||||||
{
|
{
|
||||||
int fd = get_sock_fd( s, FILE_READ_DATA, NULL );
|
int fd, ret, status;
|
||||||
int ret, status;
|
|
||||||
|
if (!ov)
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
fd = get_sock_fd( s, FILE_READ_DATA, NULL );
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
SetLastError( WSAENOTSOCK );
|
SetLastError( WSAENOTSOCK );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!ov)
|
|
||||||
{
|
|
||||||
release_sock_fd(s, fd);
|
|
||||||
SetLastError( ERROR_INVALID_PARAMETER );
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("socket %04lx, ptr %p %s, length %d, sendptr %p, len %d, ov %p\n",
|
TRACE("socket %04lx, ptr %p %s, length %d, sendptr %p, len %d, ov %p\n",
|
||||||
s, name, debugstr_sockaddr(name), namelen, sendBuf, sendBufLen, ov);
|
s, name, debugstr_sockaddr(name), namelen, sendBuf, sendBufLen, ov);
|
||||||
|
|
Loading…
Reference in New Issue