Author: cgutman
Date: Fri May 28 06:07:39 2010
New Revision: 47378
URL:
http://svn.reactos.org/svn/reactos?rev=47378&view=rev
Log:
[MSAFD]
- 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
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
trunk/reactos/dll/win32/msafd/misc/sndrcv.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri May 28 06:07:39 2010
@@ -384,20 +384,17 @@
DWORD Received,
LPDWORD ReturnedBytes)
{
- if (Errno)
- {
- *Errno = TranslateNtStatusError(Status);
-
- if (ReturnedBytes)
- {
- if (!*Errno)
- *ReturnedBytes = Received;
- else
- *ReturnedBytes = 0;
- }
- }
-
- return Status ? SOCKET_ERROR : 0;
+ *Errno = TranslateNtStatusError(Status);
+
+ if (ReturnedBytes)
+ {
+ if (!*Errno)
+ *ReturnedBytes = Received;
+ else
+ *ReturnedBytes = 0;
+ }
+
+ return *Errno ? SOCKET_ERROR : 0;
}
/*
Modified: trunk/reactos/dll/win32/msafd/misc/sndrcv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/sndrc…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/sndrcv.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/sndrcv.c [iso-8859-1] Fri May 28 06:07:39 2010
@@ -540,7 +540,8 @@
BindAddress,
&BindAddressLength);
/* Bind it */
- WSPBind(Handle, BindAddress, BindAddressLength, NULL);
+ if (WSPBind(Handle, BindAddress, BindAddressLength, lpErrno) == SOCKET_ERROR)
+ return SOCKET_ERROR;
}
RemoteAddress = HeapAlloc(GlobalHeap, 0, 0x6 + SocketAddressLength);