Author: cgutman
Date: Mon Aug 8 21:28:50 2011
New Revision: 53143
URL:
http://svn.reactos.org/svn/reactos?rev=53143&view=rev
Log:
[IP]
- Merge r53134 and r53135 from the GSoC TCP/IP branch
Modified:
trunk/reactos/lib/drivers/ip/transport/tcp/accept.c
trunk/reactos/lib/drivers/ip/transport/tcp/event.c
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/accept.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] Mon Aug 8 21:28:50
2011
@@ -11,6 +11,8 @@
#include "precomp.h"
#include "rosip.h"
+
+extern NPAGED_LOOKASIDE_LIST TdiBucketLookasideList;
NTSTATUS TCPCheckPeerForAccept(PVOID Context,
PTDI_REQUEST_KERNEL Request)
@@ -118,7 +120,7 @@
{
DereferenceObject(Bucket->AssociatedEndpoint);
RemoveEntryList( &Bucket->Entry );
- ExFreePoolWithTag( Bucket, TDI_BUCKET_TAG );
+ ExFreeToNPagedLookasideList(&TdiBucketLookasideList, Bucket);
Found = TRUE;
break;
}
@@ -143,9 +145,7 @@
LockObject(Listener, &OldIrql);
- Bucket = (PTDI_BUCKET)ExAllocatePoolWithTag(NonPagedPool,
- sizeof(*Bucket),
- TDI_BUCKET_TAG );
+ Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
if (Bucket)
{
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Mon Aug 8 21:28:50
2011
@@ -30,6 +30,8 @@
"TIME_WAIT"
};
+extern NPAGED_LOOKASIDE_LIST TdiBucketLookasideList;
+
static
VOID
BucketCompletionWorker(PVOID Context)
@@ -43,7 +45,7 @@
DereferenceObject(Bucket->AssociatedEndpoint);
- ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG);
+ ExFreeToNPagedLookasideList(&TdiBucketLookasideList, Bucket);
}
VOID
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] Mon Aug 8 21:28:50
2011
@@ -23,6 +23,8 @@
#include "rosip.h"
+NPAGED_LOOKASIDE_LIST TdiBucketLookasideList;
+
VOID NTAPI
DisconnectTimeoutDpc(PKDPC Dpc,
PVOID DeferredContext,
@@ -85,8 +87,8 @@
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext )
{
PCONNECTION_ENDPOINT Connection = (PCONNECTION_ENDPOINT)
- ExAllocatePoolWithTag(NonPagedPool, sizeof(CONNECTION_ENDPOINT),
- CONN_ENDPT_TAG);
+ ExAllocatePoolWithTag(NonPagedPool, sizeof(CONNECTION_ENDPOINT),
CONN_ENDPT_TAG);
+
if (!Connection)
return Connection;
@@ -196,6 +198,14 @@
{
return Status;
}
+
+ ExInitializeNPagedLookasideList(&TdiBucketLookasideList,
+ NULL,
+ NULL,
+ 0,
+ sizeof(TDI_BUCKET),
+ TDI_BUCKET_TAG,
+ 0);
/* Initialize our IP library */
LibIPInitialize();
@@ -218,6 +228,8 @@
{
if (!TCPInitialized)
return STATUS_SUCCESS;
+
+ ExDeleteNPagedLookasideList(&TdiBucketLookasideList);
LibIPShutdown();
@@ -348,7 +360,7 @@
{
connaddr.addr = RemoteAddress.Address.IPv4Address;
- Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG
);
+ Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
if (!Bucket)
{
UnlockObject(Connection, OldIrql);
@@ -418,13 +430,13 @@
}
/* We couldn't complete the request now because we need to wait for
outstanding I/O */
- Bucket = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Bucket),
TDI_BUCKET_TAG);
+ Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
if (!Bucket)
{
UnlockObject(Connection, OldIrql);
return STATUS_NO_MEMORY;
}
-
+
Bucket->Request.RequestNotifyObject = (PVOID)Complete;
Bucket->Request.RequestContext = Context;
@@ -485,7 +497,7 @@
if (Status == STATUS_PENDING)
{
- Bucket = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG);
+ Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
if (!Bucket)
{
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Failed to allocate
bucket\n"));
@@ -544,7 +556,7 @@
if (Status == STATUS_PENDING)
{
/* Freed in TCPSocketState */
- Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
+ Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
if (!Bucket)
{
UnlockObject(Connection, OldIrql);
@@ -659,7 +671,7 @@
if( Bucket->Request.RequestContext == Irp )
{
RemoveEntryList( &Bucket->Entry );
- ExFreePoolWithTag( Bucket, TDI_BUCKET_TAG );
+ ExFreeToNPagedLookasideList(&TdiBucketLookasideList, Bucket);
Found = TRUE;
break;
}