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
e3e860e5
Commit
e3e860e5
authored
Dec 10, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Handle WoW64 WSABUF pointers in sock_recv().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7bea24f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
socket.c
dlls/ntdll/unix/socket.c
+28
-10
afd.h
include/wine/afd.h
+6
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
e3e860e5
...
...
@@ -595,7 +595,7 @@ static BOOL async_recv_proc( void *user, ULONG_PTR *info, NTSTATUS *status )
}
static
NTSTATUS
sock_recv
(
HANDLE
handle
,
HANDLE
event
,
PIO_APC_ROUTINE
apc
,
void
*
apc_user
,
IO_STATUS_BLOCK
*
io
,
int
fd
,
const
WSABUF
*
buffers
,
unsigned
int
count
,
WSABUF
*
control
,
int
fd
,
const
void
*
buffers_ptr
,
unsigned
int
count
,
WSABUF
*
control
,
struct
WS_sockaddr
*
addr
,
int
*
addr_len
,
DWORD
*
ret_flags
,
int
unix_flags
,
int
force_async
)
{
struct
async_recv_ioctl
*
async
;
...
...
@@ -614,22 +614,31 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
return
STATUS_INVALID_PARAMETER
;
}
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
!
virtual_check_buffer_for_write
(
buffers
[
i
].
buf
,
buffers
[
i
].
len
))
return
STATUS_ACCESS_VIOLATION
;
}
async_size
=
offsetof
(
struct
async_recv_ioctl
,
iov
[
count
]
);
if
(
!
(
async
=
(
struct
async_recv_ioctl
*
)
alloc_fileio
(
async_size
,
async_recv_proc
,
handle
)))
return
STATUS_NO_MEMORY
;
async
->
count
=
count
;
for
(
i
=
0
;
i
<
count
;
++
i
)
if
(
in_wow64_call
()
)
{
async
->
iov
[
i
].
iov_base
=
buffers
[
i
].
buf
;
async
->
iov
[
i
].
iov_len
=
buffers
[
i
].
len
;
const
struct
afd_wsabuf_32
*
buffers
=
buffers_ptr
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
async
->
iov
[
i
].
iov_base
=
ULongToPtr
(
buffers
[
i
].
buf
);
async
->
iov
[
i
].
iov_len
=
buffers
[
i
].
len
;
}
}
else
{
const
WSABUF
*
buffers
=
buffers_ptr
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
async
->
iov
[
i
].
iov_base
=
buffers
[
i
].
buf
;
async
->
iov
[
i
].
iov_len
=
buffers
[
i
].
len
;
}
}
async
->
unix_flags
=
unix_flags
;
async
->
control
=
control
;
...
...
@@ -637,6 +646,15 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
async
->
addr_len
=
addr_len
;
async
->
ret_flags
=
ret_flags
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
!
virtual_check_buffer_for_write
(
async
->
iov
[
i
].
iov_base
,
async
->
iov
[
i
].
iov_len
))
{
release_fileio
(
&
async
->
io
);
return
STATUS_ACCESS_VIOLATION
;
}
}
status
=
try_recv
(
fd
,
async
,
&
information
);
if
(
status
!=
STATUS_SUCCESS
&&
status
!=
STATUS_BUFFER_OVERFLOW
&&
status
!=
STATUS_DEVICE_NOT_READY
)
...
...
include/wine/afd.h
View file @
e3e860e5
...
...
@@ -25,6 +25,12 @@
#include <winioctl.h>
#include <mswsock.h>
struct
afd_wsabuf_32
{
ULONG
len
;
ULONG
buf
;
};
#ifdef USE_WS_PREFIX
# define WS(x) WS_##x
#else
...
...
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