Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ee683f71
Commit
ee683f71
authored
May 02, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
May 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Add a test to show that WSAIoctl is synchronous.
parent
aa4e6639
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
sock.c
dlls/ws2_32/tests/sock.c
+33
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
ee683f71
...
@@ -4630,6 +4630,38 @@ static void test_sioRoutingInterfaceQuery(void)
...
@@ -4630,6 +4630,38 @@ static void test_sioRoutingInterfaceQuery(void)
closesocket
(
sock
);
closesocket
(
sock
);
}
}
static
void
test_synchronous_WSAIoctl
(
void
)
{
HANDLE
previous_port
,
io_port
;
WSAOVERLAPPED
overlapped
,
*
olp
;
SOCKET
socket
;
ULONG
on
;
ULONG_PTR
key
;
DWORD
num_bytes
;
BOOL
ret
;
int
res
;
previous_port
=
CreateIoCompletionPort
(
INVALID_HANDLE_VALUE
,
NULL
,
0
,
0
);
ok
(
previous_port
!=
NULL
,
"failed to create completion port %u
\n
"
,
GetLastError
()
);
socket
=
WSASocketW
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
,
NULL
,
0
,
WSA_FLAG_OVERLAPPED
);
ok
(
socket
!=
INVALID_SOCKET
,
"failed to create socket %d
\n
"
,
WSAGetLastError
()
);
io_port
=
CreateIoCompletionPort
(
(
HANDLE
)
socket
,
previous_port
,
0
,
0
);
ok
(
io_port
!=
NULL
,
"failed to create completion port %u
\n
"
,
GetLastError
()
);
on
=
1
;
memset
(
&
overlapped
,
0
,
sizeof
(
overlapped
)
);
res
=
WSAIoctl
(
socket
,
FIONBIO
,
&
on
,
sizeof
(
on
),
NULL
,
0
,
&
num_bytes
,
&
overlapped
,
NULL
);
ok
(
!
res
,
"WSAIoctl failed %d
\n
"
,
WSAGetLastError
()
);
ret
=
GetQueuedCompletionStatus
(
io_port
,
&
num_bytes
,
&
key
,
&
olp
,
10000
);
ok
(
ret
,
"failed to get completion status %u
\n
"
,
GetLastError
()
);
CloseHandle
(
io_port
);
closesocket
(
socket
);
CloseHandle
(
previous_port
);
}
/**************** Main program ***************/
/**************** Main program ***************/
...
@@ -4693,6 +4725,7 @@ START_TEST( sock )
...
@@ -4693,6 +4725,7 @@ START_TEST( sock )
/* this is a io heavy test, do it at the end so the kernel doesn't start dropping packets */
/* this is a io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send
();
test_send
();
test_synchronous_WSAIoctl
();
Exit
();
Exit
();
}
}
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