Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
312f50a2
Commit
312f50a2
authored
Sep 05, 2011
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Avoid an unhandled exception in WSAIoctl.
parent
6deccab6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
socket.c
dlls/ws2_32/socket.c
+9
-6
sock.c
dlls/ws2_32/tests/sock.c
+13
-0
No files found.
dlls/ws2_32/socket.c
View file @
312f50a2
...
@@ -3365,17 +3365,20 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
...
@@ -3365,17 +3365,20 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
}
}
case
WS_SIO_KEEPALIVE_VALS
:
case
WS_SIO_KEEPALIVE_VALS
:
{
{
struct
tcp_keepalive
*
k
=
in_buff
;
struct
tcp_keepalive
*
k
;
int
keepalive
=
k
->
onoff
?
1
:
0
;
int
keepalive
,
keepidle
,
keepintvl
;
int
keepidle
=
k
->
keepalivetime
/
1000
;
int
keepintvl
=
k
->
keepaliveinterval
/
1000
;
if
(
!
in_buff
)
if
(
!
in_buff
||
in_size
<
sizeof
(
struct
tcp_keepalive
)
)
{
{
WSASetLastError
(
WSAE
INVAL
);
WSASetLastError
(
WSAE
FAULT
);
return
SOCKET_ERROR
;
return
SOCKET_ERROR
;
}
}
k
=
in_buff
;
keepalive
=
k
->
onoff
?
1
:
0
;
keepidle
=
k
->
keepalivetime
/
1000
;
keepintvl
=
k
->
keepaliveinterval
/
1000
;
TRACE
(
"onoff: %d, keepalivetime: %d, keepaliveinterval: %d
\n
"
,
keepalive
,
keepidle
,
keepintvl
);
TRACE
(
"onoff: %d, keepalivetime: %d, keepaliveinterval: %d
\n
"
,
keepalive
,
keepidle
,
keepintvl
);
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
fd
=
get_sock_fd
(
s
,
0
,
NULL
);
...
...
dlls/ws2_32/tests/sock.c
View file @
312f50a2
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <windows.h>
#include <windows.h>
#include <ws2tcpip.h>
#include <ws2tcpip.h>
#include <mswsock.h>
#include <mswsock.h>
#include <mstcpip.h>
#include <stdio.h>
#include <stdio.h>
#include "wine/test.h"
#include "wine/test.h"
...
@@ -2960,6 +2961,18 @@ static void test_ioctlsocket(void)
...
@@ -2960,6 +2961,18 @@ static void test_ioctlsocket(void)
ret
=
ioctlsocket
(
sock
,
SIOCATMARK
,
&
arg
);
ret
=
ioctlsocket
(
sock
,
SIOCATMARK
,
&
arg
);
if
(
ret
!=
SOCKET_ERROR
)
if
(
ret
!=
SOCKET_ERROR
)
todo_wine
ok
(
arg
,
"expected a non-zero value
\n
"
);
todo_wine
ok
(
arg
,
"expected a non-zero value
\n
"
);
ret
=
WSAIoctl
(
sock
,
SIO_KEEPALIVE_VALS
,
&
arg
,
0
,
NULL
,
0
,
&
arg
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl succeeded unexpectedly
\n
"
);
ret
=
WSAGetLastError
();
ok
(
ret
==
WSAEFAULT
||
broken
(
ret
==
WSAEINVAL
),
"expected WSAEFAULT, got %d instead
\n
"
,
ret
);
ret
=
WSAIoctl
(
sock
,
SIO_KEEPALIVE_VALS
,
NULL
,
sizeof
(
struct
tcp_keepalive
),
NULL
,
0
,
&
arg
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"WSAIoctl succeeded unexpectedly
\n
"
);
ret
=
WSAGetLastError
();
ok
(
ret
==
WSAEFAULT
||
broken
(
ret
==
WSAEINVAL
),
"expected WSAEFAULT, got %d instead
\n
"
,
ret
);
closesocket
(
sock
);
}
}
static
int
drain_pause
=
0
;
static
int
drain_pause
=
0
;
...
...
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