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
fd9a521c
Commit
fd9a521c
authored
Jun 14, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add some tests for IOCTL_AFD_EVENT_SELECT.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6e4f03d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
0 deletions
+94
-0
afd.c
dlls/ws2_32/tests/afd.c
+94
-0
No files found.
dlls/ws2_32/tests/afd.c
View file @
fd9a521c
...
...
@@ -1136,6 +1136,99 @@ static void test_recv(void)
CloseHandle
(
event
);
}
static
void
test_event_select
(
void
)
{
struct
afd_event_select_params
params
;
WSANETWORKEVENTS
events
;
SOCKET
client
,
server
;
IO_STATUS_BLOCK
io
;
HANDLE
event
;
int
ret
;
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
tcp_socketpair
(
&
client
,
&
server
);
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
==
STATUS_INVALID_PARAMETER
,
"got %#x
\n
"
,
ret
);
ok
(
io
.
Status
==
STATUS_INVALID_PARAMETER
,
"got status %#x
\n
"
,
io
.
Status
);
ok
(
!
io
.
Information
,
"got information %#Ix
\n
"
,
io
.
Information
);
params
.
event
=
0
;
params
.
mask
=
~
0
;
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
ok
(
ret
==
STATUS_INVALID_PARAMETER
,
"got %#x
\n
"
,
ret
);
ok
(
io
.
Status
==
STATUS_INVALID_PARAMETER
,
"got status %#x
\n
"
,
io
.
Status
);
ok
(
!
io
.
Information
,
"got information %#Ix
\n
"
,
io
.
Information
);
params
.
event
=
event
;
params
.
mask
=
~
0
;
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ok
(
!
io
.
Status
,
"got status %#x
\n
"
,
io
.
Status
);
ok
(
!
io
.
Information
,
"got information %#Ix
\n
"
,
io
.
Information
);
ret
=
WSAEnumNetworkEvents
(
client
,
event
,
&
events
);
ok
(
!
ret
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
events
.
lNetworkEvents
==
(
FD_CONNECT
|
FD_WRITE
),
"got events %#x
\n
"
,
events
.
lNetworkEvents
);
closesocket
(
client
);
closesocket
(
server
);
tcp_socketpair
(
&
client
,
&
server
);
params
.
event
=
event
;
params
.
mask
=
AFD_POLL_CONNECT
;
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ok
(
!
io
.
Status
,
"got status %#x
\n
"
,
io
.
Status
);
ok
(
!
io
.
Information
,
"got information %#Ix
\n
"
,
io
.
Information
);
ret
=
WSAEnumNetworkEvents
(
client
,
event
,
&
events
);
ok
(
!
ret
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
events
.
lNetworkEvents
==
FD_CONNECT
,
"got events %#x
\n
"
,
events
.
lNetworkEvents
);
closesocket
(
client
);
closesocket
(
server
);
tcp_socketpair
(
&
client
,
&
server
);
params
.
event
=
event
;
params
.
mask
=
~
0
;
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ok
(
!
io
.
Status
,
"got status %#x
\n
"
,
io
.
Status
);
ok
(
!
io
.
Information
,
"got information %#Ix
\n
"
,
io
.
Information
);
params
.
event
=
0
;
params
.
mask
=
0
;
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
ret
=
NtDeviceIoControlFile
((
HANDLE
)
client
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_EVENT_SELECT
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ok
(
!
io
.
Status
,
"got status %#x
\n
"
,
io
.
Status
);
ok
(
!
io
.
Information
,
"got information %#Ix
\n
"
,
io
.
Information
);
ret
=
WSAEnumNetworkEvents
(
client
,
event
,
&
events
);
ok
(
!
ret
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
events
.
lNetworkEvents
,
"got events %#x
\n
"
,
events
.
lNetworkEvents
);
closesocket
(
client
);
closesocket
(
server
);
CloseHandle
(
event
);
}
START_TEST
(
afd
)
{
WSADATA
data
;
...
...
@@ -1146,6 +1239,7 @@ START_TEST(afd)
test_poll
();
test_poll_completion_port
();
test_recv
();
test_event_select
();
WSACleanup
();
}
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