[ros-diffs] [arty] 39686: Reformat. No changes (yet). Preemptive strike.

arty at svn.reactos.org arty at svn.reactos.org
Thu Feb 19 20:41:07 CET 2009


Author: arty
Date: Thu Feb 19 13:41:06 2009
New Revision: 39686

URL: http://svn.reactos.org/svn/reactos?rev=39686&view=rev
Log:
Reformat.  No changes (yet).  Preemptive strike.

Modified:
    trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c

Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c?rev=39686&r1=39685&r2=39686&view=diff
==============================================================================
--- 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] Thu Feb 19 13:41:06 2009
@@ -22,7 +22,7 @@
 PORT_SET TCPPorts;
 
 static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection,
-				       ULONG NewState ) {
+									   ULONG NewState ) {
     NTSTATUS Status = STATUS_SUCCESS;
     PTCP_COMPLETION_ROUTINE Complete;
     PTDI_BUCKET Bucket;
@@ -35,7 +35,7 @@
 
     /* Things that can happen when we try the initial connection */
     if( NewState & SEL_CONNECT ) {
-	while( !IsListEmpty( &Connection->ConnectRequest ) ) {
+		while( !IsListEmpty( &Connection->ConnectRequest ) ) {
             Entry = RemoveHeadList( &Connection->ConnectRequest );
             TI_DbgPrint(DEBUG_TCP, ("Connect Event\n"));
 
@@ -58,162 +58,162 @@
     }
 
     if( NewState & SEL_ACCEPT ) {
-	/* Handle readable on a listening socket --
-	 * TODO: Implement filtering
-	 */
-
-	TI_DbgPrint(DEBUG_TCP,("Accepting new connection on %x (Queue: %s)\n",
-			       Connection,
-			       IsListEmpty(&Connection->ListenRequest) ?
-			       "empty" : "nonempty"));
-
-	while( !IsListEmpty( &Connection->ListenRequest ) ) {
-	    PIO_STACK_LOCATION IrpSp;
-
-	    Entry = RemoveHeadList( &Connection->ListenRequest );
-	    Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
-	    Complete = Bucket->Request.RequestNotifyObject;
-
-	    Irp = Bucket->Request.RequestContext;
-	    IrpSp = IoGetCurrentIrpStackLocation( Irp );
-
-	    TI_DbgPrint(DEBUG_TCP,("Getting the socket\n"));
-	    Status = TCPServiceListeningSocket
-		( Connection->AddressFile->Listener,
-		  Bucket->AssociatedEndpoint,
-		  (PTDI_REQUEST_KERNEL)&IrpSp->Parameters );
-
-	    TI_DbgPrint(DEBUG_TCP,("Socket: Status: %x\n"));
-
-	    if( Status == STATUS_PENDING ) {
-		InsertHeadList( &Connection->ListenRequest, &Bucket->Entry );
-		break;
-	    } else {
-		Complete( Bucket->Request.RequestContext, Status, 0 );
-		exFreePool( Bucket );
-	    }
-	}
+		/* Handle readable on a listening socket --
+		 * TODO: Implement filtering
+		 */
+
+		TI_DbgPrint(DEBUG_TCP,("Accepting new connection on %x (Queue: %s)\n",
+							   Connection,
+							   IsListEmpty(&Connection->ListenRequest) ?
+							   "empty" : "nonempty"));
+
+		while( !IsListEmpty( &Connection->ListenRequest ) ) {
+			PIO_STACK_LOCATION IrpSp;
+
+			Entry = RemoveHeadList( &Connection->ListenRequest );
+			Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
+			Complete = Bucket->Request.RequestNotifyObject;
+
+			Irp = Bucket->Request.RequestContext;
+			IrpSp = IoGetCurrentIrpStackLocation( Irp );
+
+			TI_DbgPrint(DEBUG_TCP,("Getting the socket\n"));
+			Status = TCPServiceListeningSocket
+				( Connection->AddressFile->Listener,
+				  Bucket->AssociatedEndpoint,
+				  (PTDI_REQUEST_KERNEL)&IrpSp->Parameters );
+
+			TI_DbgPrint(DEBUG_TCP,("Socket: Status: %x\n"));
+
+			if( Status == STATUS_PENDING ) {
+				InsertHeadList( &Connection->ListenRequest, &Bucket->Entry );
+				break;
+			} else {
+				Complete( Bucket->Request.RequestContext, Status, 0 );
+				exFreePool( Bucket );
+			}
+		}
     }
 
     /* Things that happen after we're connected */
     if( NewState & SEL_READ ) {
-	TI_DbgPrint(DEBUG_TCP,("Readable: irp list %s\n",
-			       IsListEmpty(&Connection->ReceiveRequest) ?
-			       "empty" : "nonempty"));
-
-	while( !IsListEmpty( &Connection->ReceiveRequest ) ) {
-	    OSK_UINT RecvLen = 0, Received = 0;
-	    OSK_PCHAR RecvBuffer = 0;
-
-	    Entry = RemoveHeadList( &Connection->ReceiveRequest );
-	    Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
-	    Complete = Bucket->Request.RequestNotifyObject;
-
-	    Irp = Bucket->Request.RequestContext;
-	    Mdl = Irp->MdlAddress;
-
-	    TI_DbgPrint(DEBUG_TCP,
-			("Getting the user buffer from %x\n", Mdl));
-
-	    NdisQueryBuffer( Mdl, &RecvBuffer, &RecvLen );
-
-	    TI_DbgPrint(DEBUG_TCP,
-			("Reading %d bytes to %x\n", RecvLen, RecvBuffer));
-
-	    TI_DbgPrint(DEBUG_TCP, ("Connection: %x\n", Connection));
-	    TI_DbgPrint
-		(DEBUG_TCP,
-		 ("Connection->SocketContext: %x\n",
-		  Connection->SocketContext));
-	    TI_DbgPrint(DEBUG_TCP, ("RecvBuffer: %x\n", RecvBuffer));
-
-	    Status = TCPTranslateError
-		( OskitTCPRecv( Connection->SocketContext,
-				RecvBuffer,
-				RecvLen,
-				&Received,
-				0 ) );
-
-	    TI_DbgPrint(DEBUG_TCP,("TCP Bytes: %d\n", Received));
-
-	    if( Status == STATUS_SUCCESS ) {
-		TI_DbgPrint(DEBUG_TCP,("Received %d bytes with status %x\n",
-				       Received, Status));
-
-		Complete( Bucket->Request.RequestContext,
-			  STATUS_SUCCESS, Received );
-		exFreePool( Bucket );
-	    } else if( Status == STATUS_PENDING ) {
-		InsertHeadList
-		    ( &Connection->ReceiveRequest, &Bucket->Entry );
-		break;
-	    } else {
-		TI_DbgPrint(DEBUG_TCP,
-			    ("Completing Receive request: %x %x\n",
-			     Bucket->Request, Status));
-		Complete( Bucket->Request.RequestContext, Status, 0 );
-		exFreePool( Bucket );
-	    }
-	}
+		TI_DbgPrint(DEBUG_TCP,("Readable: irp list %s\n",
+							   IsListEmpty(&Connection->ReceiveRequest) ?
+							   "empty" : "nonempty"));
+
+		while( !IsListEmpty( &Connection->ReceiveRequest ) ) {
+			OSK_UINT RecvLen = 0, Received = 0;
+			OSK_PCHAR RecvBuffer = 0;
+
+			Entry = RemoveHeadList( &Connection->ReceiveRequest );
+			Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
+			Complete = Bucket->Request.RequestNotifyObject;
+
+			Irp = Bucket->Request.RequestContext;
+			Mdl = Irp->MdlAddress;
+
+			TI_DbgPrint(DEBUG_TCP,
+						("Getting the user buffer from %x\n", Mdl));
+
+			NdisQueryBuffer( Mdl, &RecvBuffer, &RecvLen );
+
+			TI_DbgPrint(DEBUG_TCP,
+						("Reading %d bytes to %x\n", RecvLen, RecvBuffer));
+
+			TI_DbgPrint(DEBUG_TCP, ("Connection: %x\n", Connection));
+			TI_DbgPrint
+				(DEBUG_TCP,
+				 ("Connection->SocketContext: %x\n",
+				  Connection->SocketContext));
+			TI_DbgPrint(DEBUG_TCP, ("RecvBuffer: %x\n", RecvBuffer));
+
+			Status = TCPTranslateError
+				( OskitTCPRecv( Connection->SocketContext,
+								RecvBuffer,
+								RecvLen,
+								&Received,
+								0 ) );
+
+			TI_DbgPrint(DEBUG_TCP,("TCP Bytes: %d\n", Received));
+
+			if( Status == STATUS_SUCCESS ) {
+				TI_DbgPrint(DEBUG_TCP,("Received %d bytes with status %x\n",
+									   Received, Status));
+
+				Complete( Bucket->Request.RequestContext,
+						  STATUS_SUCCESS, Received );
+				exFreePool( Bucket );
+			} else if( Status == STATUS_PENDING ) {
+				InsertHeadList
+					( &Connection->ReceiveRequest, &Bucket->Entry );
+				break;
+			} else {
+				TI_DbgPrint(DEBUG_TCP,
+							("Completing Receive request: %x %x\n",
+							 Bucket->Request, Status));
+				Complete( Bucket->Request.RequestContext, Status, 0 );
+				exFreePool( Bucket );
+			}
+		}
     }
     if( NewState & SEL_WRITE ) {
-	TI_DbgPrint(DEBUG_TCP,("Writeable: irp list %s\n",
-			       IsListEmpty(&Connection->ReceiveRequest) ?
-			       "empty" : "nonempty"));
-
-	while( !IsListEmpty( &Connection->SendRequest ) ) {
-	    OSK_UINT SendLen = 0, Sent = 0;
-	    OSK_PCHAR SendBuffer = 0;
-
-	    Entry = RemoveHeadList( &Connection->SendRequest );
-	    Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
-	    Complete = Bucket->Request.RequestNotifyObject;
-
-	    Irp = Bucket->Request.RequestContext;
-	    Mdl = Irp->MdlAddress;
-
-	    TI_DbgPrint(DEBUG_TCP,
-			("Getting the user buffer from %x\n", Mdl));
-
-	    NdisQueryBuffer( Mdl, &SendBuffer, &SendLen );
-
-	    TI_DbgPrint(DEBUG_TCP,
-			("Writing %d bytes to %x\n", SendLen, SendBuffer));
-
-	    TI_DbgPrint(DEBUG_TCP, ("Connection: %x\n", Connection));
-	    TI_DbgPrint
-		(DEBUG_TCP,
-		 ("Connection->SocketContext: %x\n",
-		  Connection->SocketContext));
-
-	    Status = TCPTranslateError
-		( OskitTCPSend( Connection->SocketContext,
-				SendBuffer,
-				SendLen,
-				&Sent,
-				0 ) );
-
-	    TI_DbgPrint(DEBUG_TCP,("TCP Bytes: %d\n", Sent));
-
-	    if( Status == STATUS_SUCCESS ) {
-		TI_DbgPrint(DEBUG_TCP,("Sent %d bytes with status %x\n",
-				       Sent, Status));
-
-		Complete( Bucket->Request.RequestContext,
-			  STATUS_SUCCESS, Sent );
-		exFreePool( Bucket );
-	    } else if( Status == STATUS_PENDING ) {
-		InsertHeadList
-		    ( &Connection->SendRequest, &Bucket->Entry );
-		break;
-	    } else {
-		TI_DbgPrint(DEBUG_TCP,
-			    ("Completing Send request: %x %x\n",
-			     Bucket->Request, Status));
-		Complete( Bucket->Request.RequestContext, Status, 0 );
-		exFreePool( Bucket );
-	    }
-	}
+		TI_DbgPrint(DEBUG_TCP,("Writeable: irp list %s\n",
+							   IsListEmpty(&Connection->ReceiveRequest) ?
+							   "empty" : "nonempty"));
+
+		while( !IsListEmpty( &Connection->SendRequest ) ) {
+			OSK_UINT SendLen = 0, Sent = 0;
+			OSK_PCHAR SendBuffer = 0;
+
+			Entry = RemoveHeadList( &Connection->SendRequest );
+			Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
+			Complete = Bucket->Request.RequestNotifyObject;
+
+			Irp = Bucket->Request.RequestContext;
+			Mdl = Irp->MdlAddress;
+
+			TI_DbgPrint(DEBUG_TCP,
+						("Getting the user buffer from %x\n", Mdl));
+
+			NdisQueryBuffer( Mdl, &SendBuffer, &SendLen );
+
+			TI_DbgPrint(DEBUG_TCP,
+						("Writing %d bytes to %x\n", SendLen, SendBuffer));
+
+			TI_DbgPrint(DEBUG_TCP, ("Connection: %x\n", Connection));
+			TI_DbgPrint
+				(DEBUG_TCP,
+				 ("Connection->SocketContext: %x\n",
+				  Connection->SocketContext));
+
+			Status = TCPTranslateError
+				( OskitTCPSend( Connection->SocketContext,
+								SendBuffer,
+								SendLen,
+								&Sent,
+								0 ) );
+
+			TI_DbgPrint(DEBUG_TCP,("TCP Bytes: %d\n", Sent));
+
+			if( Status == STATUS_SUCCESS ) {
+				TI_DbgPrint(DEBUG_TCP,("Sent %d bytes with status %x\n",
+									   Sent, Status));
+
+				Complete( Bucket->Request.RequestContext,
+						  STATUS_SUCCESS, Sent );
+				exFreePool( Bucket );
+			} else if( Status == STATUS_PENDING ) {
+				InsertHeadList
+					( &Connection->SendRequest, &Bucket->Entry );
+				break;
+			} else {
+				TI_DbgPrint(DEBUG_TCP,
+							("Completing Send request: %x %x\n",
+							 Bucket->Request, Status));
+				Complete( Bucket->Request.RequestContext, Status, 0 );
+				exFreePool( Bucket );
+			}
+		}
     }
 
     if( NewState & SEL_FIN ) {
@@ -221,7 +221,7 @@
         NTSTATUS    IrpStatus[4];
         UINT i;
 
-	TI_DbgPrint(DEBUG_TCP, ("EOF From socket\n"));
+		TI_DbgPrint(DEBUG_TCP, ("EOF From socket\n"));
 
         ListsToErase[0] = &Connection->ReceiveRequest;
         IrpStatus   [0] = STATUS_SUCCESS;
@@ -230,7 +230,7 @@
         ListsToErase[2] = &Connection->ConnectRequest;
         IrpStatus   [2] = STATUS_UNSUCCESSFUL;
         ListsToErase[3] = 0;
-	IrpStatus   [3] = 0;
+		IrpStatus   [3] = 0;
 
         for( i = 0; ListsToErase[i]; i++ ) {
             while( !IsListEmpty( ListsToErase[i] ) ) {
@@ -238,7 +238,7 @@
                 Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
                 Complete = Bucket->Request.RequestNotifyObject;
                 Complete( Bucket->Request.RequestContext, IrpStatus[i], 0 );
-		exFreePool( Bucket );
+				exFreePool( Bucket );
             }
         }
     }
@@ -251,18 +251,18 @@
     PLIST_ENTRY ListEntry;
 
     while( !IsListEmpty( &SignalledConnections ) ) {
-	ListEntry = RemoveHeadList( &SignalledConnections );
-	Connection = CONTAINING_RECORD( ListEntry, CONNECTION_ENDPOINT,
-					SignalList );
-	HandleSignalledConnection( Connection, Connection->SignalState );
+		ListEntry = RemoveHeadList( &SignalledConnections );
+		Connection = CONTAINING_RECORD( ListEntry, CONNECTION_ENDPOINT,
+										SignalList );
+		HandleSignalledConnection( Connection, Connection->SignalState );
     }
 }
 
 PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext ) {
     PCONNECTION_ENDPOINT Connection =
-	exAllocatePool(NonPagedPool, sizeof(CONNECTION_ENDPOINT));
+		exAllocatePool(NonPagedPool, sizeof(CONNECTION_ENDPOINT));
     if (!Connection)
-	return Connection;
+		return Connection;
 
     TI_DbgPrint(DEBUG_CPOINT, ("Connection point file object allocated at (0x%X).\n", Connection));
 
@@ -287,24 +287,24 @@
 }
 
 NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
-		    UINT Family, UINT Type, UINT Proto ) {
+					UINT Family, UINT Type, UINT Proto ) {
     NTSTATUS Status;
 
     TI_DbgPrint(DEBUG_TCP,("Called: Connection %x, Family %d, Type %d, "
-			   "Proto %d\n",
-			   Connection, Family, Type, Proto));
+						   "Proto %d\n",
+						   Connection, Family, Type, Proto));
 
     TcpipRecursiveMutexEnter( &TCPLock, TRUE );
     Status = TCPTranslateError( OskitTCPSocket( Connection,
-						&Connection->SocketContext,
-						Family,
-						Type,
-						Proto ) );
+												&Connection->SocketContext,
+												Family,
+												Type,
+												Proto ) );
 
     ASSERT_KM_POINTER(Connection->SocketContext);
 
     TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext %x\n",
-			   Connection->SocketContext));
+						   Connection->SocketContext));
 
     TcpipRecursiveMutexLeave( &TCPLock );
 
@@ -321,14 +321,14 @@
  */
 {
     TI_DbgPrint(DEBUG_TCP,("Sending packet %d (%d) to oskit\n",
-			   IPPacket->TotalSize,
-			   IPPacket->HeaderSize));
+						   IPPacket->TotalSize,
+						   IPPacket->HeaderSize));
 
     TcpipRecursiveMutexEnter( &TCPLock, TRUE );
 
     OskitTCPReceiveDatagram( IPPacket->Header,
-			     IPPacket->TotalSize,
-			     IPPacket->HeaderSize );
+							 IPPacket->TotalSize,
+							 IPPacket->HeaderSize );
 
     DrainSignals();
 
@@ -337,28 +337,28 @@
 
 /* event.c */
 int TCPSocketState( void *ClientData,
-		    void *WhichSocket,
-		    void *WhichConnection,
-		    OSK_UINT NewState );
+					void *WhichSocket,
+					void *WhichConnection,
+					OSK_UINT NewState );
 
 int TCPPacketSend( void *ClientData,
-		   OSK_PCHAR Data,
-		   OSK_UINT Len );
+				   OSK_PCHAR Data,
+				   OSK_UINT Len );
 
 POSK_IFADDR TCPFindInterface( void *ClientData,
-			      OSK_UINT AddrType,
-			      OSK_UINT FindType,
-			      OSK_SOCKADDR *ReqAddr );
+							  OSK_UINT AddrType,
+							  OSK_UINT FindType,
+							  OSK_SOCKADDR *ReqAddr );
 
 NTSTATUS TCPMemStartup( void );
 void *TCPMalloc( void *ClientData,
-		 OSK_UINT bytes, OSK_PCHAR file, OSK_UINT line );
+				 OSK_UINT bytes, OSK_PCHAR file, OSK_UINT line );
 void TCPFree( void *ClientData,
-	      void *data, OSK_PCHAR file, OSK_UINT line );
+			  void *data, OSK_PCHAR file, OSK_UINT line );
 void TCPMemShutdown( void );
 
 int TCPSleep( void *ClientData, void *token, int priority, char *msg,
-	      int tmio );
+			  int tmio );
 
 void TCPWakeup( void *ClientData, void *token );
 
@@ -449,13 +449,13 @@
     InitializeListHead( &SignalledConnections );
     Status = TCPMemStartup();
     if ( ! NT_SUCCESS(Status) ) {
-	return Status;
+		return Status;
     }
 
     Status = PortsStartup( &TCPPorts, 1, 0xfffe );
     if( !NT_SUCCESS(Status) ) {
-	TCPMemShutdown();
-	return Status;
+		TCPMemShutdown();
+		return Status;
     }
 
     RegisterOskitTCPEventHandlers( &EventHandlers );
@@ -465,13 +465,13 @@
     IPRegisterProtocol(IPPROTO_TCP, TCPReceive);
 
     ExInitializeNPagedLookasideList(
-	&TCPSegmentList,                /* Lookaside list */
-	NULL,                           /* Allocate routine */
-	NULL,                           /* Free routine */
-	0,                              /* Flags */
-	sizeof(TCP_SEGMENT),            /* Size of each entry */
-	TAG('T','C','P','S'),           /* Tag */
-	0);                             /* Depth */
+		&TCPSegmentList,                /* Lookaside list */
+		NULL,                           /* Allocate routine */
+		NULL,                           /* Free routine */
+		0,                              /* Flags */
+		sizeof(TCP_SEGMENT),            /* Size of each entry */
+		TAG('T','C','P','S'),           /* Tag */
+		0);                             /* Depth */
 
     StartTimer();
 
@@ -491,7 +491,7 @@
     LARGE_INTEGER WaitForThread;
 
     if (!TCPInitialized)
-	return STATUS_SUCCESS;
+		return STATUS_SUCCESS;
 
     WaitForThread.QuadPart = -2500000; /* 250 ms */
     KeSetEvent(&TimerLoopEvent, IO_NO_INCREMENT, FALSE);
@@ -557,9 +557,9 @@
     InsertHeadList( &Connection->ConnectRequest, &Bucket->Entry );
 
     Status = AddrBuildAddress
-	((PTRANSPORT_ADDRESS)ConnInfo->RemoteAddress,
-	 &RemoteAddress,
-	 &RemotePort);
+		((PTRANSPORT_ADDRESS)ConnInfo->RemoteAddress,
+		 &RemoteAddress,
+		 &RemotePort);
 
     TI_DbgPrint(DEBUG_TCP,
                 ("Connecting to address %x:%x\n",
@@ -567,9 +567,9 @@
                  RemotePort));
 
     if (!NT_SUCCESS(Status)) {
-	TI_DbgPrint(DEBUG_TCP, ("Could not AddrBuildAddress in TCPConnect\n"));
-	TcpipRecursiveMutexLeave( &TCPLock );
-	return Status;
+		TI_DbgPrint(DEBUG_TCP, ("Could not AddrBuildAddress in TCPConnect\n"));
+		TcpipRecursiveMutexLeave( &TCPLock );
+		return Status;
     }
 
     AddressToConnect.sin_family = AF_INET;
@@ -577,21 +577,21 @@
 
     Status = TCPTranslateError
         ( OskitTCPBind( Connection->SocketContext,
-		  Connection,
-		  &AddressToBind,
-		  sizeof(AddressToBind) ) );
+						Connection,
+						&AddressToBind,
+						sizeof(AddressToBind) ) );
 
     if (NT_SUCCESS(Status)) {
         memcpy( &AddressToConnect.sin_addr,
-	        &RemoteAddress.Address.IPv4Address,
-	        sizeof(AddressToConnect.sin_addr) );
+				&RemoteAddress.Address.IPv4Address,
+				sizeof(AddressToConnect.sin_addr) );
         AddressToConnect.sin_port = RemotePort;
 
         Status = TCPTranslateError
-	    ( OskitTCPConnect( Connection->SocketContext,
-		       	       Connection,
-			       &AddressToConnect,
-			       sizeof(AddressToConnect) ) );
+			( OskitTCPConnect( Connection->SocketContext,
+							   Connection,
+							   &AddressToConnect,
+							   sizeof(AddressToConnect) ) );
     }
 
     TcpipRecursiveMutexLeave( &TCPLock );
@@ -615,20 +615,20 @@
     switch( Flags & (TDI_DISCONNECT_ABORT | TDI_DISCONNECT_RELEASE) ) {
     case 0:
     case TDI_DISCONNECT_ABORT:
-	Flags = 0;
-	break;
+		Flags = 0;
+		break;
 
     case TDI_DISCONNECT_ABORT | TDI_DISCONNECT_RELEASE:
-	Flags = 2;
-	break;
+		Flags = 2;
+		break;
 
     case TDI_DISCONNECT_RELEASE:
-	Flags = 1;
-	break;
+		Flags = 1;
+		break;
     }
 
     Status = TCPTranslateError
-	( OskitTCPShutdown( Connection->SocketContext, Flags ) );
+		( OskitTCPShutdown( Connection->SocketContext, Flags ) );
 
     TcpipRecursiveMutexLeave( &TCPLock );
 
@@ -683,35 +683,35 @@
     TI_DbgPrint(DEBUG_TCP,("TCP>|< Got an MDL %x (%x:%d)\n", Buffer, DataBuffer, DataLen));
 
     Status = TCPTranslateError
-	( OskitTCPRecv
-	  ( Connection->SocketContext,
-	    DataBuffer,
-	    DataLen,
-	    &Received,
-	    ReceiveFlags ) );
+		( OskitTCPRecv
+		  ( Connection->SocketContext,
+			DataBuffer,
+			DataLen,
+			&Received,
+			ReceiveFlags ) );
 
     TI_DbgPrint(DEBUG_TCP,("OskitTCPReceive: %x, %d\n", Status, Received));
 
     /* Keep this request around ... there was no data yet */
     if( Status == STATUS_PENDING ) {
-	/* Freed in TCPSocketState */
-	Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
-	if( !Bucket ) {
-	    TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
-	    TcpipRecursiveMutexLeave( &TCPLock );
-	    return STATUS_NO_MEMORY;
-	}
-
-	Bucket->Request.RequestNotifyObject = Complete;
-	Bucket->Request.RequestContext = Context;
-	*BytesReceived = 0;
-
-	InsertHeadList( &Connection->ReceiveRequest, &Bucket->Entry );
-	Status = STATUS_PENDING;
-	TI_DbgPrint(DEBUG_TCP,("Queued read irp\n"));
+		/* Freed in TCPSocketState */
+		Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
+		if( !Bucket ) {
+			TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
+			TcpipRecursiveMutexLeave( &TCPLock );
+			return STATUS_NO_MEMORY;
+		}
+
+		Bucket->Request.RequestNotifyObject = Complete;
+		Bucket->Request.RequestContext = Context;
+		*BytesReceived = 0;
+
+		InsertHeadList( &Connection->ReceiveRequest, &Bucket->Entry );
+		Status = STATUS_PENDING;
+		TI_DbgPrint(DEBUG_TCP,("Queued read irp\n"));
     } else {
-	TI_DbgPrint(DEBUG_TCP,("Got status %x, bytes %d\n", Status, Received));
-	*BytesReceived = Received;
+		TI_DbgPrint(DEBUG_TCP,("Got status %x, bytes %d\n", Status, Received));
+		*BytesReceived = Received;
     }
 
     TcpipRecursiveMutexLeave( &TCPLock );
@@ -742,34 +742,34 @@
 
     TI_DbgPrint(DEBUG_TCP,("Connection = %x\n", Connection));
     TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext = %x\n",
-			   Connection->SocketContext));
+						   Connection->SocketContext));
 
     Status = TCPTranslateError
-	( OskitTCPSend( Connection->SocketContext,
-			(OSK_PCHAR)BufferData, SendLength,
-			&Sent, 0 ) );
+		( OskitTCPSend( Connection->SocketContext,
+						(OSK_PCHAR)BufferData, SendLength,
+						&Sent, 0 ) );
 
     TI_DbgPrint(DEBUG_TCP,("OskitTCPSend: %x, %d\n", Status, Sent));
 
     /* Keep this request around ... there was no data yet */
     if( Status == STATUS_PENDING ) {
-	/* Freed in TCPSocketState */
-	Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
-	if( !Bucket ) {
-	    TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
-	    TcpipRecursiveMutexLeave( &TCPLock );
-	    return STATUS_NO_MEMORY;
-	}
-
-	Bucket->Request.RequestNotifyObject = Complete;
-	Bucket->Request.RequestContext = Context;
-	*BytesSent = 0;
-
-	InsertHeadList( &Connection->SendRequest, &Bucket->Entry );
-	TI_DbgPrint(DEBUG_TCP,("Queued write irp\n"));
+		/* Freed in TCPSocketState */
+		Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
+		if( !Bucket ) {
+			TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
+			TcpipRecursiveMutexLeave( &TCPLock );
+			return STATUS_NO_MEMORY;
+		}
+
+		Bucket->Request.RequestNotifyObject = Complete;
+		Bucket->Request.RequestContext = Context;
+		*BytesSent = 0;
+
+		InsertHeadList( &Connection->SendRequest, &Bucket->Entry );
+		TI_DbgPrint(DEBUG_TCP,("Queued write irp\n"));
     } else {
-	TI_DbgPrint(DEBUG_TCP,("Got status %x, bytes %d\n", Status, Sent));
-	*BytesSent = Sent;
+		TI_DbgPrint(DEBUG_TCP,("Got status %x, bytes %d\n", Status, Sent));
+		*BytesSent = Sent;
     }
 
     TcpipRecursiveMutexLeave( &TCPLock );
@@ -785,8 +785,8 @@
 
 UINT TCPAllocatePort( UINT HintPort ) {
     if( HintPort ) {
-	if( AllocatePort( &TCPPorts, HintPort ) ) return HintPort;
-	else {
+		if( AllocatePort( &TCPPorts, HintPort ) ) return HintPort;
+		else {
             TI_DbgPrint
                 (MID_TRACE,("We got a hint port but couldn't allocate it\n"));
             return (UINT)-1;
@@ -838,17 +838,17 @@
     TcpipAcquireSpinLock( &Endpoint->Lock, &OldIrql );
 
     for( i = 0; i < 4; i++ ) {
-	for( Entry = ListHead[i]->Flink;
-	     Entry != ListHead[i];
-	     Entry = Entry->Flink ) {
-	    Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
-
-	    if( Bucket->Request.RequestContext == Irp ) {
-		RemoveEntryList( &Bucket->Entry );
-		exFreePool( Bucket );
-		break;
-	    }
-	}
+		for( Entry = ListHead[i]->Flink;
+			 Entry != ListHead[i];
+			 Entry = Entry->Flink ) {
+			Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
+
+			if( Bucket->Request.RequestContext == Irp ) {
+				RemoveEntryList( &Bucket->Entry );
+				exFreePool( Bucket );
+				break;
+			}
+		}
     }
 
     TcpipReleaseSpinLock( &Endpoint->Lock, OldIrql );



More information about the Ros-diffs mailing list