[1/4] ws2_32: Normalize IPX protocol names using the WS prefix

Bruno Jesus 00cpxxx at gmail.com
Fri Dec 27 09:48:40 CST 2013


All other protocols are in that format and it's important because
there is no Unix equivalent to that names.
-------------- next part --------------

---
 dlls/ws2_32/socket.c | 20 ++++++++++----------
 include/wsipx.h      |  6 ++++++
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index cafe103..b135aec 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -195,9 +195,9 @@ static const INT valid_protocols[] =
 {
     WS_IPPROTO_TCP,
     WS_IPPROTO_UDP,
-    NSPROTO_IPX,
-    NSPROTO_SPX,
-    NSPROTO_SPXII,
+    WS_NSPROTO_IPX,
+    WS_NSPROTO_SPX,
+    WS_NSPROTO_SPXII,
     0
 };
 
@@ -1641,7 +1641,7 @@ static BOOL WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
         strcpyW( info->szProtocol, NameUdpW );
         break;
 
-    case NSPROTO_IPX:
+    case WS_NSPROTO_IPX:
         info->dwServiceFlags1 = XP1_PARTIAL_MESSAGE | XP1_SUPPORT_BROADCAST |
                                 XP1_SUPPORT_MULTIPOINT | XP1_MESSAGE_ORIENTED |
                                 XP1_CONNECTIONLESS;
@@ -1659,7 +1659,7 @@ static BOOL WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
         strcpyW( info->szProtocol, NameIpxW );
         break;
 
-    case NSPROTO_SPX:
+    case WS_NSPROTO_SPX:
         info->dwServiceFlags1 = XP1_IFS_HANDLES | XP1_PSEUDO_STREAM |
                                 XP1_MESSAGE_ORIENTED | XP1_GUARANTEED_ORDER |
                                 XP1_GUARANTEED_DELIVERY;
@@ -1676,7 +1676,7 @@ static BOOL WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
         strcpyW( info->szProtocol, NameSpxW );
         break;
 
-    case NSPROTO_SPXII:
+    case WS_NSPROTO_SPXII:
         info->dwServiceFlags1 = XP1_IFS_HANDLES | XP1_GRACEFUL_CLOSE |
                                 XP1_PSEUDO_STREAM | XP1_MESSAGE_ORIENTED |
                                 XP1_GUARANTEED_ORDER | XP1_GUARANTEED_DELIVERY;
@@ -3207,7 +3207,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
         } /* end switch(optname) */
     }/* end case WS_SOL_SOCKET */
 #ifdef HAS_IPX
-    case NSPROTO_IPX:
+    case WS_NSPROTO_IPX:
     {
         struct WS_sockaddr_ipx addr;
         IPX_ADDRESS_DATA *data;
@@ -3269,7 +3269,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
             FIXME("IPX optname:%x\n", optname);
             return SOCKET_ERROR;
         }/* end switch(optname) */
-    } /* end case NSPROTO_IPX */
+    } /* end case WS_NSPROTO_IPX */
 #endif
 
 #ifdef HAS_IRDA
@@ -4752,7 +4752,7 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
         break; /* case WS_SOL_SOCKET */
 
 #ifdef HAS_IPX
-    case NSPROTO_IPX:
+    case WS_NSPROTO_IPX:
         switch(optname)
         {
         case IPX_PTYPE:
@@ -4789,7 +4789,7 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
             FIXME("opt_name:%x\n", optname);
             return SOCKET_ERROR;
         }
-        break; /* case NSPROTO_IPX */
+        break; /* case WS_NSPROTO_IPX */
 #endif
 
     /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */
diff --git a/include/wsipx.h b/include/wsipx.h
index 67609d8..6aa2946 100644
--- a/include/wsipx.h
+++ b/include/wsipx.h
@@ -36,9 +36,15 @@ typedef struct WS_sockaddr_ipx
 /*
  * constants
  */
+#ifndef USE_WS_PREFIX
 #define NSPROTO_IPX                 1000
 #define NSPROTO_SPX                 1256
 #define NSPROTO_SPXII               1257
+#else
+#define WS_NSPROTO_IPX              1000
+#define WS_NSPROTO_SPX              1256
+#define WS_NSPROTO_SPXII            1257
+#endif
 
 #undef WS
 #endif /* _WINE_WSIPX_ */
-- 
1.8.3.2


More information about the wine-patches mailing list