Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
96d3e5a5
Commit
96d3e5a5
authored
Jun 03, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add more tests for sockets that cannot be accepted into.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b94fe594
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
sock.c
dlls/ws2_32/tests/sock.c
+56
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
96d3e5a5
...
...
@@ -6402,6 +6402,7 @@ static void test_ConnectEx(void)
static
void
test_AcceptEx
(
void
)
{
const
struct
sockaddr_in
bind_addr
=
{.
sin_family
=
AF_INET
,
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
)};
SOCKET
listener
,
acceptor
,
acceptor2
,
connector
,
connector2
;
struct
sockaddr_in
bindAddress
,
peerAddress
,
*
readBindAddress
,
*
readRemoteAddress
;
int
socklen
,
optlen
;
...
...
@@ -6525,6 +6526,61 @@ todo_wine
closesocket
(
connector
);
closesocket
(
acceptor
);
/* A UDP socket cannot be accepted into. */
acceptor
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
overlapped
.
Internal
=
0xdeadbeef
;
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
ok
(
!
bret
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
overlapped
.
Internal
==
STATUS_PENDING
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
if
(
WSAGetLastError
()
==
ERROR_IO_PENDING
)
CancelIo
((
HANDLE
)
listener
);
closesocket
(
acceptor
);
/* A bound socket cannot be accepted into. */
acceptor
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
iret
=
bind
(
acceptor
,
(
const
struct
sockaddr
*
)
&
bind_addr
,
sizeof
(
bind_addr
));
ok
(
!
iret
,
"got error %u
\n
"
,
WSAGetLastError
());
overlapped
.
Internal
=
0xdeadbeef
;
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
ok
(
!
bret
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
overlapped
.
Internal
==
STATUS_PENDING
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
if
(
WSAGetLastError
()
==
ERROR_IO_PENDING
)
CancelIo
((
HANDLE
)
listener
);
closesocket
(
acceptor
);
/* A connected socket cannot be accepted into. */
tcp_socketpair
(
&
acceptor
,
&
acceptor2
);
overlapped
.
Internal
=
0xdeadbeef
;
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
ok
(
!
bret
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
overlapped
.
Internal
==
STATUS_PENDING
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
if
(
WSAGetLastError
()
==
ERROR_IO_PENDING
)
CancelIo
((
HANDLE
)
listener
);
overlapped
.
Internal
=
0xdeadbeef
;
bret
=
pAcceptEx
(
listener
,
acceptor2
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
ok
(
!
bret
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
overlapped
.
Internal
==
STATUS_PENDING
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
if
(
WSAGetLastError
()
==
ERROR_IO_PENDING
)
CancelIo
((
HANDLE
)
listener
);
closesocket
(
acceptor
);
closesocket
(
acceptor2
);
/* Pass an insufficient local address size. */
acceptor
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ok
(
acceptor
!=
-
1
,
"failed to create socket, error %u
\n
"
,
WSAGetLastError
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment