Author: cgutman
Date: Fri May 28 06:39:49 2010
New Revision: 47379
URL:
http://svn.reactos.org/svn/reactos?rev=47379&view=rev
Log:
[TCPIP]
- Return STATUS_INVALID_ADDRESS if the caller tries to get a non-local address
- Return STATUS_ADDRESS_ALREADY_EXISTS if the caller uses an address that is in use
[MSAFD]
- Translate STATUS_ADDRESS_ALREADY_EXISTS -> WSAEADDRINUSE, STATUS_LOCAL_DISCONNECT
-> WSAECONNABORTED, and STATUS_REMOTE_DISCONNECT -> WSAECONNRESET
[IP]
- Translate OSK_EADDRINUSE -> STATUS_ADDRESS_ALREADY_EXISTS, OSK_ECONNABORTED ->
STATUS_LOCAL_DISCONNECT, and OSK_ECONNRESET -> STATUS_REMOTE_DISCONNECT
- Fixes waiting for binding during ws2_32 sock winetest
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.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:39:49 2010
@@ -372,6 +372,18 @@
case STATUS_CANCELLED:
DbgPrint("MSAFD: STATUS_CANCELLED\n");
return WSA_OPERATION_ABORTED;
+
+ case STATUS_ADDRESS_ALREADY_EXISTS:
+ DbgPrint("MSAFD: STATUS_ADDRESS_ALREADY_EXISTS\n");
+ return WSAEADDRINUSE;
+
+ case STATUS_LOCAL_DISCONNECT:
+ DbgPrint("MSAFD: STATUS_LOCAL_DISCONNECT\n");
+ return WSAECONNABORTED;
+
+ case STATUS_REMOTE_DISCONNECT:
+ DbgPrint("MSAFD: STATUS_REMOTE_DISCONNECT\n");
+ return WSAECONNRESET;
default:
DbgPrint("MSAFD: Unhandled NTSTATUS value: 0x%x\n", Status);
Modified: trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Fri May 28 06:39:49
2010
@@ -265,7 +265,7 @@
!AddrLocateInterface(&AddrFile->Address)) {
ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
TI_DbgPrint(MIN_TRACE, ("Non-local address given (0x%X).\n",
A2S(&AddrFile->Address)));
- return STATUS_INVALID_PARAMETER;
+ return STATUS_INVALID_ADDRESS;
}
TI_DbgPrint(MID_TRACE, ("Opening address %s for communication (P=%d
U=%d).\n",
@@ -282,7 +282,7 @@
AddrFile->Port == 0xffff)
{
ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
- return STATUS_INVALID_PARAMETER;
+ return STATUS_ADDRESS_ALREADY_EXISTS;
}
AddEntity(CO_TL_ENTITY, AddrFile, CO_TL_TCP);
@@ -300,7 +300,7 @@
AddrFile->Port == 0xffff)
{
ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
- return STATUS_INVALID_PARAMETER;
+ return STATUS_ADDRESS_ALREADY_EXISTS;
}
TI_DbgPrint(MID_TRACE,("Setting port %d (wanted %d)\n",
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Fri May 28 06:39:49
2010
@@ -574,10 +574,11 @@
switch( OskitError ) {
case 0: Status = STATUS_SUCCESS; break;
case OSK_EADDRNOTAVAIL: Status = STATUS_INVALID_ADDRESS; break;
+ case OSK_EADDRINUSE: Status = STATUS_ADDRESS_ALREADY_EXISTS; break;
case OSK_EAFNOSUPPORT: Status = STATUS_INVALID_CONNECTION; break;
case OSK_ECONNREFUSED: Status = STATUS_REMOTE_NOT_LISTENING; break;
- case OSK_ECONNRESET:
- case OSK_ECONNABORTED: Status = STATUS_REMOTE_DISCONNECT; break;
+ case OSK_ECONNRESET: Status = STATUS_REMOTE_DISCONNECT; break;
+ case OSK_ECONNABORTED: Status = STATUS_LOCAL_DISCONNECT; break;
case OSK_EWOULDBLOCK:
case OSK_EINPROGRESS: Status = STATUS_PENDING; break;
case OSK_EINVAL: Status = STATUS_INVALID_PARAMETER; break;