10#define ok_addrinfo(ai, flags, family, socktype, protocol, addrlen) do \
12 ok_hex((ai)->ai_flags, flags); \
13 ok_dec((ai)->ai_family, family); \
14 ok_dec((ai)->ai_socktype, socktype); \
15 ok_dec((ai)->ai_protocol, protocol); \
16 ok_dec((int)(ai)->ai_addrlen, addrlen); \
19#define ok_sockaddr_in(sockaddr, family, port, addr) do \
22 ok_dec(((SOCKADDR_IN *)(sockaddr))->sin_family, family); \
23 ok_dec(ntohs(((SOCKADDR_IN *)(sockaddr))->sin_port), port); \
24 ok_hex(((SOCKADDR_IN *)(sockaddr))->sin_addr.S_un.S_addr, \
26 for (_i = 0; _i < 7; _i++) \
27 ok_dec(((SOCKADDR_IN *)(sockaddr))->sin_zero[_i], 0); \
42 PCSTR ExpectedAddress;
48 {
"doesntexist.example.com",
NULL },
49 {
"localhost",
"127.0.0.1" },
50 {
"localhost:80",
NULL },
54 {
"0.0.0.0 ",
"0.0.0.0", },
55 {
"0.0.0.0:80",
NULL },
56 {
"0.0.0.0.0",
NULL },
57 {
"1.1.1.256",
NULL },
62 {
"google-public-dns-a.google.com",
"8.8.8.8" },
72 for (
i = 0;
i < TestCount;
i++)
78 if (
Tests[
i].ExpectedAddress)
97 0,
Tests[
i].ExpectedAddress);
141 {
"4294967295", 65535 },
142 {
"4294967296", 65535 },
143 {
"9999999999", 65535 },
144 {
"999999999999999999999999999999999999", 65535 },
164 for (
i = 0;
i < TestCount;
i++)
170 if (
Tests[
i].ExpectedPort != -1)
189 Tests[
i].ExpectedPort,
"127.0.0.1");
205 CHAR LocalHostName[128];
233 trace(
"Local host name is '%s'\n", LocalHostName);
244 "Could not determine local address. Following test results may be wrong.\n");
#define EndSeh(ExpectedStatus)
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
INT WSAAPI GetAddrInfoW(IN PCWSTR pszNodeName, IN PCWSTR pszServiceName, IN const ADDRINFOW *ptHints, OUT PADDRINFOW *pptResult)
#define ok_dec(expression, result)
#define ok_ptr(expression, result)
static WCHAR ServiceName[]
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
static WCHAR TestServiceName[MAX_PATH]
static VOID TestNodeName(VOID)
#define ok_sockaddr_in(sockaddr, family, port, addr)
#define ok_addrinfo(ai, flags, family, socktype, protocol, addrlen)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
INT WSAAPI gethostname(OUT char FAR *name, IN INT namelen)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define STATUS_ACCESS_VIOLATION
#define WSANOTINITIALISED
#define WSAHOST_NOT_FOUND
#define WSATYPE_NOT_FOUND
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR LocalAddress
_In_ PADDRINFOEXW AddrInfo
_Must_inspect_result_ _In_ ULONG Flags