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
ab1eee50
Commit
ab1eee50
authored
Jan 11, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Ensure recv functions set last error to zero when they succeed.
parent
d4d14cde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
8 deletions
+1
-8
socket.c
dlls/ws2_32/socket.c
+1
-0
sock.c
dlls/ws2_32/tests/sock.c
+0
-8
No files found.
dlls/ws2_32/socket.c
View file @
ab1eee50
...
...
@@ -6776,6 +6776,7 @@ static int WS2_recv_base( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
if
(
wsa
!=
&
localwsa
)
HeapFree
(
GetProcessHeap
(),
0
,
wsa
);
release_sock_fd
(
s
,
fd
);
_enable_event
(
SOCKET2HANDLE
(
s
),
FD_READ
,
0
,
0
);
SetLastError
(
ERROR_SUCCESS
);
return
0
;
...
...
dlls/ws2_32/tests/sock.c
View file @
ab1eee50
...
...
@@ -5136,14 +5136,12 @@ static void test_events(int useMessages)
SetLastError
(
0xdeadbeef
);
ret
=
recv
(
src
,
buffer
,
1
,
MSG_PEEK
);
ok
(
ret
==
1
,
"Failed to peek at recv buffer %d err %d
\n
"
,
ret
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
ok_event_seq
(
src
,
hEvent
,
read_seq
,
NULL
,
0
);
SetLastError
(
0xdeadbeef
);
ret
=
recv
(
src
,
buffer
,
50
,
0
);
ok
(
ret
==
50
,
"Failed to recv buffer %d err %d
\n
"
,
ret
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
ok_event_seq
(
src
,
hEvent
,
read_seq
,
NULL
,
0
);
...
...
@@ -5171,7 +5169,6 @@ todo_wine
SetLastError
(
0xdeadbeef
);
ret
=
recv
(
src
,
buffer
,
1
,
0
);
ok
(
ret
==
1
,
"Failed to recv buffer %d err %d
\n
"
,
ret
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
ok_event_seq
(
src
,
hEvent
,
empty_seq
,
NULL
,
0
);
...
...
@@ -5603,7 +5600,6 @@ static void test_WSASendMsg(void)
ret
=
recvfrom
(
dst
,
buffer
,
sizeof
(
buffer
),
0
,
(
struct
sockaddr
*
)
&
sockaddr
,
&
addrlen
);
ok
(
ret
==
bytesSent
,
"got %d, expected %d
\n
"
,
ret
,
bytesSent
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
/* A successful call to WSASendMsg must have bound the socket */
...
...
@@ -5634,7 +5630,6 @@ todo_wine
ret
=
recvfrom
(
dst
,
buffer
,
sizeof
(
buffer
),
0
,
(
struct
sockaddr
*
)
&
sockaddr
,
&
addrlen
);
ok
(
ret
==
bytesSent
,
"got %d, expected %d
\n
"
,
ret
,
bytesSent
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
closesocket
(
sock
);
...
...
@@ -5770,14 +5765,12 @@ static void test_WSARecv(void)
iret
=
WSARecv
(
dest
,
&
bufs
,
1
,
&
bytesReturned
,
&
flags
,
NULL
,
NULL
);
ok
(
!
iret
,
"Expected 0, got %d
\n
"
,
iret
);
ok
(
bytesReturned
,
"Expected 2, got %d
\n
"
,
bytesReturned
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
bytesReturned
=
0xdeadbeef
;
iret
=
WSARecv
(
dest
,
&
bufs
,
1
,
&
bytesReturned
,
&
flags
,
NULL
,
NULL
);
ok
(
!
iret
,
"Expected 0, got %d
\n
"
,
iret
);
ok
(
bytesReturned
,
"Expected 2, got %d
\n
"
,
bytesReturned
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
bufs
.
len
=
4
;
...
...
@@ -5790,7 +5783,6 @@ todo_wine
iret
=
WSARecv
(
dest
,
&
bufs
,
1
,
&
bytesReturned
,
&
flags
,
NULL
,
NULL
);
ok
(
!
iret
,
"Expected 0, got %d
\n
"
,
iret
);
ok
(
bytesReturned
,
"Expected 4, got %d
\n
"
,
bytesReturned
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
GetLastError
());
bufs
.
len
=
sizeof
(
buf
);
...
...
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