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
b54b282a
Commit
b54b282a
authored
Jul 17, 2008
by
Daniel Santos
Committed by
Alexandre Julliard
Jul 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: WSASendTo() should clear last error on success.
parent
cafec085
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
socket.c
dlls/ws2_32/socket.c
+2
-0
sock.c
dlls/ws2_32/tests/sock.c
+30
-0
No files found.
dlls/ws2_32/socket.c
View file @
b54b282a
...
@@ -2766,6 +2766,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
...
@@ -2766,6 +2766,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
}
}
else
NtQueueApcThread
(
GetCurrentThread
(),
(
PNTAPCFUNC
)
ws2_async_apc
,
else
NtQueueApcThread
(
GetCurrentThread
(),
(
PNTAPCFUNC
)
ws2_async_apc
,
(
ULONG_PTR
)
wsa
,
(
ULONG_PTR
)
iosb
,
0
);
(
ULONG_PTR
)
wsa
,
(
ULONG_PTR
)
iosb
,
0
);
WSASetLastError
(
0
);
return
0
;
return
0
;
}
}
...
@@ -2830,6 +2831,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
...
@@ -2830,6 +2831,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
TRACE
(
" -> %i bytes
\n
"
,
*
lpNumberOfBytesSent
);
TRACE
(
" -> %i bytes
\n
"
,
*
lpNumberOfBytesSent
);
release_sock_fd
(
s
,
fd
);
release_sock_fd
(
s
,
fd
);
WSASetLastError
(
0
);
return
0
;
return
0
;
error:
error:
...
...
dlls/ws2_32/tests/sock.c
View file @
b54b282a
...
@@ -2180,6 +2180,34 @@ end:
...
@@ -2180,6 +2180,34 @@ end:
closesocket
(
v6
);
closesocket
(
v6
);
}
}
static
void
test_WSASendTo
(
void
)
{
SOCKET
s
;
struct
sockaddr_in
addr
;
char
buf
[
12
]
=
"hello world"
;
WSABUF
data_buf
;
DWORD
bytesSent
;
addr
.
sin_family
=
AF_INET
;
addr
.
sin_port
=
htons
(
139
);
addr
.
sin_addr
.
s_addr
=
inet_addr
(
"127.0.0.1"
);
data_buf
.
len
=
sizeof
(
buf
);
data_buf
.
buf
=
buf
;
if
(
(
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
==
INVALID_SOCKET
)
{
ok
(
0
,
"socket() failed error: %d
\n
"
,
WSAGetLastError
());
return
;
}
WSASetLastError
(
12345
);
if
(
WSASendTo
(
s
,
&
data_buf
,
1
,
&
bytesSent
,
0
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
),
NULL
,
NULL
))
{
ok
(
0
,
"WSASendTo() failed error: %d
\n
"
,
WSAGetLastError
());
return
;
}
ok
(
!
WSAGetLastError
(),
"WSAGetLastError() should return zero after "
"a successful call to WSASendTo()
\n
"
);
}
/**************** Main program ***************/
/**************** Main program ***************/
START_TEST
(
sock
)
START_TEST
(
sock
)
...
@@ -2219,6 +2247,8 @@ START_TEST( sock )
...
@@ -2219,6 +2247,8 @@ START_TEST( sock )
test_send
();
test_send
();
test_write_events
();
test_write_events
();
test_WSASendTo
();
test_ipv6only
();
test_ipv6only
();
Exit
();
Exit
();
...
...
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