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
4e6ebd63
Commit
4e6ebd63
authored
Oct 03, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Return the needed buffer size for SIO_ADDRESS_LIST_QUERY.
parent
2bcbbea5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
socket.c
dlls/ws2_32/socket.c
+1
-0
sock.c
dlls/ws2_32/tests/sock.c
+41
-0
No files found.
dlls/ws2_32/socket.c
View file @
4e6ebd63
...
...
@@ -3957,6 +3957,7 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
if
(
total
>
out_size
)
{
*
ret_size
=
total
;
HeapFree
(
GetProcessHeap
(),
0
,
table
);
status
=
WSAEFAULT
;
break
;
...
...
dlls/ws2_32/tests/sock.c
View file @
4e6ebd63
...
...
@@ -7462,6 +7462,46 @@ static void test_completion_port(void)
CloseHandle
(
previous_port
);
}
static
void
test_address_list_query
(
void
)
{
SOCKET_ADDRESS_LIST
*
address_list
;
DWORD
bytes_returned
,
size
;
unsigned
int
i
;
SOCKET
s
;
int
ret
;
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ok
(
s
!=
INVALID_SOCKET
,
"Failed to create socket, error %d.
\n
"
,
WSAGetLastError
());
bytes_returned
=
0
;
ret
=
WSAIoctl
(
s
,
SIO_ADDRESS_LIST_QUERY
,
NULL
,
0
,
NULL
,
0
,
&
bytes_returned
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
WSAGetLastError
());
ok
(
bytes_returned
>=
FIELD_OFFSET
(
SOCKET_ADDRESS_LIST
,
Address
[
0
]),
"Got unexpected bytes_returned %u.
\n
"
,
bytes_returned
);
size
=
bytes_returned
;
bytes_returned
=
0
;
address_list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
2
);
ret
=
WSAIoctl
(
s
,
SIO_ADDRESS_LIST_QUERY
,
NULL
,
0
,
address_list
,
size
*
2
,
&
bytes_returned
,
NULL
,
NULL
);
ok
(
!
ret
,
"Got unexpected ret %d, error %d.
\n
"
,
ret
,
WSAGetLastError
());
ok
(
bytes_returned
==
size
,
"Got unexpected bytes_returned %u, expected %u.
\n
"
,
bytes_returned
,
size
);
bytes_returned
=
FIELD_OFFSET
(
SOCKET_ADDRESS_LIST
,
Address
[
address_list
->
iAddressCount
]);
for
(
i
=
0
;
i
<
address_list
->
iAddressCount
;
++
i
)
{
bytes_returned
+=
address_list
->
Address
[
i
].
iSockaddrLength
;
}
ok
(
size
==
bytes_returned
,
"Got unexpected size %u, expected %u.
\n
"
,
size
,
bytes_returned
);
ret
=
WSAIoctl
(
s
,
SIO_ADDRESS_LIST_QUERY
,
NULL
,
0
,
address_list
,
size
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
WSAGetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
address_list
);
closesocket
(
s
);
}
static
DWORD
WINAPI
inet_ntoa_thread_proc
(
void
*
param
)
{
ULONG
addr
;
...
...
@@ -7739,6 +7779,7 @@ START_TEST( sock )
test_WSAAsyncGetServByName
();
test_completion_port
();
test_address_list_query
();
/* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send
();
...
...
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