16{
21
23 struct
24 {
29 INT ExpectedWSAResult;
32 {
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 },
49 };
55
56 for (
i = 0;
i < TestCount;
i++)
57 {
61 {
63 continue;
64 }
66 ok(
Error ==
Tests[
i].ExpectedResult,
"Error %d differs from expected %d for test %d\n",
Error,
Tests[
i].ExpectedResult,
i);
68 {
70 }
71 else
72 {
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)
79 {
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);
81 }
82 else
83 {
84 ok(Addr.sin_port != 0,
"Port remained zero for test %d\n",
i);
85 }
86 }
89 }
90
94 ok(
Error ==
Tests[0].ExpectedResult,
"Error %d differs from expected %d for double bind test\n",
Error,
Tests[0].ExpectedResult);
96 {
98 }
99 else
100 {
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)
107 {
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);
109 }
110 else
111 {
112 ok(Addr.sin_port != 0,
"Port remained zero for double bind test\n");
113 }
116 }
119
128}
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
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)