Bruno Jesus : ws2_32: Make WS_EnterSingleProtocol return a boolean.

Alexandre Julliard julliard at winehq.org
Mon Sep 16 16:57:22 CDT 2013


Module: wine
Branch: master
Commit: 78ca87a00baf08c577ea526a4cc91f5e9858006c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=78ca87a00baf08c577ea526a4cc91f5e9858006c

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Mon Sep 16 01:44:03 2013 -0300

ws2_32: Make WS_EnterSingleProtocol return a boolean.

---

 dlls/ws2_32/socket.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index c6b3593..b591c5e 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1592,15 +1592,14 @@ static INT WS_DuplicateSocket(BOOL unicode, SOCKET s, DWORD dwProcessId, LPWSAPR
  *    buffer.
  *
  * RETURNS
- *    1 if a protocol was entered into the buffer.
- *    SOCKET_ERROR otherwise.
+ *    TRUE if a protocol was entered into the buffer.
  *
  * BUGS
  *    - only implemented for IPX, SPX, SPXII, TCP, UDP
  *    - there is no check that the operating system supports the returned
  *      protocols
  */
-static INT WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
+static BOOL WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
 {
     memset( info, 0, sizeof(WSAPROTOCOL_INFOW) );
     info->iProtocol = protocol;
@@ -1694,9 +1693,9 @@ static INT WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
 
     default:
         FIXME("unknown Protocol <0x%08x>\n", protocol);
-        return SOCKET_ERROR;
+        return FALSE;
     }
-    return 1;
+    return TRUE;
 }
 
 /*****************************************************************************
@@ -1705,14 +1704,14 @@ static INT WS_EnterSingleProtocolW( INT protocol, WSAPROTOCOL_INFOW* info )
  *    see function WS_EnterSingleProtocolW
  *
  */
-static INT WS_EnterSingleProtocolA( INT protocol, WSAPROTOCOL_INFOA* info )
+static BOOL WS_EnterSingleProtocolA( INT protocol, WSAPROTOCOL_INFOA* info )
 {
     WSAPROTOCOL_INFOW infow;
     INT ret;
     memset( info, 0, sizeof(WSAPROTOCOL_INFOA) );
 
     ret = WS_EnterSingleProtocolW( protocol, &infow );
-    if (ret != SOCKET_ERROR)
+    if (ret)
     {
         /* convert the structure from W to A */
         memcpy( info, &infow, FIELD_OFFSET( WSAPROTOCOL_INFOA, szProtocol ) );
@@ -1758,12 +1757,12 @@ static INT WS_EnumProtocols( BOOL unicode, const INT *protocols, LPWSAPROTOCOL_I
     {
         if (unicode)
         {
-            if (WS_EnterSingleProtocolW( protocols[i], &info.w[items] ) != SOCKET_ERROR)
+            if (WS_EnterSingleProtocolW( protocols[i], &info.w[items] ))
                 items++;
         }
         else
         {
-            if (WS_EnterSingleProtocolA( protocols[i], &info.a[items] ) != SOCKET_ERROR)
+            if (WS_EnterSingleProtocolA( protocols[i], &info.a[items] ))
                 items++;
         }
     }




More information about the wine-cvs mailing list