ws2_32: Move the getsockopt(IPX_PTYPE) implementation to ntdll.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-07-30 18:55:36 -05:00 committed by Alexandre Julliard
parent 9d619b1fb0
commit ce1c5ffcae
3 changed files with 27 additions and 23 deletions

View File

@ -1922,6 +1922,28 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
return ret ? sock_errno_to_status( errno ) : STATUS_SUCCESS;
}
#ifdef SOL_IPX
case IOCTL_AFD_WINE_GET_IPX_PTYPE:
return do_getsockopt( handle, io, SOL_IPX, IPX_TYPE, out_buffer, out_size );
#elif defined(SO_DEFAULT_HEADERS)
case IOCTL_AFD_WINE_GET_IPX_PTYPE:
{
int fd, needs_close = FALSE;
struct ipx value;
socklen_t len = sizeof(value);
int ret;
if ((status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )))
return status;
ret = getsockopt( fd, 0, SO_DEFAULT_HEADERS, &value, &len );
if (needs_close) close( fd );
if (ret) return sock_errno_to_status( errno );
*(DWORD *)out_buffer = value.ipx_pt;
return STATUS_SUCCESS;
}
#endif
default:
{
if ((code >> 16) == FILE_DEVICE_NETWORK)

View File

@ -2158,7 +2158,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
return SOCKET_ERROR;
} /* end switch(optname) */
}/* end case WS_SOL_SOCKET */
#ifdef HAS_IPX
case WS_NSPROTO_IPX:
{
struct WS_sockaddr_ipx addr;
@ -2166,27 +2166,6 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
int namelen;
switch(optname)
{
case WS_IPX_PTYPE:
if ((fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR;
#ifdef SOL_IPX
if(getsockopt(fd, SOL_IPX, IPX_TYPE, optval, (socklen_t *)optlen) == -1)
{
ret = SOCKET_ERROR;
}
#else
{
struct ipx val;
socklen_t len=sizeof(struct ipx);
if(getsockopt(fd, 0, SO_DEFAULT_HEADERS, &val, &len) == -1 )
ret = SOCKET_ERROR;
else
*optval = (int)val.ipx_pt;
}
#endif
TRACE("ptype: %d (fd: %d)\n", *(int*)optval, fd);
release_sock_fd( s, fd );
return ret;
case WS_IPX_ADDRESS:
/*
* On a Win2000 system with one network card there are usually
@ -2217,12 +2196,14 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
*(int*)optval = 1; /* As noted under IPX_ADDRESS we have just one card. */
return 0;
case WS_IPX_PTYPE:
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPX_PTYPE, optval, optlen );
default:
FIXME("IPX optname:%x\n", optname);
return SOCKET_ERROR;
}/* end switch(optname) */
} /* end case WS_NSPROTO_IPX */
#endif
#ifdef HAS_IRDA
#define MAX_IRDA_DEVICES 10

View File

@ -223,6 +223,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_SET_IPV6_UNICAST_IF WINE_AFD_IOC(278)
#define IOCTL_AFD_WINE_GET_IPV6_V6ONLY WINE_AFD_IOC(279)
#define IOCTL_AFD_WINE_SET_IPV6_V6ONLY WINE_AFD_IOC(280)
#define IOCTL_AFD_WINE_GET_IPX_PTYPE WINE_AFD_IOC(281)
struct afd_create_params
{