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
de48f96d
Commit
de48f96d
authored
May 31, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
May 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32/tests: Add more tests for SIO_GET_EXTENSION_FUNCTION_ADDRESS.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e969cf09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
0 deletions
+93
-0
sock.c
dlls/ws2_32/tests/sock.c
+93
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
de48f96d
...
...
@@ -4187,6 +4187,98 @@ static void test_unsupported_ioctls(void)
}
}
static
void
test_get_extension_func
(
void
)
{
OVERLAPPED
overlapped
=
{
0
},
*
overlapped_ptr
;
GUID
acceptex_guid
=
WSAID_ACCEPTEX
;
GUID
bogus_guid
=
{
0xdeadbeef
};
ULONG_PTR
key
;
HANDLE
port
;
DWORD
size
;
void
*
func
;
SOCKET
s
;
int
ret
;
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
port
=
CreateIoCompletionPort
((
HANDLE
)
s
,
NULL
,
123
,
0
);
WSASetLastError
(
0xdeadbeef
);
ret
=
WSAIoctl
(
s
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
acceptex_guid
,
sizeof
(
GUID
),
&
func
,
sizeof
(
func
),
NULL
,
&
overlapped
,
NULL
);
todo_wine
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEFAULT
,
"got error %u
\n
"
,
WSAGetLastError
());
WSASetLastError
(
0xdeadbeef
);
size
=
0xdeadbeef
;
ret
=
WSAIoctl
(
s
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
acceptex_guid
,
sizeof
(
GUID
),
&
func
,
sizeof
(
func
),
&
size
,
NULL
,
NULL
);
ok
(
!
ret
,
"expected success
\n
"
);
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
size
==
sizeof
(
func
),
"got size %u
\n
"
,
size
);
WSASetLastError
(
0xdeadbeef
);
size
=
0xdeadbeef
;
overlapped
.
Internal
=
0xdeadbeef
;
overlapped
.
InternalHigh
=
0xdeadbeef
;
ret
=
WSAIoctl
(
s
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
acceptex_guid
,
sizeof
(
GUID
),
&
func
,
sizeof
(
func
),
&
size
,
&
overlapped
,
NULL
);
ok
(
!
ret
,
"expected success
\n
"
);
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
size
==
sizeof
(
func
),
"got size %u
\n
"
,
size
);
ret
=
GetQueuedCompletionStatus
(
port
,
&
size
,
&
key
,
&
overlapped_ptr
,
0
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
todo_wine
ok
(
!
size
,
"got size %u
\n
"
,
size
);
ok
(
key
==
123
,
"got key %Iu
\n
"
,
key
);
ok
(
overlapped_ptr
==
&
overlapped
,
"got overlapped %p
\n
"
,
overlapped_ptr
);
ok
(
!
overlapped
.
Internal
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
todo_wine
ok
(
!
overlapped
.
InternalHigh
,
"got size %Iu
\n
"
,
overlapped
.
InternalHigh
);
size
=
0xdeadbeef
;
overlapped
.
Internal
=
0xdeadbeef
;
overlapped
.
InternalHigh
=
0xdeadbeef
;
ret
=
WSAIoctl
(
s
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
bogus_guid
,
sizeof
(
GUID
),
&
func
,
sizeof
(
func
),
&
size
,
&
overlapped
,
NULL
);
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
size
==
0xdeadbeef
,
"got size %u
\n
"
,
size
);
todo_wine
ok
(
overlapped
.
Internal
==
0xdeadbeef
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
todo_wine
ok
(
overlapped
.
InternalHigh
==
0xdeadbeef
,
"got size %Iu
\n
"
,
overlapped
.
InternalHigh
);
ret
=
GetQueuedCompletionStatus
(
port
,
&
size
,
&
key
,
&
overlapped_ptr
,
0
);
todo_wine
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
WAIT_TIMEOUT
,
"got error %u
\n
"
,
WSAGetLastError
());
CloseHandle
(
port
);
closesocket
(
s
);
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ret
=
WSAIoctl
(
s
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
acceptex_guid
,
sizeof
(
GUID
),
&
func
,
sizeof
(
func
),
NULL
,
&
overlapped
,
socket_apc
);
todo_wine
ok
(
ret
==
-
1
,
"expected failure
\n
"
);
todo_wine
ok
(
WSAGetLastError
()
==
WSAEFAULT
,
"got error %u
\n
"
,
WSAGetLastError
());
apc_count
=
0
;
size
=
0xdeadbeef
;
ret
=
WSAIoctl
(
s
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
acceptex_guid
,
sizeof
(
GUID
),
&
func
,
sizeof
(
func
),
&
size
,
&
overlapped
,
socket_apc
);
ok
(
!
ret
,
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
size
==
sizeof
(
func
),
"got size %u
\n
"
,
size
);
ret
=
SleepEx
(
0
,
TRUE
);
todo_wine
ok
(
ret
==
WAIT_IO_COMPLETION
,
"got %d
\n
"
,
ret
);
if
(
ret
==
WAIT_IO_COMPLETION
)
{
ok
(
apc_count
==
1
,
"APC was called %u times
\n
"
,
apc_count
);
ok
(
!
apc_error
,
"got APC error %u
\n
"
,
apc_error
);
ok
(
!
apc_size
,
"got APC size %u
\n
"
,
apc_size
);
ok
(
apc_overlapped
==
&
overlapped
,
"got APC overlapped %p
\n
"
,
apc_overlapped
);
}
closesocket
(
s
);
}
static
BOOL
drain_pause
=
FALSE
;
static
DWORD
WINAPI
drain_socket_thread
(
LPVOID
arg
)
{
...
...
@@ -10406,6 +10498,7 @@ START_TEST( sock )
test_address_list_query
();
test_fionbio
();
test_fionread_siocatmark
();
test_get_extension_func
();
test_keepalive_vals
();
test_sioRoutingInterfaceQuery
();
test_sioAddressListChange
();
...
...
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