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
4fe90554
Commit
4fe90554
authored
May 24, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
May 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add some tests for opening the Afd device.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d2259665
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
afd.c
dlls/ws2_32/tests/afd.c
+38
-0
No files found.
dlls/ws2_32/tests/afd.c
View file @
4fe90554
...
...
@@ -39,6 +39,43 @@ static void set_blocking(SOCKET s, ULONG blocking)
ok
(
!
ret
,
"got error %u
\n
"
,
WSAGetLastError
());
}
static
void
test_open_device
(
void
)
{
OBJECT_BASIC_INFORMATION
info
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
string
;
IO_STATUS_BLOCK
io
;
HANDLE
handle
;
SOCKET
s
;
int
ret
;
RtlInitUnicodeString
(
&
string
,
L"
\\
Device
\\
Afd"
);
InitializeObjectAttributes
(
&
attr
,
&
string
,
0
,
NULL
,
NULL
);
ret
=
NtOpenFile
(
&
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
CloseHandle
(
handle
);
RtlInitUnicodeString
(
&
string
,
L"
\\
Device
\\
Afd
\\
"
);
InitializeObjectAttributes
(
&
attr
,
&
string
,
0
,
NULL
,
NULL
);
ret
=
NtOpenFile
(
&
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
0
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
CloseHandle
(
handle
);
RtlInitUnicodeString
(
&
string
,
L"
\\
Device
\\
Afd
\\
foobar"
);
InitializeObjectAttributes
(
&
attr
,
&
string
,
0
,
NULL
,
NULL
);
ret
=
NtOpenFile
(
&
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
0
);
todo_wine
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
CloseHandle
(
handle
);
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ret
=
NtQueryObject
((
HANDLE
)
s
,
ObjectBasicInformation
,
&
info
,
sizeof
(
info
),
NULL
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
todo_wine
ok
(
info
.
Attributes
==
OBJ_INHERIT
,
"got attributes %#x
\n
"
,
info
.
Attributes
);
todo_wine
ok
(
info
.
GrantedAccess
==
(
FILE_GENERIC_READ
|
FILE_GENERIC_WRITE
|
WRITE_DAC
),
"got access %#x
\n
"
,
info
.
GrantedAccess
);
closesocket
(
s
);
}
static
void
test_recv
(
void
)
{
const
struct
sockaddr_in
bind_addr
=
{.
sin_family
=
AF_INET
,
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
)};
...
...
@@ -397,6 +434,7 @@ START_TEST(afd)
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
data
);
test_open_device
();
test_recv
();
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