- Fix calculation of required buffer size.
- Add support for detecting the IFF_MULTICAST flag. - Stub for SIO_ADDRESS_LIST_CHANGE.
This commit is contained in:
parent
179dc259e4
commit
cf78e15c2b
|
@ -1812,6 +1812,10 @@ INT WINAPI WSAIoctl (SOCKET s,
|
||||||
|
|
||||||
if (fd == -1) return SOCKET_ERROR;
|
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);
|
||||||
|
|
||||||
switch( dwIoControlCode )
|
switch( dwIoControlCode )
|
||||||
{
|
{
|
||||||
case SIO_GET_INTERFACE_LIST:
|
case SIO_GET_INTERFACE_LIST:
|
||||||
|
@ -1849,8 +1853,9 @@ INT WINAPI WSAIoctl (SOCKET s,
|
||||||
{
|
{
|
||||||
PIP_ADAPTER_INFO ptr;
|
PIP_ADAPTER_INFO ptr;
|
||||||
|
|
||||||
if (size > cbOutBuffer)
|
if (size*sizeof(INTERFACE_INFO)/sizeof(IP_ADAPTER_INFO) > cbOutBuffer)
|
||||||
{
|
{
|
||||||
|
WARN("Buffer too small = %lu, cbOutBuffer = %lu\n", size, cbOutBuffer);
|
||||||
HeapFree(GetProcessHeap(),0,table);
|
HeapFree(GetProcessHeap(),0,table);
|
||||||
release_sock_fd( s, fd );
|
release_sock_fd( s, fd );
|
||||||
WSASetLastError(WSAEFAULT);
|
WSASetLastError(WSAEFAULT);
|
||||||
|
@ -1889,6 +1894,8 @@ INT WINAPI WSAIoctl (SOCKET s,
|
||||||
intArray->iiFlags |= WS_IFF_LOOPBACK;
|
intArray->iiFlags |= WS_IFF_LOOPBACK;
|
||||||
if (ifInfo.ifr_flags & IFF_UP)
|
if (ifInfo.ifr_flags & IFF_UP)
|
||||||
intArray->iiFlags |= WS_IFF_UP;
|
intArray->iiFlags |= WS_IFF_UP;
|
||||||
|
if (ifInfo.ifr_flags & IFF_MULTICAST)
|
||||||
|
intArray->iiFlags |= WS_IFF_MULTICAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
addr = inet_addr(ptr->IpAddressList.IpAddress.String);
|
addr = inet_addr(ptr->IpAddressList.IpAddress.String);
|
||||||
|
@ -1938,6 +1945,12 @@ INT WINAPI WSAIoctl (SOCKET s,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SIO_ADDRESS_LIST_CHANGE:
|
||||||
|
FIXME("-> SIO_ADDRESS_LIST_CHANGE request: stub\n");
|
||||||
|
/* FIXME: error and return code depend on whether socket was created
|
||||||
|
* with WSA_FLAG_OVERLAPPED, but there is no easy way to get this */
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
WARN("\tunsupported WS_IOCTL cmd (%08lx)\n", dwIoControlCode);
|
WARN("\tunsupported WS_IOCTL cmd (%08lx)\n", dwIoControlCode);
|
||||||
release_sock_fd( s, fd );
|
release_sock_fd( s, fd );
|
||||||
|
|
|
@ -117,6 +117,7 @@ extern "C" {
|
||||||
#define IOC_WS2 0x08000000
|
#define IOC_WS2 0x08000000
|
||||||
#define IOC_PROTOCOL 0x10000000
|
#define IOC_PROTOCOL 0x10000000
|
||||||
#define IOC_VENDOR 0x18000000
|
#define IOC_VENDOR 0x18000000
|
||||||
|
#define IOC_VOID 0x20000000
|
||||||
#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
|
#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
|
||||||
#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
|
#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
|
||||||
#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
|
#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
|
||||||
|
|
Loading…
Reference in New Issue