10 #endif /* HAVE_WINSOCK(2) */
12 #define __RETSTR( x ) case x: return #x;
14 char *ber_pvt_wsa_err2string( int err )
24 __RETSTR( WSAEWOULDBLOCK )
25 __RETSTR( WSAEINPROGRESS )
26 __RETSTR( WSAEALREADY )
27 __RETSTR( WSAENOTSOCK )
28 __RETSTR( WSAEDESTADDRREQ )
29 __RETSTR( WSAEMSGSIZE )
30 __RETSTR( WSAEPROTOTYPE )
31 __RETSTR( WSAENOPROTOOPT )
32 __RETSTR( WSAEPROTONOSUPPORT )
33 __RETSTR( WSAESOCKTNOSUPPORT )
34 __RETSTR( WSAEOPNOTSUPP )
35 __RETSTR( WSAEPFNOSUPPORT )
36 __RETSTR( WSAEAFNOSUPPORT )
37 __RETSTR( WSAEADDRINUSE )
38 __RETSTR( WSAEADDRNOTAVAIL )
39 __RETSTR( WSAENETDOWN )
40 __RETSTR( WSAENETUNREACH )
41 __RETSTR( WSAENETRESET )
42 __RETSTR( WSAECONNABORTED )
43 __RETSTR( WSAECONNRESET )
44 __RETSTR( WSAENOBUFS )
45 __RETSTR( WSAEISCONN )
46 __RETSTR( WSAENOTCONN )
47 __RETSTR( WSAESHUTDOWN )
48 __RETSTR( WSAETOOMANYREFS )
49 __RETSTR( WSAETIMEDOUT )
50 __RETSTR( WSAECONNREFUSED )
52 __RETSTR( WSAENAMETOOLONG )
53 __RETSTR( WSAEHOSTDOWN )
54 __RETSTR( WSAEHOSTUNREACH )
55 __RETSTR( WSAENOTEMPTY )
56 __RETSTR( WSAEPROCLIM )
60 __RETSTR( WSAEREMOTE )
61 __RETSTR( WSASYSNOTREADY )
62 __RETSTR( WSAVERNOTSUPPORTED )
63 __RETSTR( WSANOTINITIALISED )
64 __RETSTR( WSAEDISCON )
67 __RETSTR( WSAENOMORE )
68 __RETSTR( WSAECANCELLED )
69 __RETSTR( WSAEINVALIDPROCTABLE )
70 __RETSTR( WSAEINVALIDPROVIDER )
71 __RETSTR( WSASYSCALLFAILURE )
72 __RETSTR( WSASERVICE_NOT_FOUND )
73 __RETSTR( WSATYPE_NOT_FOUND )
74 __RETSTR( WSA_E_NO_MORE )
75 __RETSTR( WSA_E_CANCELLED )
76 __RETSTR( WSAEREFUSED )
77 #endif // HAVE_WINSOCK2
79 __RETSTR( WSAHOST_NOT_FOUND )
80 __RETSTR( WSATRY_AGAIN )
81 __RETSTR( WSANO_RECOVERY )
82 __RETSTR( WSANO_DATA )
89 #if 0 /* No one seems to be using these */
90 char *ber_pvt_wsa_last_errstring( void )
92 return ber_pvt_wsa_err2string( WSAGetLastError() );
95 char *GetErrorString( int err )
97 static char msgBuf[1024];
100 FORMAT_MESSAGE_FROM_SYSTEM,
102 err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
103 msgBuf, 1024, NULL );
108 char *GetLastErrorString( void )
110 return GetErrorString( GetLastError() );