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
dddd4662
Commit
dddd4662
authored
Jun 09, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Use IOCTL_WINE_AFD_COMPLETE_ASYNC in SIO_ROUTING_INTERFACE_QUERY.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
306b2441
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
23 deletions
+25
-23
socket.c
dlls/ws2_32/socket.c
+16
-11
sock.c
dlls/ws2_32/tests/sock.c
+9
-12
No files found.
dlls/ws2_32/socket.c
View file @
dddd4662
...
...
@@ -3435,7 +3435,8 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
struct
WS_sockaddr_in
*
saddr_in
=
out_buff
;
MIB_IPFORWARDROW
row
;
PMIB_IPADDRTABLE
ipAddrTable
=
NULL
;
DWORD
size
,
i
,
found_index
;
DWORD
size
,
i
,
found_index
,
ret
=
0
;
NTSTATUS
status
=
STATUS_SUCCESS
;
TRACE
(
"-> WS_SIO_ROUTING_INTERFACE_QUERY request
\n
"
);
...
...
@@ -3448,21 +3449,21 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
if
(
daddr
->
sa_family
!=
WS_AF_INET
)
{
FIXME
(
"unsupported address family %d
\n
"
,
daddr
->
sa_family
);
status
=
WSAEAFNOSUPPORT
;
break
;
SetLastError
(
WSAEAFNOSUPPORT
)
;
return
-
1
;
}
if
(
GetBestRoute
(
daddr_in
->
sin_addr
.
S_un
.
S_addr
,
0
,
&
row
)
!=
NOERROR
||
GetIpAddrTable
(
NULL
,
&
size
,
FALSE
)
!=
ERROR_INSUFFICIENT_BUFFER
)
{
status
=
WSAEFAULT
;
break
;
SetLastError
(
WSAEFAULT
)
;
return
-
1
;
}
ipAddrTable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
GetIpAddrTable
(
ipAddrTable
,
&
size
,
FALSE
))
{
HeapFree
(
GetProcessHeap
(),
0
,
ipAddrTable
);
status
=
WSAEFAULT
;
break
;
SetLastError
(
WSAEFAULT
)
;
return
-
1
;
}
for
(
i
=
0
,
found_index
=
ipAddrTable
->
dwNumEntries
;
i
<
ipAddrTable
->
dwNumEntries
;
i
++
)
...
...
@@ -3475,15 +3476,19 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
ERR
(
"no matching IP address for interface %d
\n
"
,
row
.
dwForwardIfIndex
);
HeapFree
(
GetProcessHeap
(),
0
,
ipAddrTable
);
status
=
WSAEFAULT
;
break
;
SetLastError
(
WSAEFAULT
)
;
return
-
1
;
}
saddr_in
->
sin_family
=
WS_AF_INET
;
saddr_in
->
sin_addr
.
S_un
.
S_addr
=
ipAddrTable
->
table
[
found_index
].
dwAddr
;
saddr_in
->
sin_port
=
0
;
total
=
sizeof
(
struct
WS_sockaddr_in
);
HeapFree
(
GetProcessHeap
(),
0
,
ipAddrTable
);
break
;
ret
=
server_ioctl_sock
(
s
,
IOCTL_AFD_WINE_COMPLETE_ASYNC
,
&
status
,
sizeof
(
status
),
NULL
,
0
,
ret_size
,
overlapped
,
completion
);
if
(
!
ret
)
*
ret_size
=
sizeof
(
struct
WS_sockaddr_in
);
SetLastError
(
ret
);
return
ret
?
-
1
:
0
;
}
case
WS_SIO_SET_COMPATIBILITY_MODE
:
...
...
dlls/ws2_32/tests/sock.c
View file @
dddd4662
...
...
@@ -7770,7 +7770,7 @@ static void test_sioRoutingInterfaceQuery(void)
size
=
0xdeadbeef
;
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
in
,
sizeof
(
in
),
&
out
,
sizeof
(
out
),
&
size
,
NULL
,
NULL
);
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
size
==
sizeof
(
out
),
"got size %u
\n
"
,
size
);
/* We expect the source address to be INADDR_LOOPBACK as well, but
* there's no guarantee that a route to the loopback address exists,
...
...
@@ -7801,15 +7801,15 @@ static void test_sioRoutingInterfaceQuery(void)
overlapped
.
InternalHigh
=
0xdeadbeef
;
ret
=
WSAIoctl
(
sock
,
SIO_ROUTING_INTERFACE_QUERY
,
&
in
,
sizeof
(
in
),
&
out
,
sizeof
(
out
),
&
size
,
&
overlapped
,
NULL
);
ok
(
!
ret
,
"expected failure
\n
"
);
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
size
==
sizeof
(
out
),
"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
(
!
size
,
"got size %u
\n
"
,
size
);
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
);
ok
(
!
overlapped
.
InternalHigh
,
"got size %Iu
\n
"
,
overlapped
.
InternalHigh
);
CloseHandle
(
port
);
closesocket
(
sock
);
...
...
@@ -7829,14 +7829,11 @@ static void test_sioRoutingInterfaceQuery(void)
ok
(
size
==
sizeof
(
out
),
"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
);
}
ok
(
ret
==
WAIT_IO_COMPLETION
,
"got %d
\n
"
,
ret
);
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
(
sock
);
}
...
...
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