- Pass a valid pointer for lpErrno to WSPBind when performing an implicit bind
- Remove the hack in MsafdReturnWithErrno for dealing with stupid callers that provide don't provide a valid Errno pointer

svn path=/trunk/; revision=47378
This commit is contained in:
Cameron Gutman 2010-05-28 04:07:39 +00:00
parent 219cc11d6a
commit 54b6aff827
2 changed files with 10 additions and 12 deletions

View file

@ -384,20 +384,17 @@ DWORD MsafdReturnWithErrno(NTSTATUS Status,
DWORD Received, DWORD Received,
LPDWORD ReturnedBytes) LPDWORD ReturnedBytes)
{ {
if (Errno) *Errno = TranslateNtStatusError(Status);
{
*Errno = TranslateNtStatusError(Status);
if (ReturnedBytes) if (ReturnedBytes)
{ {
if (!*Errno) if (!*Errno)
*ReturnedBytes = Received; *ReturnedBytes = Received;
else else
*ReturnedBytes = 0; *ReturnedBytes = 0;
}
} }
return Status ? SOCKET_ERROR : 0; return *Errno ? SOCKET_ERROR : 0;
} }
/* /*

View file

@ -540,7 +540,8 @@ WSPSendTo(SOCKET Handle,
BindAddress, BindAddress,
&BindAddressLength); &BindAddressLength);
/* Bind it */ /* Bind it */
WSPBind(Handle, BindAddress, BindAddressLength, NULL); if (WSPBind(Handle, BindAddress, BindAddressLength, lpErrno) == SOCKET_ERROR)
return SOCKET_ERROR;
} }
RemoteAddress = HeapAlloc(GlobalHeap, 0, 0x6 + SocketAddressLength); RemoteAddress = HeapAlloc(GlobalHeap, 0, 0x6 + SocketAddressLength);