Changeset 552

Jun 26, 2006 10:02:28 AM (17 years ago)

Added Winsock error code to the error message

1 edited


  • pjproject/trunk/pjlib/src/pj/os_error_win32.c

    r330 r552  
    4040    const char *msg; 
    4141} gaErrorList[] = { 
    42     {WSAEINTR,           "Interrupted system call"}, 
    43     {WSAEBADF,           "Bad file number"}, 
    44     {WSAEACCES,          "Permission denied"}, 
    45     {WSAEFAULT,          "Bad address"}, 
    46     {WSAEINVAL,          "Invalid argument"}, 
    47     {WSAEMFILE,          "Too many open sockets"}, 
    48     {WSAEWOULDBLOCK,     "Operation would block"}, 
    49     {WSAEINPROGRESS,     "Operation now in progress"}, 
    50     {WSAEALREADY,        "Operation already in progress"}, 
    51     {WSAENOTSOCK,        "Socket operation on non-socket"}, 
    52     {WSAEDESTADDRREQ,    "Destination address required"}, 
    53     {WSAEMSGSIZE,        "Message too long"}, 
    54     {WSAEPROTOTYPE,      "Protocol wrong type for socket"}, 
    55     {WSAENOPROTOOPT,     "Bad protocol option"}, 
    56     {WSAEPROTONOSUPPORT, "Protocol not supported"}, 
    57     {WSAESOCKTNOSUPPORT, "Socket type not supported"}, 
    58     {WSAEOPNOTSUPP,      "Operation not supported on socket"}, 
    59     {WSAEPFNOSUPPORT,    "Protocol family not supported"}, 
    60     {WSAEAFNOSUPPORT,    "Address family not supported"}, 
    61     {WSAEADDRINUSE,      "Address already in use"}, 
    62     {WSAEADDRNOTAVAIL,   "Can't assign requested address"}, 
    63     {WSAENETDOWN,        "Network is down"}, 
    64     {WSAENETUNREACH,     "Network is unreachable"}, 
    65     {WSAENETRESET,       "Net connection reset"}, 
    66     {WSAECONNABORTED,    "Software caused connection abort"}, 
    67     {WSAECONNRESET,      "Connection reset by peer"}, 
    68     {WSAENOBUFS,         "No buffer space available"}, 
    69     {WSAEISCONN,         "Socket is already connected"}, 
    70     {WSAENOTCONN,        "Socket is not connected"}, 
    71     {WSAESHUTDOWN,       "Can't send after socket shutdown"}, 
    72     {WSAETOOMANYREFS,    "Too many references, can't splice"}, 
    73     {WSAETIMEDOUT,       "Connection timed out"}, 
    74     {WSAECONNREFUSED,    "Connection refused"}, 
    75     {WSAELOOP,           "Too many levels of symbolic links"}, 
    76     {WSAENAMETOOLONG,    "File name too long"}, 
    77     {WSAEHOSTDOWN,       "Host is down"}, 
    78     {WSAEHOSTUNREACH,    "No route to host"}, 
    79     {WSAENOTEMPTY,       "Directory not empty"}, 
    80     {WSAEPROCLIM,        "Too many processes"}, 
    81     {WSAEUSERS,          "Too many users"}, 
    82     {WSAEDQUOT,          "Disc quota exceeded"}, 
    83     {WSAESTALE,          "Stale NFS file handle"}, 
    84     {WSAEREMOTE,         "Too many levels of remote in path"}, 
    85     {WSASYSNOTREADY,     "Network system is unavailable"}, 
    86     {WSAVERNOTSUPPORTED, "Winsock version out of range"}, 
    87     {WSANOTINITIALISED,  "WSAStartup not yet called"}, 
    88     {WSAEDISCON,         "Graceful shutdown in progress"}, 
    89     {WSAHOST_NOT_FOUND,  "Host not found"}, 
    90     {WSANO_DATA,         "No host data of that type was found"}, 
    91     {0,                  NULL} 
     42    PJ_BUILD_ERR( WSAEINTR,           "Interrupted system call"), 
     43    PJ_BUILD_ERR( WSAEBADF,           "Bad file number"), 
     44    PJ_BUILD_ERR( WSAEACCES,          "Permission denied"), 
     45    PJ_BUILD_ERR( WSAEFAULT,          "Bad address"), 
     46    PJ_BUILD_ERR( WSAEINVAL,          "Invalid argument"), 
     47    PJ_BUILD_ERR( WSAEMFILE,          "Too many open sockets"), 
     48    PJ_BUILD_ERR( WSAEWOULDBLOCK,     "Operation would block"), 
     49    PJ_BUILD_ERR( WSAEINPROGRESS,     "Operation now in progress"), 
     50    PJ_BUILD_ERR( WSAEALREADY,        "Operation already in progress"), 
     51    PJ_BUILD_ERR( WSAENOTSOCK,        "Socket operation on non-socket"), 
     52    PJ_BUILD_ERR( WSAEDESTADDRREQ,    "Destination address required"), 
     53    PJ_BUILD_ERR( WSAEMSGSIZE,        "Message too long"), 
     54    PJ_BUILD_ERR( WSAEPROTOTYPE,      "Protocol wrong type for socket"), 
     55    PJ_BUILD_ERR( WSAENOPROTOOPT,     "Bad protocol option"), 
     56    PJ_BUILD_ERR( WSAEPROTONOSUPPORT, "Protocol not supported"), 
     57    PJ_BUILD_ERR( WSAESOCKTNOSUPPORT, "Socket type not supported"), 
     58    PJ_BUILD_ERR( WSAEOPNOTSUPP,      "Operation not supported on socket"), 
     59    PJ_BUILD_ERR( WSAEPFNOSUPPORT,    "Protocol family not supported"), 
     60    PJ_BUILD_ERR( WSAEAFNOSUPPORT,    "Address family not supported"), 
     61    PJ_BUILD_ERR( WSAEADDRINUSE,      "Address already in use"), 
     62    PJ_BUILD_ERR( WSAEADDRNOTAVAIL,   "Can't assign requested address"), 
     63    PJ_BUILD_ERR( WSAENETDOWN,        "Network is down"), 
     64    PJ_BUILD_ERR( WSAENETUNREACH,     "Network is unreachable"), 
     65    PJ_BUILD_ERR( WSAENETRESET,       "Net connection reset"), 
     66    PJ_BUILD_ERR( WSAECONNABORTED,    "Software caused connection abort"), 
     67    PJ_BUILD_ERR( WSAECONNRESET,      "Connection reset by peer"), 
     68    PJ_BUILD_ERR( WSAENOBUFS,         "No buffer space available"), 
     69    PJ_BUILD_ERR( WSAEISCONN,         "Socket is already connected"), 
     70    PJ_BUILD_ERR( WSAENOTCONN,        "Socket is not connected"), 
     71    PJ_BUILD_ERR( WSAESHUTDOWN,       "Can't send after socket shutdown"), 
     72    PJ_BUILD_ERR( WSAETOOMANYREFS,    "Too many references, can't splice"), 
     73    PJ_BUILD_ERR( WSAETIMEDOUT,       "Connection timed out"), 
     74    PJ_BUILD_ERR( WSAECONNREFUSED,    "Connection refused"), 
     75    PJ_BUILD_ERR( WSAELOOP,           "Too many levels of symbolic links"), 
     76    PJ_BUILD_ERR( WSAENAMETOOLONG,    "File name too long"), 
     77    PJ_BUILD_ERR( WSAEHOSTDOWN,       "Host is down"), 
     78    PJ_BUILD_ERR( WSAEHOSTUNREACH,    "No route to host"), 
     79    PJ_BUILD_ERR( WSAENOTEMPTY,       "Directory not empty"), 
     80    PJ_BUILD_ERR( WSAEPROCLIM,        "Too many processes"), 
     81    PJ_BUILD_ERR( WSAEUSERS,          "Too many users"), 
     82    PJ_BUILD_ERR( WSAEDQUOT,          "Disc quota exceeded"), 
     83    PJ_BUILD_ERR( WSAESTALE,          "Stale NFS file handle"), 
     84    PJ_BUILD_ERR( WSAEREMOTE,         "Too many levels of remote in path"), 
     85    PJ_BUILD_ERR( WSASYSNOTREADY,     "Network system is unavailable"), 
     86    PJ_BUILD_ERR( WSAVERNOTSUPPORTED, "Winsock version out of range"), 
     87    PJ_BUILD_ERR( WSANOTINITIALISED,  "WSAStartup not yet called"), 
     88    PJ_BUILD_ERR( WSAEDISCON,         "Graceful shutdown in progress"), 
     90#define WSAENOMORE              (WSABASEERR+102) 
     91#define WSAECANCELLED           (WSABASEERR+103) 
     95#define WSASYSCALLFAILURE       (WSABASEERR+107) 
     96#define WSASERVICE_NOT_FOUND    (WSABASEERR+108) 
     97#define WSATYPE_NOT_FOUND       (WSABASEERR+109) 
     98#define WSA_E_NO_MORE           (WSABASEERR+110) 
     99#define WSA_E_CANCELLED         (WSABASEERR+111) 
     100#define WSAEREFUSED             (WSABASEERR+112) 
     101 */ 
     102    PJ_BUILD_ERR( WSAHOST_NOT_FOUND,  "Host not found"), 
     104#define WSATRY_AGAIN            (WSABASEERR+1002) 
     105#define WSANO_RECOVERY          (WSABASEERR+1003) 
     106 */ 
     107    PJ_BUILD_ERR( WSANO_DATA,         "No host data of that type was found"), 
     108    {0, NULL} 
    187204    if (!len) { 
    188         len = pj_ansi_snprintf( buf, bufsize, "Unknown native error %u",  
     205        len = pj_ansi_snprintf( buf, bufsize, "Win32 error code %u",  
    189206                                (unsigned)os_errcode); 
    190207        buf[len] = '\0'; 
Note: See TracChangeset for help on using the changeset viewer.