ws2_32: Debug the ioctl code name whenever possible.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bruno Jesus 2016-09-06 15:30:35 -03:00 committed by Alexandre Julliard
parent f53c320f04
commit 048964b40e
1 changed files with 59 additions and 9 deletions

View File

@ -4393,11 +4393,61 @@ char* WINAPI WS_inet_ntoa(struct WS_in_addr in)
return data->ntoa_buffer;
}
static const char *debugstr_wsaioctl(DWORD ioctl)
static const char *debugstr_wsaioctl(DWORD code)
{
const char *buf_type, *family;
const char *name = NULL, *buf_type, *family;
switch(ioctl & 0x18000000)
#define IOCTL_NAME(x) case x: name = #x; break
switch (code)
{
IOCTL_NAME(WS_FIONBIO);
IOCTL_NAME(WS_FIONREAD);
IOCTL_NAME(WS_SIOCATMARK);
/* IOCTL_NAME(WS_SIO_ACQUIRE_PORT_RESERVATION); */
IOCTL_NAME(WS_SIO_ADDRESS_LIST_CHANGE);
IOCTL_NAME(WS_SIO_ADDRESS_LIST_QUERY);
IOCTL_NAME(WS_SIO_ASSOCIATE_HANDLE);
/* IOCTL_NAME(WS_SIO_ASSOCIATE_PORT_RESERVATION);
IOCTL_NAME(WS_SIO_BASE_HANDLE);
IOCTL_NAME(WS_SIO_BSP_HANDLE);
IOCTL_NAME(WS_SIO_BSP_HANDLE_SELECT);
IOCTL_NAME(WS_SIO_BSP_HANDLE_POLL);
IOCTL_NAME(WS_SIO_CHK_QOS); */
IOCTL_NAME(WS_SIO_ENABLE_CIRCULAR_QUEUEING);
IOCTL_NAME(WS_SIO_FIND_ROUTE);
IOCTL_NAME(WS_SIO_FLUSH);
IOCTL_NAME(WS_SIO_GET_BROADCAST_ADDRESS);
IOCTL_NAME(WS_SIO_GET_EXTENSION_FUNCTION_POINTER);
IOCTL_NAME(WS_SIO_GET_GROUP_QOS);
IOCTL_NAME(WS_SIO_GET_INTERFACE_LIST);
/* IOCTL_NAME(WS_SIO_GET_INTERFACE_LIST_EX); */
IOCTL_NAME(WS_SIO_GET_QOS);
/* IOCTL_NAME(WS_SIO_IDEAL_SEND_BACKLOG_CHANGE);
IOCTL_NAME(WS_SIO_IDEAL_SEND_BACKLOG_QUERY); */
IOCTL_NAME(WS_SIO_KEEPALIVE_VALS);
IOCTL_NAME(WS_SIO_MULTIPOINT_LOOPBACK);
IOCTL_NAME(WS_SIO_MULTICAST_SCOPE);
/* IOCTL_NAME(WS_SIO_QUERY_RSS_SCALABILITY_INFO);
IOCTL_NAME(WS_SIO_QUERY_WFP_ALE_ENDPOINT_HANDLE); */
IOCTL_NAME(WS_SIO_RCVALL);
IOCTL_NAME(WS_SIO_RCVALL_IGMPMCAST);
IOCTL_NAME(WS_SIO_RCVALL_MCAST);
/* IOCTL_NAME(WS_SIO_RELEASE_PORT_RESERVATION); */
IOCTL_NAME(WS_SIO_ROUTING_INTERFACE_CHANGE);
IOCTL_NAME(WS_SIO_ROUTING_INTERFACE_QUERY);
IOCTL_NAME(WS_SIO_SET_COMPATIBILITY_MODE);
IOCTL_NAME(WS_SIO_SET_GROUP_QOS);
IOCTL_NAME(WS_SIO_SET_QOS);
IOCTL_NAME(WS_SIO_TRANSLATE_HANDLE);
IOCTL_NAME(WS_SIO_UDP_CONNRESET);
}
#undef IOCTL_NAME
if (name)
return name + 3;
/* If this is not a known code split its bits */
switch(code & 0x18000000)
{
case WS_IOC_WS2:
family = "IOC_WS2";
@ -4410,12 +4460,12 @@ static const char *debugstr_wsaioctl(DWORD ioctl)
break;
default: /* WS_IOC_UNIX */
{
BYTE size = (ioctl >> 16) & WS_IOCPARM_MASK;
char x = (ioctl & 0xff00) >> 8;
BYTE y = ioctl & 0xff;
BYTE size = (code >> 16) & WS_IOCPARM_MASK;
char x = (code & 0xff00) >> 8;
BYTE y = code & 0xff;
char args[14];
switch (ioctl & (WS_IOC_VOID|WS_IOC_INOUT))
switch (code & (WS_IOC_VOID|WS_IOC_INOUT))
{
case WS_IOC_VOID:
buf_type = "_IO";
@ -4439,7 +4489,7 @@ static const char *debugstr_wsaioctl(DWORD ioctl)
}
/* We are different from WS_IOC_UNIX. */
switch (ioctl & (WS_IOC_VOID|WS_IOC_INOUT))
switch (code & (WS_IOC_VOID|WS_IOC_INOUT))
{
case WS_IOC_VOID:
buf_type = "_WSAIO";
@ -4459,7 +4509,7 @@ static const char *debugstr_wsaioctl(DWORD ioctl)
}
return wine_dbg_sprintf("%s(%s, %d)", buf_type, family,
(USHORT)(ioctl & 0xffff));
(USHORT)(code & 0xffff));
}
/* do an ioctl call through the server */