Zebediah Figura : ws2_32: Fix the indentation of SIO_ROUTING_INTERFACE_QUERY.

Alexandre Julliard julliard at winehq.org
Wed Jun 9 16:43:05 CDT 2021


Module: wine
Branch: master
Commit: 306b2441076a67a057c0217c780d1a4eea1ce624
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=306b2441076a67a057c0217c780d1a4eea1ce624

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Jun  9 00:04:45 2021 -0500

ws2_32: Fix the indentation of SIO_ROUTING_INTERFACE_QUERY.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/socket.c | 115 ++++++++++++++++++++++++++-------------------------
 1 file changed, 58 insertions(+), 57 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 1b3ad2fa6d0..7493b9e9f87 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3428,63 +3428,64 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
         return ret ? -1 : 0;
     }
 
-   case WS_SIO_ROUTING_INTERFACE_QUERY:
-   {
-       struct WS_sockaddr *daddr = (struct WS_sockaddr *)in_buff;
-       struct WS_sockaddr_in *daddr_in = (struct WS_sockaddr_in *)daddr;
-       struct WS_sockaddr_in *saddr_in = out_buff;
-       MIB_IPFORWARDROW row;
-       PMIB_IPADDRTABLE ipAddrTable = NULL;
-       DWORD size, i, found_index;
-
-       TRACE("-> WS_SIO_ROUTING_INTERFACE_QUERY request\n");
-
-       if (!in_buff || in_size < sizeof(struct WS_sockaddr) ||
-           !out_buff || out_size < sizeof(struct WS_sockaddr_in))
-       {
-           SetLastError(WSAEFAULT);
-           return SOCKET_ERROR;
-       }
-       if (daddr->sa_family != WS_AF_INET)
-       {
-           FIXME("unsupported address family %d\n", daddr->sa_family);
-           status = WSAEAFNOSUPPORT;
-           break;
-       }
-       if (GetBestRoute(daddr_in->sin_addr.S_un.S_addr, 0, &row) != NOERROR ||
-           GetIpAddrTable(NULL, &size, FALSE) != ERROR_INSUFFICIENT_BUFFER)
-       {
-           status = WSAEFAULT;
-           break;
-       }
-       ipAddrTable = HeapAlloc(GetProcessHeap(), 0, size);
-       if (GetIpAddrTable(ipAddrTable, &size, FALSE))
-       {
-           HeapFree(GetProcessHeap(), 0, ipAddrTable);
-           status = WSAEFAULT;
-           break;
-       }
-       for (i = 0, found_index = ipAddrTable->dwNumEntries;
-            i < ipAddrTable->dwNumEntries; i++)
-       {
-           if (ipAddrTable->table[i].dwIndex == row.dwForwardIfIndex)
-               found_index = i;
-       }
-       if (found_index == ipAddrTable->dwNumEntries)
-       {
-           ERR("no matching IP address for interface %d\n",
-               row.dwForwardIfIndex);
-           HeapFree(GetProcessHeap(), 0, ipAddrTable);
-           status = WSAEFAULT;
-           break;
-       }
-       saddr_in->sin_family = WS_AF_INET;
-       saddr_in->sin_addr.S_un.S_addr = ipAddrTable->table[found_index].dwAddr;
-       saddr_in->sin_port = 0;
-       total = sizeof(struct WS_sockaddr_in);
-       HeapFree(GetProcessHeap(), 0, ipAddrTable);
-       break;
-   }
+    case WS_SIO_ROUTING_INTERFACE_QUERY:
+    {
+        struct WS_sockaddr *daddr = (struct WS_sockaddr *)in_buff;
+        struct WS_sockaddr_in *daddr_in = (struct WS_sockaddr_in *)daddr;
+        struct WS_sockaddr_in *saddr_in = out_buff;
+        MIB_IPFORWARDROW row;
+        PMIB_IPADDRTABLE ipAddrTable = NULL;
+        DWORD size, i, found_index;
+
+        TRACE( "-> WS_SIO_ROUTING_INTERFACE_QUERY request\n" );
+
+        if (!in_buff || in_size < sizeof(struct WS_sockaddr) ||
+            !out_buff || out_size < sizeof(struct WS_sockaddr_in))
+        {
+            SetLastError( WSAEFAULT );
+            return -1;
+        }
+        if (daddr->sa_family != WS_AF_INET)
+        {
+            FIXME("unsupported address family %d\n", daddr->sa_family);
+            status = WSAEAFNOSUPPORT;
+            break;
+        }
+        if (GetBestRoute( daddr_in->sin_addr.S_un.S_addr, 0, &row ) != NOERROR ||
+            GetIpAddrTable( NULL, &size, FALSE ) != ERROR_INSUFFICIENT_BUFFER)
+        {
+            status = WSAEFAULT;
+            break;
+        }
+        ipAddrTable = HeapAlloc( GetProcessHeap(), 0, size );
+        if (GetIpAddrTable( ipAddrTable, &size, FALSE ))
+        {
+            HeapFree( GetProcessHeap(), 0, ipAddrTable );
+            status = WSAEFAULT;
+            break;
+        }
+        for (i = 0, found_index = ipAddrTable->dwNumEntries;
+             i < ipAddrTable->dwNumEntries; i++)
+        {
+            if (ipAddrTable->table[i].dwIndex == row.dwForwardIfIndex)
+                found_index = i;
+        }
+        if (found_index == ipAddrTable->dwNumEntries)
+        {
+            ERR("no matching IP address for interface %d\n",
+                row.dwForwardIfIndex);
+            HeapFree( GetProcessHeap(), 0, ipAddrTable );
+            status = WSAEFAULT;
+            break;
+        }
+        saddr_in->sin_family = WS_AF_INET;
+        saddr_in->sin_addr.S_un.S_addr = ipAddrTable->table[found_index].dwAddr;
+        saddr_in->sin_port = 0;
+        total = sizeof(struct WS_sockaddr_in);
+        HeapFree( GetProcessHeap(), 0, ipAddrTable );
+        break;
+    }
+
    case WS_SIO_SET_COMPATIBILITY_MODE:
        TRACE("WS_SIO_SET_COMPATIBILITY_MODE ignored\n");
        status = WSAEOPNOTSUPP;




More information about the wine-cvs mailing list