| 1 | #ifndef WIN32_LEAN_AND_MEAN |
| 2 | #define WIN32_LEAN_AND_MEAN |
| 3 | #endif |
| 4 | #undef __CRT__NO_INLINE |
| 5 | #define __CRT__NO_INLINE |
| 6 | #include <winsock2.h> |
| 7 | #include <wspiapi.h> |
| 8 | |
| 9 | int WINAPI |
| 10 | WspiapiGetNameInfo (const struct sockaddr *sa, socklen_t salen, |
| 11 | 		 char *host, size_t hostlen, |
| 12 | 		 char *serv, size_t servlen, int flags) |
| 13 | { |
| 14 | static WSPIAPI_PGETNAMEINFO pfGetNameInfo = NULL; |
| 15 | int err; |
| 16 | |
| 17 | if (!pfGetNameInfo) |
| 18 | pfGetNameInfo = (void*) WspiapiLoad(1); |
| 19 | err = (*pfGetNameInfo) (sa, salen, host, hostlen, serv, servlen, flags); |
| 20 | WSASetLastError (err); |
| 21 | return err; |
| 22 | } |