projects
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[WS2_32] Set last error on exit on some functions
[reactos.git]
/
reactos
/
dll
/
win32
/
ws2_32
/
src
/
socklife.c
diff --git
a/reactos/dll/win32/ws2_32/src/socklife.c
b/reactos/dll/win32/ws2_32/src/socklife.c
index
5b14364
..
b53bb79
100644
(file)
--- a/
reactos/dll/win32/ws2_32/src/socklife.c
+++ b/
reactos/dll/win32/ws2_32/src/socklife.c
@@
-59,7
+59,11
@@
bind(IN SOCKET s,
WsSockDereference(Socket);
/* Return Provider Value */
WsSockDereference(Socket);
/* Return Provider Value */
- if (Status == ERROR_SUCCESS) return Status;
+ if (Status == ERROR_SUCCESS)
+ {
+ SetLastError(ErrorCode);
+ return Status;
+ }
/* If everything seemed fine, then the WSP call failed itself */
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
/* If everything seemed fine, then the WSP call failed itself */
if (ErrorCode == NO_ERROR) ErrorCode = WSASYSCALLFAILURE;
@@
-120,7
+124,11
@@
closesocket(IN SOCKET s)
WsSockDereference(Socket);
/* Return success if everything is OK */
WsSockDereference(Socket);
/* Return success if everything is OK */
- if (ErrorCode == ERROR_SUCCESS) return ErrorCode;
+ if (ErrorCode == ERROR_SUCCESS)
+ {
+ SetLastError(ErrorCode);
+ return ErrorCode;
+ }
}
}
else
}
}
else
@@
-347,6
+355,7
@@
WSAAccept(IN SOCKET s,
}
/* Return */
}
/* Return */
+ SetLastError(ErrorCode);
return Status;
}
}
return Status;
}
}
@@
-421,6
+430,7
@@
WSAJoinLeaf(IN SOCKET s,
}
/* Return */
}
/* Return */
+ SetLastError(ErrorCode);
return Status;
}
}
return Status;
}
}
@@
-582,6
+592,7
@@
DoLookup:
{
/* Add an API reference and return */
WsSockAddApiReference(Status);
{
/* Add an API reference and return */
WsSockAddApiReference(Status);
+ SetLastError(ErrorCode);
return Status;
}
}
return Status;
}
}