mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[WS2_32] Set last error on exit on some functions
svn path=/trunk/; revision=74669
This commit is contained in:
parent
b2b645b014
commit
c43028c6ab
1 changed files with 13 additions and 2 deletions
|
@ -59,7 +59,11 @@ bind(IN SOCKET s,
|
|||
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;
|
||||
|
@ -120,7 +124,11 @@ closesocket(IN SOCKET s)
|
|||
WsSockDereference(Socket);
|
||||
|
||||
/* Return success if everything is OK */
|
||||
if (ErrorCode == ERROR_SUCCESS) return ErrorCode;
|
||||
if (ErrorCode == ERROR_SUCCESS)
|
||||
{
|
||||
SetLastError(ErrorCode);
|
||||
return ErrorCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -347,6 +355,7 @@ WSAAccept(IN SOCKET s,
|
|||
}
|
||||
|
||||
/* Return */
|
||||
SetLastError(ErrorCode);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
@ -421,6 +430,7 @@ WSAJoinLeaf(IN SOCKET s,
|
|||
}
|
||||
|
||||
/* Return */
|
||||
SetLastError(ErrorCode);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
@ -582,6 +592,7 @@ DoLookup:
|
|||
{
|
||||
/* Add an API reference and return */
|
||||
WsSockAddApiReference(Status);
|
||||
SetLastError(ErrorCode);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue