Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
85230942
Commit
85230942
authored
Oct 03, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Avoid retrieving the fd twice in WSAIoctl.
parent
971d5f3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
26 deletions
+9
-26
socket.c
dlls/ws2_32/socket.c
+9
-26
No files found.
dlls/ws2_32/socket.c
View file @
85230942
...
...
@@ -2113,11 +2113,6 @@ INT WINAPI WSAIoctl(SOCKET s,
LPWSAOVERLAPPED
lpOverlapped
,
LPWSAOVERLAPPED_COMPLETION_ROUTINE
lpCompletionRoutine
)
{
int
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
INT
ret
;
if
(
fd
==
-
1
)
return
SOCKET_ERROR
;
TRACE
(
"%d, 0x%08lx, %p, %ld, %p, %ld, %p, %p, %p
\n
"
,
s
,
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpbOutBuffer
,
cbOutBuffer
,
lpcbBytesReturned
,
lpOverlapped
,
lpCompletionRoutine
);
...
...
@@ -2126,50 +2121,40 @@ INT WINAPI WSAIoctl(SOCKET s,
{
case
WS_FIONBIO
:
if
(
cbInBuffer
!=
sizeof
(
u_long
))
{
release_sock_fd
(
s
,
fd
);
WSASetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
ret
=
WS_ioctlsocket
(
s
,
WS_FIONBIO
,
lpvInBuffer
);
if
(
ret
==
SOCKET_ERROR
)
{
release_sock_fd
(
s
,
fd
);
/* last error already set by WS_ioctlsocket */
return
ret
;
}
break
;
return
WS_ioctlsocket
(
s
,
WS_FIONBIO
,
lpvInBuffer
);
case
WS_FIONREAD
:
if
(
cbOutBuffer
!=
sizeof
(
u_long
))
{
release_sock_fd
(
s
,
fd
);
WSASetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
ret
=
WS_ioctlsocket
(
s
,
WS_FIONREAD
,
lpbOutBuffer
);
if
(
ret
==
SOCKET_ERROR
)
{
release_sock_fd
(
s
,
fd
);
/* last error already set by WS_ioctlsocket */
return
ret
;
}
break
;
return
WS_ioctlsocket
(
s
,
WS_FIONREAD
,
lpbOutBuffer
);
case
SIO_GET_INTERFACE_LIST
:
{
INTERFACE_INFO
*
intArray
=
(
INTERFACE_INFO
*
)
lpbOutBuffer
;
DWORD
size
,
numInt
,
apiReturn
;
int
fd
;
TRACE
(
"-> SIO_GET_INTERFACE_LIST request
\n
"
);
if
(
!
lpbOutBuffer
)
{
release_sock_fd
(
s
,
fd
);
WSASetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
if
(
!
lpcbBytesReturned
)
{
release_sock_fd
(
s
,
fd
);
WSASetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
if
(
fd
==
-
1
)
return
SOCKET_ERROR
;
apiReturn
=
GetAdaptersInfo
(
NULL
,
&
size
);
if
(
apiReturn
==
ERROR_NO_DATA
)
{
...
...
@@ -2273,6 +2258,7 @@ INT WINAPI WSAIoctl(SOCKET s,
}
/* Calculate the size of the array being returned */
*
lpcbBytesReturned
=
sizeof
(
INTERFACE_INFO
)
*
numInt
;
release_sock_fd
(
s
,
fd
);
break
;
}
...
...
@@ -2288,13 +2274,10 @@ INT WINAPI WSAIoctl(SOCKET s,
default:
FIXME
(
"unsupported WS_IOCTL cmd (%08lx)
\n
"
,
dwIoControlCode
);
release_sock_fd
(
s
,
fd
);
WSASetLastError
(
WSAEOPNOTSUPP
);
return
SOCKET_ERROR
;
}
/* Function executed with no errors */
release_sock_fd
(
s
,
fd
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment