Author: cwittich
Date: Fri Oct  7 16:17:49 2016
New Revision: 72924

URL: http://svn.reactos.org/svn/reactos?rev=72924&view=rev
Log:
[WS2_32] fix various ws2_32:sock failures with return codes. By Peter Hater. 
CORE-12104

Modified:
    trunk/reactos/dll/win32/ws2_32/src/addrinfo.c

Modified: trunk/reactos/dll/win32/ws2_32/src/addrinfo.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/addrinfo.c?rev=72924&r1=72923&r2=72924&view=diff
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/addrinfo.c       [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/addrinfo.c       [iso-8859-1] Fri Oct  7 
16:17:49 2016
@@ -556,6 +556,7 @@
         iFlags = ptHints->ai_flags;
         if ((iFlags & AI_CANONNAME) && !pszNodeName)
         {
+            SetLastError(EAI_BADFLAGS);
             return EAI_BADFLAGS;
         }
 
@@ -563,6 +564,7 @@
         iFamily = ptHints->ai_family;
         if ((iFamily != PF_UNSPEC) && (iFamily != PF_INET))
         {
+            SetLastError(EAI_FAMILY);
             return EAI_FAMILY;
         }
 
@@ -573,6 +575,7 @@
             (iSocketType != SOCK_DGRAM) &&
             (iSocketType != SOCK_RAW))
         {
+            SetLastError(EAI_SOCKTYPE);
             return EAI_SOCKTYPE;
         }
 
@@ -638,6 +641,7 @@
             /* If we got 0, then fail */
             if (wPort == 0)
             {
+                SetLastError(EAI_SERVICE);
                 return EAI_SERVICE;
             }
 
@@ -751,6 +755,7 @@
     }
 
     /* Return to caller */
+    SetLastError(iError);
     return iError;
 }
 
@@ -908,6 +913,7 @@
     else
     {
         /* Unsupported family */
+        SetLastError(EAI_FAMILY);
         return EAI_FAMILY;
     } 
 


Reply via email to