[FORMATTING]
Backup copy and formatting.

svn path=/branches/GSoC_2011/TcpIpDriver/; revision=52381
This commit is contained in:
Claudiu Mihail 2011-06-20 12:59:27 +00:00
parent c2770feda9
commit 4b7e0f11d0
16 changed files with 527 additions and 441 deletions

View file

@ -81,11 +81,11 @@ NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
LockObject(Connection, &OldIrql);
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSocket] Called: Connection %x, Family %d, Type %d, "
"Proto %d\n",
Connection, Family, Type, Proto));
DbgPrint("[IP, TCPSocket] Called: Connection %x, Family %d, Type %d, "
"Proto %d\n",
Connection, Family, Type, Proto);
"Proto %d, sizeof(CONNECTION_ENDPOINT) = %d\n",
Connection, Family, Type, Proto, sizeof(CONNECTION_ENDPOINT)));
DbgPrint("[IP, TCPSocket] Called: Connection 0x%x, Family %d, Type %d, "
"Proto %d, sizeof(CONNECTION_ENDPOINT) = %d\n",
Connection, Family, Type, Proto, sizeof(CONNECTION_ENDPOINT));
Connection->SocketContext = LibTCPSocket(Connection);
if (Connection->SocketContext)
@ -93,6 +93,8 @@ NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
else
Status = STATUS_INSUFFICIENT_RESOURCES;
DbgPrint("[IP, TCPSocket] Connection->SocketContext = 0x%x\n", Connection->SocketContext);
UnlockObject(Connection, OldIrql);
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSocket] Leaving. Status = 0x%x\n", Status));
@ -101,6 +103,37 @@ NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
return Status;
}
NTSTATUS TCPClose
( PCONNECTION_ENDPOINT Connection )
{
KIRQL OldIrql;
PVOID Socket;
LockObject(Connection, &OldIrql);
Socket = Connection->SocketContext;
Connection->SocketContext = NULL;
DbgPrint("[IP, TCPClose] Called\n");
/* We should not be associated to an address file at this point */
ASSERT(!Connection->AddressFile);
/* Don't try to close again if the other side closed us already */
if (Socket)
{
FlushAllQueues(Connection, STATUS_CANCELLED);
LibTCPClose(Socket);
}
UnlockObject(Connection, OldIrql);
DereferenceObject(Connection);
DbgPrint("[IP, TCPClose] Leaving. Connection->RefCount = %d\n", Connection->RefCount);
return STATUS_SUCCESS;
}
VOID TCPReceive(PIP_INTERFACE Interface, PIP_PACKET IPPacket)
/*
* FUNCTION: Receives and queues TCP data
@ -333,34 +366,6 @@ NTSTATUS TCPDisconnect
return Status;
}
NTSTATUS TCPClose
( PCONNECTION_ENDPOINT Connection )
{
KIRQL OldIrql;
PVOID Socket;
LockObject(Connection, &OldIrql);
Socket = Connection->SocketContext;
Connection->SocketContext = NULL;
/* We should not be associated to an address file at this point */
ASSERT(!Connection->AddressFile);
/* Don't try to close again if the other side closed us already */
if (Socket)
{
FlushAllQueues(Connection, STATUS_CANCELLED);
LibTCPClose(Socket);
}
UnlockObject(Connection, OldIrql);
DereferenceObject(Connection);
return STATUS_SUCCESS;
}
NTSTATUS TCPReceiveData
( PCONNECTION_ENDPOINT Connection,
PNDIS_BUFFER Buffer,