29 INT ExpectedWSAResult;
33 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET,
PORT, {{{ 0x7f, 0x00, 0x00, 0x01 }}} }, 0, 0, {
AF_INET,
PORT, {{{ 0x7f, 0x00, 0x00, 0x01 }}} } },
34 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET,
PORT, {{{ 0x00, 0x00, 0x00, 0x00 }}} }, 0, 0, {
AF_INET,
PORT, {{{ 0x00, 0x00, 0x00, 0x00 }}} } },
35 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET,
PORT, {{{
b1,
b2,
b3,
b4 }}} }, 0, 0, {
AF_INET,
PORT, {{{
b1,
b2,
b3,
b4 }}} } },
36 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET,
PORT, {{{ 0xff, 0xff, 0xff, 0xff }}} },
SOCKET_ERROR,
WSAEADDRNOTAVAIL },
37 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET, 0, {{{ 0x7f, 0x00, 0x00, 0x01 }}} }, 0, 0, {
AF_INET, 0, {{{ 0x7f, 0x00, 0x00, 0x01 }}} } },
39 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET, 0, {{{
b1,
b2,
b3,
b4 }}} }, 0, 0, {
AF_INET, 0, {{{
b1,
b2,
b3,
b4 }}} } },
40 {
SOCK_STREAM,
IPPROTO_TCP, {
AF_INET, 0, {{{ 0xff, 0xff, 0xff, 0xff }}} },
SOCKET_ERROR,
WSAEADDRNOTAVAIL },
41 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET,
PORT, {{{ 0x7f, 0x00, 0x00, 0x01 }}} }, 0, 0, {
AF_INET,
PORT, {{{ 0x7f, 0x00, 0x00, 0x01 }}} } },
42 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET,
PORT, {{{ 0x00, 0x00, 0x00, 0x00 }}} }, 0, 0, {
AF_INET,
PORT, {{{ 0x00, 0x00, 0x00, 0x00 }}} } },
43 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET,
PORT, {{{
b1,
b2,
b3,
b4 }}} }, 0, 0, {
AF_INET,
PORT, {{{
b1,
b2,
b3,
b4 }}} } },
44 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET,
PORT, {{{ 0xff, 0xff, 0xff, 0xff }}} },
SOCKET_ERROR,
WSAEADDRNOTAVAIL },
45 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET, 0, {{{ 0x7f, 0x00, 0x00, 0x01 }}} }, 0, 0, {
AF_INET, 0, {{{ 0x7f, 0x00, 0x00, 0x01 }}} } },
47 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET, 0, {{{
b1,
b2,
b3,
b4 }}} }, 0, 0,{
AF_INET, 0, {{{
b1,
b2,
b3,
b4 }}} } },
48 {
SOCK_DGRAM,
IPPROTO_UDP, {
AF_INET, 0, {{{ 0xff, 0xff, 0xff, 0xff }}} },
SOCKET_ERROR,
WSAEADDRNOTAVAIL },
56 for (
i = 0;
i < TestCount;
i++)
66 ok(
Error ==
Tests[
i].ExpectedResult,
"Error %d differs from expected %d for test %d\n",
Error,
Tests[
i].ExpectedResult,
i);
73 AddrSize =
sizeof(Addr);
76 ok(AddrSize ==
sizeof(Addr),
"Returned size %d differs from expected %d for test %d\n", AddrSize,
sizeof(Addr),
i);
77 ok(Addr.sin_addr.s_addr ==
Tests[
i].ExpectedAddr.sin_addr.s_addr,
"Expected address %lx differs from returned address %lx for test %d\n",
Tests[
i].ExpectedAddr.sin_addr.s_addr, Addr.sin_addr.s_addr,
i);
78 if (
Tests[
i].ExpectedAddr.sin_port)
80 ok(Addr.sin_port ==
Tests[
i].ExpectedAddr.sin_port,
"Returned port %d differs from expected %d for test %d\n", Addr.sin_port,
Tests[
i].ExpectedAddr.sin_port,
i);
84 ok(Addr.sin_port != 0,
"Port remained zero for test %d\n",
i);
94 ok(
Error ==
Tests[0].ExpectedResult,
"Error %d differs from expected %d for double bind test\n",
Error,
Tests[0].ExpectedResult);
101 AddrSize =
sizeof(Addr);
104 ok(AddrSize ==
sizeof(Addr),
"Returned size %d differs from expected %d for double bind test\n", AddrSize,
sizeof(Addr));
105 ok(Addr.sin_addr.s_addr ==
Tests[0].ExpectedAddr.sin_addr.s_addr,
"Expected address %lx differs from returned address %lx for double bind test\n",
Tests[0].ExpectedAddr.sin_addr.s_addr, Addr.sin_addr.s_addr);
106 if (
Tests[0].ExpectedAddr.sin_port)
108 ok(Addr.sin_port ==
Tests[0].ExpectedAddr.sin_port,
"Returned port %d differs from expected %d for double bind test\n", Addr.sin_port,
Tests[0].ExpectedAddr.sin_port);
112 ok(Addr.sin_port != 0,
"Port remained zero for double bind test\n");
134 CHAR LocalHostName[128];
157 trace(
"Local host name is '%s'\n", LocalHostName);
167 "Could not determine local address. Following test results may be wrong.\n");
#define EndSeh(ExpectedStatus)
char * strcpy(char *DstString, const char *SrcString)
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
#define ok_dec(expression, result)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
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)
static VOID TestBind(IN_ADDR Address)
static CRYPT_DATA_BLOB b4
static CRYPT_DATA_BLOB b3[]
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR LocalAddress