mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:50:21 +00:00
- 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;
|
||||
|
||||
TRACE("%d, 0x%08lx, %p, %ld, %p, %ld, %p, %p, %p\n",
|
||||
s, dwIoControlCode, lpvInBuffer, cbInBuffer, lpbOutBuffer,
|
||||
cbOutBuffer, lpcbBytesReturned, lpOverlapped, lpCompletionRoutine);
|
||||
|
||||
switch( dwIoControlCode )
|
||||
{
|
||||
case SIO_GET_INTERFACE_LIST:
|
||||
|
@ -1849,8 +1853,9 @@ INT WINAPI WSAIoctl (SOCKET s,
|
|||
{
|
||||
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);
|
||||
release_sock_fd( s, fd );
|
||||
WSASetLastError(WSAEFAULT);
|
||||
|
@ -1889,6 +1894,8 @@ INT WINAPI WSAIoctl (SOCKET s,
|
|||
intArray->iiFlags |= WS_IFF_LOOPBACK;
|
||||
if (ifInfo.ifr_flags & 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);
|
||||
|
@ -1938,6 +1945,12 @@ INT WINAPI WSAIoctl (SOCKET s,
|
|||
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:
|
||||
WARN("\tunsupported WS_IOCTL cmd (%08lx)\n", dwIoControlCode);
|
||||
release_sock_fd( s, fd );
|
||||
|
|
|
@ -117,6 +117,7 @@ extern "C" {
|
|||
#define IOC_WS2 0x08000000
|
||||
#define IOC_PROTOCOL 0x10000000
|
||||
#define IOC_VENDOR 0x18000000
|
||||
#define IOC_VOID 0x20000000
|
||||
#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
|
||||
#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
|
||||
#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
|
||||
|
|
Loading…
Reference in a new issue