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
7747bf95
Commit
7747bf95
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: Make the afd_transmit_params structure WoW64-compatible.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b3fd1ca2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
socket.c
dlls/ntdll/unix/socket.c
+18
-12
socket.c
dlls/ws2_32/socket.c
+9
-3
afd.h
include/wine/afd.h
+7
-3
No files found.
dlls/ntdll/unix/socket.c
View file @
7747bf95
...
@@ -143,7 +143,10 @@ struct async_transmit_ioctl
...
@@ -143,7 +143,10 @@ struct async_transmit_ioctl
unsigned
int
tail_cursor
;
/* amount of tail data already sent */
unsigned
int
tail_cursor
;
/* amount of tail data already sent */
unsigned
int
file_len
;
/* total file length to send */
unsigned
int
file_len
;
/* total file length to send */
DWORD
flags
;
DWORD
flags
;
TRANSMIT_FILE_BUFFERS
buffers
;
const
char
*
head
;
const
char
*
tail
;
unsigned
int
head_len
;
unsigned
int
tail_len
;
LARGE_INTEGER
offset
;
LARGE_INTEGER
offset
;
};
};
...
@@ -1090,11 +1093,11 @@ static NTSTATUS try_transmit( int sock_fd, int file_fd, struct async_transmit_io
...
@@ -1090,11 +1093,11 @@ static NTSTATUS try_transmit( int sock_fd, int file_fd, struct async_transmit_io
{
{
ssize_t
ret
;
ssize_t
ret
;
while
(
async
->
head_cursor
<
async
->
buffers
.
HeadLength
)
while
(
async
->
head_cursor
<
async
->
head_len
)
{
{
TRACE
(
"sending %u bytes of header data
\n
"
,
async
->
buffers
.
HeadLength
-
async
->
head_cursor
);
TRACE
(
"sending %u bytes of header data
\n
"
,
async
->
head_len
-
async
->
head_cursor
);
ret
=
do_send
(
sock_fd
,
(
char
*
)
async
->
buffers
.
H
ead
+
async
->
head_cursor
,
ret
=
do_send
(
sock_fd
,
async
->
h
ead
+
async
->
head_cursor
,
async
->
buffers
.
HeadLength
-
async
->
head_cursor
,
0
);
async
->
head_len
-
async
->
head_cursor
,
0
);
if
(
ret
<
0
)
return
sock_errno_to_status
(
errno
);
if
(
ret
<
0
)
return
sock_errno_to_status
(
errno
);
TRACE
(
"send returned %zd
\n
"
,
ret
);
TRACE
(
"send returned %zd
\n
"
,
ret
);
async
->
head_cursor
+=
ret
;
async
->
head_cursor
+=
ret
;
...
@@ -1139,11 +1142,11 @@ static NTSTATUS try_transmit( int sock_fd, int file_fd, struct async_transmit_io
...
@@ -1139,11 +1142,11 @@ static NTSTATUS try_transmit( int sock_fd, int file_fd, struct async_transmit_io
return
STATUS_DEVICE_NOT_READY
;
/* still more data to send */
return
STATUS_DEVICE_NOT_READY
;
/* still more data to send */
}
}
while
(
async
->
tail_cursor
<
async
->
buffers
.
TailLength
)
while
(
async
->
tail_cursor
<
async
->
tail_len
)
{
{
TRACE
(
"sending %u bytes of tail data
\n
"
,
async
->
buffers
.
TailLength
-
async
->
tail_cursor
);
TRACE
(
"sending %u bytes of tail data
\n
"
,
async
->
tail_len
-
async
->
tail_cursor
);
ret
=
do_send
(
sock_fd
,
(
char
*
)
async
->
buffers
.
T
ail
+
async
->
tail_cursor
,
ret
=
do_send
(
sock_fd
,
async
->
t
ail
+
async
->
tail_cursor
,
async
->
buffers
.
TailLength
-
async
->
tail_cursor
,
0
);
async
->
tail_len
-
async
->
tail_cursor
,
0
);
if
(
ret
<
0
)
return
sock_errno_to_status
(
errno
);
if
(
ret
<
0
)
return
sock_errno_to_status
(
errno
);
TRACE
(
"send returned %zd
\n
"
,
ret
);
TRACE
(
"send returned %zd
\n
"
,
ret
);
async
->
tail_cursor
+=
ret
;
async
->
tail_cursor
+=
ret
;
...
@@ -1202,7 +1205,7 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
...
@@ -1202,7 +1205,7 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
if
(
params
->
file
)
if
(
params
->
file
)
{
{
if
((
status
=
server_get_unix_fd
(
params
->
file
,
0
,
&
file_fd
,
&
file_needs_close
,
&
file_type
,
NULL
)))
if
((
status
=
server_get_unix_fd
(
ULongToHandle
(
params
->
file
)
,
0
,
&
file_fd
,
&
file_needs_close
,
&
file_type
,
NULL
)))
return
status
;
return
status
;
if
(
file_needs_close
)
close
(
file_fd
);
if
(
file_needs_close
)
close
(
file_fd
);
...
@@ -1216,7 +1219,7 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
...
@@ -1216,7 +1219,7 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
if
(
!
(
async
=
(
struct
async_transmit_ioctl
*
)
alloc_fileio
(
sizeof
(
*
async
),
async_transmit_proc
,
handle
)))
if
(
!
(
async
=
(
struct
async_transmit_ioctl
*
)
alloc_fileio
(
sizeof
(
*
async
),
async_transmit_proc
,
handle
)))
return
STATUS_NO_MEMORY
;
return
STATUS_NO_MEMORY
;
async
->
file
=
params
->
file
;
async
->
file
=
ULongToHandle
(
params
->
file
)
;
async
->
buffer_size
=
params
->
buffer_size
?
params
->
buffer_size
:
65536
;
async
->
buffer_size
=
params
->
buffer_size
?
params
->
buffer_size
:
65536
;
if
(
!
(
async
->
buffer
=
malloc
(
async
->
buffer_size
)))
if
(
!
(
async
->
buffer
=
malloc
(
async
->
buffer_size
)))
{
{
...
@@ -1230,7 +1233,10 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
...
@@ -1230,7 +1233,10 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
async
->
tail_cursor
=
0
;
async
->
tail_cursor
=
0
;
async
->
file_len
=
params
->
file_len
;
async
->
file_len
=
params
->
file_len
;
async
->
flags
=
params
->
flags
;
async
->
flags
=
params
->
flags
;
async
->
buffers
=
params
->
buffers
;
async
->
head
=
u64_to_user_ptr
(
params
->
head_ptr
);
async
->
head_len
=
params
->
head_len
;
async
->
tail
=
u64_to_user_ptr
(
params
->
tail_ptr
);
async
->
tail_len
=
params
->
tail_len
;
async
->
offset
=
params
->
offset
;
async
->
offset
=
params
->
offset
;
SERVER_START_REQ
(
send_socket
)
SERVER_START_REQ
(
send_socket
)
...
...
dlls/ws2_32/socket.c
View file @
7747bf95
...
@@ -819,7 +819,7 @@ static BOOL WINAPI WS2_AcceptEx( SOCKET listener, SOCKET acceptor, void *dest, D
...
@@ -819,7 +819,7 @@ static BOOL WINAPI WS2_AcceptEx( SOCKET listener, SOCKET acceptor, void *dest, D
static
BOOL
WINAPI
WS2_TransmitFile
(
SOCKET
s
,
HANDLE
file
,
DWORD
file_len
,
DWORD
buffer_size
,
static
BOOL
WINAPI
WS2_TransmitFile
(
SOCKET
s
,
HANDLE
file
,
DWORD
file_len
,
DWORD
buffer_size
,
OVERLAPPED
*
overlapped
,
TRANSMIT_FILE_BUFFERS
*
buffers
,
DWORD
flags
)
OVERLAPPED
*
overlapped
,
TRANSMIT_FILE_BUFFERS
*
buffers
,
DWORD
flags
)
{
{
struct
afd_transmit_params
params
=
{
0
};
struct
afd_transmit_params
params
=
{
{{
0
}}
};
IO_STATUS_BLOCK
iosb
,
*
piosb
=
&
iosb
;
IO_STATUS_BLOCK
iosb
,
*
piosb
=
&
iosb
;
HANDLE
event
=
NULL
;
HANDLE
event
=
NULL
;
void
*
cvalue
=
NULL
;
void
*
cvalue
=
NULL
;
...
@@ -844,10 +844,16 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE file, DWORD file_len, DWOR
...
@@ -844,10 +844,16 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE file, DWORD file_len, DWOR
params
.
offset
.
QuadPart
=
FILE_USE_FILE_POINTER_POSITION
;
params
.
offset
.
QuadPart
=
FILE_USE_FILE_POINTER_POSITION
;
}
}
params
.
file
=
file
;
params
.
file
=
HandleToULong
(
file
)
;
params
.
file_len
=
file_len
;
params
.
file_len
=
file_len
;
params
.
buffer_size
=
buffer_size
;
params
.
buffer_size
=
buffer_size
;
if
(
buffers
)
params
.
buffers
=
*
buffers
;
if
(
buffers
)
{
params
.
head_ptr
=
u64_from_user_ptr
(
buffers
->
Head
);
params
.
head_len
=
buffers
->
HeadLength
;
params
.
tail_ptr
=
u64_from_user_ptr
(
buffers
->
Tail
);
params
.
tail_len
=
buffers
->
TailLength
;
}
params
.
flags
=
flags
;
params
.
flags
=
flags
;
status
=
NtDeviceIoControlFile
(
(
HANDLE
)
s
,
event
,
NULL
,
cvalue
,
piosb
,
status
=
NtDeviceIoControlFile
(
(
HANDLE
)
s
,
event
,
NULL
,
cvalue
,
piosb
,
...
...
include/wine/afd.h
View file @
7747bf95
...
@@ -310,13 +310,17 @@ C_ASSERT( sizeof(struct afd_sendmsg_params) == 32 );
...
@@ -310,13 +310,17 @@ C_ASSERT( sizeof(struct afd_sendmsg_params) == 32 );
struct
afd_transmit_params
struct
afd_transmit_params
{
{
HANDLE
file
;
LARGE_INTEGER
offset
;
ULONGLONG
head_ptr
;
ULONGLONG
tail_ptr
;
DWORD
head_len
;
DWORD
tail_len
;
ULONG
file
;
DWORD
file_len
;
DWORD
file_len
;
DWORD
buffer_size
;
DWORD
buffer_size
;
LARGE_INTEGER
offset
;
TRANSMIT_FILE_BUFFERS
buffers
;
DWORD
flags
;
DWORD
flags
;
};
};
C_ASSERT
(
sizeof
(
struct
afd_transmit_params
)
==
48
);
struct
afd_message_select_params
struct
afd_message_select_params
{
{
...
...
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