Author: hpoussin
Date: Mon Sep 24 12:39:23 2007
New Revision: 29174
URL:
http://svn.reactos.org/svn/reactos?rev=29174&view=rev
Log:
Never call TdiCloseDevice when warming up a socket
Modified:
trunk/reactos/drivers/network/afd/afd/bind.c
trunk/reactos/drivers/network/afd/afd/connect.c
Modified: trunk/reactos/drivers/network/afd/afd/bind.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/bi…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/bind.c (original)
+++ trunk/reactos/drivers/network/afd/afd/bind.c Mon Sep 24 12:39:23 2007
@@ -14,29 +14,24 @@
#include "debug.h"
NTSTATUS WarmSocketForBind( PAFD_FCB FCB ) {
- NTSTATUS Status = STATUS_UNSUCCESSFUL;
+ NTSTATUS Status;
AFD_DbgPrint(MID_TRACE,("Called (AF %d)\n",
- FCB->LocalAddress->Address[0].AddressType));
+ FCB->LocalAddress->Address[0].AddressType));
if( !FCB->TdiDeviceName.Length || !FCB->TdiDeviceName.Buffer ) {
- AFD_DbgPrint(MID_TRACE,("Null Device\n"));
- return STATUS_NO_SUCH_DEVICE;
+ AFD_DbgPrint(MID_TRACE,("Null Device\n"));
+ return STATUS_NO_SUCH_DEVICE;
+ }
+ if( !FCB->LocalAddress ) {
+ AFD_DbgPrint(MID_TRACE,("No local address\n"));
+ return STATUS_UNSUCCESSFUL;
}
- if( FCB->LocalAddress ) {
- Status = TdiOpenAddressFile
- ( &FCB->TdiDeviceName,
- FCB->LocalAddress,
- &FCB->AddressFile.Handle,
- &FCB->AddressFile.Object );
- }
-
- if( !NT_SUCCESS(Status) ) {
- TdiCloseDevice( &FCB->AddressFile.Handle,
- FCB->AddressFile.Object );
- RtlZeroMemory( &FCB->AddressFile, sizeof( FCB->AddressFile ) );
- }
+ Status = TdiOpenAddressFile(&FCB->TdiDeviceName,
+ FCB->LocalAddress,
+ &FCB->AddressFile.Handle,
+ &FCB->AddressFile.Object );
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
Modified: trunk/reactos/drivers/network/afd/afd/connect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/connect.c (original)
+++ trunk/reactos/drivers/network/afd/afd/connect.c Mon Sep 24 12:39:23 2007
@@ -16,25 +16,17 @@
NTSTATUS Status;
if( !FCB->TdiDeviceName.Length || !FCB->TdiDeviceName.Buffer ) {
- AFD_DbgPrint(MID_TRACE,("Null Device\n"));
- return STATUS_NO_SUCH_DEVICE;
- }
-
- Status = TdiOpenConnectionEndpointFile
- ( &FCB->TdiDeviceName,
- &FCB->Connection.Handle,
- &FCB->Connection.Object );
+ AFD_DbgPrint(MID_TRACE,("Null Device\n"));
+ return STATUS_NO_SUCH_DEVICE;
+ }
+
+ Status = TdiOpenConnectionEndpointFile(&FCB->TdiDeviceName,
+ &FCB->Connection.Handle,
+ &FCB->Connection.Object );
if( NT_SUCCESS(Status) ) {
- Status = TdiAssociateAddressFile
- ( FCB->AddressFile.Handle,
- FCB->Connection.Object );
- }
-
- if( !NT_SUCCESS(Status) ) {
- TdiCloseDevice( &FCB->Connection.Handle,
- FCB->Connection.Object );
- RtlZeroMemory( &FCB->Connection, sizeof(FCB->Connection) );
+ Status = TdiAssociateAddressFile( FCB->AddressFile.Handle,
+ FCB->Connection.Object );
}
return Status;