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
1f44a257
Commit
1f44a257
authored
Jun 02, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Use IOCTL_AFD_WINE_SIOCATMARK.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
27609da3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
34 deletions
+15
-34
socket.c
dlls/ws2_32/socket.c
+6
-22
sock.c
dlls/ws2_32/tests/sock.c
+9
-12
No files found.
dlls/ws2_32/socket.c
View file @
1f44a257
...
...
@@ -3370,29 +3370,13 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
case
WS_SIOCATMARK
:
{
unsigned
int
oob
=
0
,
atmark
=
0
;
socklen_t
oobsize
=
sizeof
(
int
);
if
(
out_size
!=
sizeof
(
WS_u_long
)
||
IS_INTRESOURCE
(
out_buff
))
{
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
if
((
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
return
SOCKET_ERROR
;
/* SO_OOBINLINE sockets must always return TRUE to SIOCATMARK */
if
((
getsockopt
(
fd
,
SOL_SOCKET
,
SO_OOBINLINE
,
&
oob
,
&
oobsize
)
==
-
1
)
||
(
!
oob
&&
ioctl
(
fd
,
SIOCATMARK
,
&
atmark
)
==
-
1
))
status
=
wsaErrno
();
else
{
/* The SIOCATMARK value read from ioctl() is reversed
* because BSD returns TRUE if it's in the OOB mark
* while Windows returns TRUE if there are NO OOB bytes.
*/
(
*
(
WS_u_long
*
)
out_buff
)
=
oob
||
!
atmark
;
}
DWORD
ret
;
release_sock_fd
(
s
,
fd
);
break
;
ret
=
server_ioctl_sock
(
s
,
IOCTL_AFD_WINE_SIOCATMARK
,
in_buff
,
in_size
,
out_buff
,
out_size
,
ret_size
,
overlapped
,
completion
);
SetLastError
(
ret
);
if
(
!
ret
)
*
ret_size
=
sizeof
(
WS_u_long
);
return
ret
?
-
1
:
0
;
}
case
WS_FIOASYNC
:
...
...
dlls/ws2_32/tests/sock.c
View file @
1f44a257
...
...
@@ -3674,7 +3674,7 @@ static void check_fionread_siocatmark_(int line, SOCKET s, unsigned int normal,
WSASetLastError
(
0xdeadbeef
);
ret
=
WSAIoctl
(
s
,
SIOCATMARK
,
NULL
,
0
,
&
value
,
sizeof
(
value
),
&
size
,
NULL
,
NULL
);
ok_
(
__FILE__
,
line
)(
!
ret
,
"expected success
\n
"
);
todo_wine
ok_
(
__FILE__
,
line
)(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok_
(
__FILE__
,
line
)(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
todo_wine_if
(
todo_oob
)
ok_
(
__FILE__
,
line
)(
value
==
oob
,
"SIOCATMARK returned %u
\n
"
,
value
);
}
...
...
@@ -3765,9 +3765,9 @@ static void test_fionread_siocatmark(void)
overlapped
.
InternalHigh
=
0xdeadbeef
;
ret
=
WSAIoctl
(
client
,
SIOCATMARK
,
NULL
,
0
,
&
value
,
sizeof
(
value
),
&
size
,
&
overlapped
,
NULL
);
ok
(
!
ret
,
"expected success
\n
"
);
todo_wine
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
!
WSAGetLastError
(),
"got error %u
\n
"
,
WSAGetLastError
());
ok
(
value
==
TRUE
,
"got %u
\n
"
,
value
);
todo_wine
ok
(
size
==
sizeof
(
value
),
"got size %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
value
),
"got size %u
\n
"
,
size
);
ok
(
!
overlapped
.
Internal
,
"got status %#x
\n
"
,
(
NTSTATUS
)
overlapped
.
Internal
);
ok
(
!
overlapped
.
InternalHigh
,
"got size %Iu
\n
"
,
overlapped
.
InternalHigh
);
...
...
@@ -3881,17 +3881,14 @@ static void test_fionread_siocatmark(void)
size
=
0xdeadbeef
;
ret
=
WSAIoctl
(
server
,
SIOCATMARK
,
NULL
,
0
,
&
value
,
sizeof
(
value
),
&
size
,
&
overlapped
,
socket_apc
);
ok
(
!
ret
,
"expected success
\n
"
);
todo_wine
ok
(
size
==
sizeof
(
value
),
"got size %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
value
),
"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
(
server
);
}
...
...
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