Module: wine Branch: master Commit: 971d5f3f89b2113f4b1b4e05e3c2312860c13fe3 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=971d5f3f89b2113f4b1b4e05...
Author: Marcus Meissner marcus@jet.franken.de Date: Mon Oct 2 14:08:25 2006 +0200
ws2_32: Implemented FIONBIO and FIONREAD in WSAIoctl.
---
dlls/ws2_32/socket.c | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index c752b39..37a1de7 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2102,8 +2102,6 @@ char* WINAPI WS_inet_ntoa(struct WS_in_a /********************************************************************** * WSAIoctl (WS2_32.50) * - * - * FIXME: Only SIO_GET_INTERFACE_LIST option implemented. */ INT WINAPI WSAIoctl(SOCKET s, DWORD dwIoControlCode, @@ -2116,6 +2114,7 @@ INT WINAPI WSAIoctl(SOCKET s, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) { int fd = get_sock_fd( s, 0, NULL ); + INT ret;
if (fd == -1) return SOCKET_ERROR;
@@ -2125,6 +2124,32 @@ INT WINAPI WSAIoctl(SOCKET s,
switch( dwIoControlCode ) { + 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; + 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; case SIO_GET_INTERFACE_LIST: { INTERFACE_INFO* intArray = (INTERFACE_INFO*)lpbOutBuffer; @@ -2257,6 +2282,10 @@ #endif * with WSA_FLAG_OVERLAPPED, but there is no easy way to get this */ break;
+ case SIO_FLUSH: + FIXME("SIO_FLUSH: stub.\n"); + break; + default: FIXME("unsupported WS_IOCTL cmd (%08lx)\n", dwIoControlCode); release_sock_fd( s, fd );