Author: cgutman
Date: Sat Jan 3 23:33:43 2009
New Revision: 38545
URL:
http://svn.reactos.org/svn/reactos?rev=38545&view=rev
Log:
- Merge the rest of my changes
Removed:
trunk/reactos/drivers/network/tcpip/tcpip/pool.c
Modified:
trunk/reactos/drivers/network/tcpip/datalink/lan.c
trunk/reactos/drivers/network/tcpip/include/memtrack.h
trunk/reactos/drivers/network/tcpip/include/pool.h
trunk/reactos/drivers/network/tcpip/tcpip.rbuild
trunk/reactos/drivers/network/tcpip/tcpip/buffer.c
trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c
trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c
trunk/reactos/drivers/network/tcpip/tcpip/main.c
trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c
trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c
trunk/reactos/lib/drivers/ip/network/address.c
trunk/reactos/lib/drivers/ip/network/ip.c
trunk/reactos/lib/drivers/ip/network/loopback.c
trunk/reactos/lib/drivers/ip/network/memtrack.c
trunk/reactos/lib/drivers/ip/network/neighbor.c
trunk/reactos/lib/drivers/ip/network/ports.c
trunk/reactos/lib/drivers/ip/network/receive.c
trunk/reactos/lib/drivers/ip/network/router.c
trunk/reactos/lib/drivers/ip/network/transmit.c
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
trunk/reactos/lib/drivers/oskittcp/include/memtrack.h
Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/data…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -703,7 +703,7 @@
UnicodeString.MaximumLength = Information->DataLength;
String->Buffer =
- (PWCHAR)exAllocatePool( NonPagedPool,
+ (PWCHAR)ExAllocatePool( NonPagedPool,
UnicodeString.MaximumLength + sizeof(WCHAR) );
if( !String->Buffer ) return STATUS_NO_MEMORY;
Modified: trunk/reactos/drivers/network/tcpip/include/memtrack.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/memtrack.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/memtrack.h [iso-8859-1] Sat Jan 3
23:33:43 2009
@@ -10,18 +10,18 @@
#define FBSD_MALLOC FOURCC('d','s','b','f')
#define EXALLOC_TAG FOURCC('E','x','A','l')
#define IRP_TAG FOURCC('P','I','R','P')
+#define NPLOOK_TAG FOURCC('N','P','L','A')
#define AllocatePacketWithBuffer(x,y,z)
AllocatePacketWithBufferX(x,y,z,__FILE__,__LINE__)
#define FreeNdisPacket(x) FreeNdisPacketX(x,__FILE__,__LINE__)
-#ifdef MEMTRACK
+#ifdef DBG
#define MTMARK() TrackDumpFL(__FILE__, __LINE__)
#define exAllocatePool(x,y) ExAllocatePoolX(x,y,__FILE__,__LINE__)
#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolX(x,y,__FILE__,__LINE__)
#define exFreePool(x) ExFreePoolX(x,__FILE__,__LINE__)
-
-extern LIST_ENTRY AllocatedObjectsHead;
-extern KSPIN_LOCK AllocatedObjectsLock;
+#define exAllocateFromNPagedLookasideList(x)
ExAllocateFromNPagedLookasideListX(x,__FILE__,__LINE__)
+#define exFreeToNPagedLookasideList(x,y)
ExFreeToNPagedLookasideListX(x,y,__FILE__,__LINE__)
typedef struct _ALLOCATION_TRACKER {
LIST_ENTRY Entry;
@@ -34,20 +34,32 @@
VOID TrackingInit();
VOID TrackWithTag( DWORD Tag, PVOID Thing, PCHAR File, DWORD Line );
#define Track(Tag,Thing) TrackWithTag(Tag,Thing,__FILE__,__LINE__)
-VOID UntrackFL( PCHAR File, DWORD Line, PVOID Thing );
+VOID UntrackFL( PCHAR File, DWORD Line, PVOID Thing, DWORD Tag );
#define Untrack(Thing) UntrackFL(__FILE__,__LINE__,Thing)
VOID TrackDumpFL( PCHAR File, DWORD Line );
#define TrackDump() TrackDumpFL(__FILE__,__LINE__)
VOID TrackTag( DWORD Tag );
+static __inline PVOID ExAllocateFromNPagedLookasideListX( PNPAGED_LOOKASIDE_LIST List,
PCHAR File, ULONG Line ) {
+ PVOID Out = ExAllocateFromNPagedLookasideList( List );
+ if( Out ) TrackWithTag( NPLOOK_TAG, Out, File, Line );
+ return Out;
+}
+
+static __inline VOID ExFreeToNPagedLookasideListX( PNPAGED_LOOKASIDE_LIST List, PVOID
Thing, PCHAR File, ULONG Line ) {
+ UntrackFL(File, Line, Thing, NPLOOK_TAG);
+ ExFreeToNPagedLookasideList( List, Thing );
+}
+
static __inline PVOID ExAllocatePoolX( POOL_TYPE type, SIZE_T size, PCHAR File, ULONG
Line ) {
- PVOID Out = PoolAllocateBuffer( size );
+ PVOID Out = ExAllocatePool( type, size );
if( Out ) TrackWithTag( EXALLOC_TAG, Out, File, Line );
return Out;
}
+
static __inline VOID ExFreePoolX( PVOID Data, PCHAR File, ULONG Line ) {
- UntrackFL(File, Line, Data);
- PoolFreeBuffer(Data);
+ UntrackFL(File, Line, Data, EXALLOC_TAG);
+ ExFreePool( Data );
}
#define MEMTRACK_MAX_TAGS_TO_TRACK 64
@@ -59,11 +71,12 @@
#define Untrack(x)
#define TrackTag(x)
#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolWithTag(x,y,z)
-#define exAllocatePool(x,y) PoolAllocateBuffer(y)
-#define exFreePool(x) PoolFreeBuffer(x)
+#define exAllocatePool(x,y) ExAllocatePool(x,y)
+#define exFreePool(x) ExFreePool(x)
+#define exAllocateFromNPagedLookasideList(x) ExAllocateFromNPagedLookasideList(x)
#define exFreeToNPagedLookasideList(x,y) ExFreeToNPagedLookasideList(x,y)
#define TrackWithTag(w,x,y,z)
-#define UntrackFL(x,y,z)
+#define UntrackFL(w,x,y,z)
#endif
#endif/*MEMMTRAC_H*/
Modified: trunk/reactos/drivers/network/tcpip/include/pool.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/pool.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/pool.h [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -7,16 +7,6 @@
#ifndef __POOL_H
#define __POOL_H
-
-PVOID PoolAllocateBuffer(
- ULONG Size);
-
-VOID PoolFreeBuffer(
- PVOID Buffer);
-
-PVOID TcpipAllocateFromNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List );
-VOID TcpipFreeToNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List,
- PVOID Thing );
NDIS_STATUS PrependPacket( PNDIS_PACKET Packet, PCHAR Data, UINT Len,
BOOLEAN Copy );
Modified: trunk/reactos/drivers/network/tcpip/tcpip.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -35,7 +35,6 @@
<file>lock.c</file>
<file>main.c</file>
<file>ninfo.c</file>
- <file>pool.c</file>
<file>proto.c</file>
<file>tinfo.c</file>
<file>wait.c</file>
Modified: trunk/reactos/drivers/network/tcpip/tcpip/buffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -318,7 +318,7 @@
PCHAR NewBuf;
if( Copy ) {
- NewBuf = ExAllocatePool( NonPagedPool, Length );
+ NewBuf = exAllocatePool( NonPagedPool, Length );
if( !NewBuf ) return NDIS_STATUS_RESOURCES;
RtlCopyMemory( NewBuf, Data, Length );
} else NewBuf = Data;
@@ -350,25 +350,22 @@
NDIS_STATUS Status;
PCHAR NewData;
- NewData = ExAllocatePool( NonPagedPool, Len );
+ NewData = exAllocatePool( NonPagedPool, Len );
if( !NewData ) return NDIS_STATUS_RESOURCES;
- TrackWithTag(EXALLOC_TAG, NewData, File, Line);
if( Data ) RtlCopyMemory(NewData, Data, Len);
NdisAllocatePacket( &Status, &Packet, GlobalPacketPool );
if( Status != NDIS_STATUS_SUCCESS ) {
- UntrackFL( File, Line, NewData );
- ExFreePool( NewData );
+ exFreePool( NewData );
return Status;
}
TrackWithTag(NDIS_PACKET_TAG, Packet, File, Line);
NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len );
if( Status != NDIS_STATUS_SUCCESS ) {
- UntrackFL( File, Line, NewData );
- ExFreePool( NewData );
- UntrackFL( File, Line, Packet );
+ exFreePool( NewData );
+ UntrackFL( File, Line, Packet, NDIS_PACKET_TAG );
FreeNdisPacket( Packet );
return Status;
}
@@ -404,14 +401,13 @@
NdisGetNextBuffer(Buffer, &NextBuffer);
NdisQueryBuffer(Buffer, &Data, &Length);
TI_DbgPrint(DEBUG_PBUFFER, ("Freeing ndis buffer (0x%X)\n", Buffer));
- UntrackFL(File,Line,Buffer);
+ UntrackFL(File,Line,Buffer,NDIS_BUFFER_TAG);
NdisFreeBuffer(Buffer);
TI_DbgPrint(DEBUG_PBUFFER, ("Freeing exal buffer (0x%X)\n", Data));
- UntrackFL(File,Line,Data);
- ExFreePool(Data);
+ exFreePool(Data);
}
/* Finally free the NDIS packet discriptor */
- UntrackFL(File,Line,Packet);
+ UntrackFL(File,Line,Packet,NDIS_PACKET_TAG);
NdisFreePacket(Packet);
}
Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -1281,7 +1281,7 @@
QueryContext->Irp->IoStatus.Information = ByteCount;
QueryContext->Irp->IoStatus.Status = Status;
- ExFreePool(QueryContext);
+ exFreePool(QueryContext);
}
@@ -1344,7 +1344,7 @@
IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
OutputBuffer = Irp->UserBuffer;
- QueryContext = ExAllocatePool(NonPagedPool, sizeof(TI_QUERY_CONTEXT));
+ QueryContext = exAllocatePool(NonPagedPool, sizeof(TI_QUERY_CONTEXT));
if (QueryContext) {
_SEH2_TRY {
InputMdl = IoAllocateMdl(InputBuffer,
@@ -1407,7 +1407,7 @@
IoFreeMdl(OutputMdl);
}
- ExFreePool(QueryContext);
+ exFreePool(QueryContext);
} else
Status = STATUS_INSUFFICIENT_RESOURCES;
} else if( InputBufferLength ==
@@ -1420,7 +1420,7 @@
Size = 0;
- QueryContext = ExAllocatePool(NonPagedPool, sizeof(TI_QUERY_CONTEXT));
+ QueryContext = exAllocatePool(NonPagedPool, sizeof(TI_QUERY_CONTEXT));
if (!QueryContext) return STATUS_INSUFFICIENT_RESOURCES;
_SEH2_TRY {
@@ -1440,7 +1440,7 @@
if( !NT_SUCCESS(Status) || !InputMdl ) {
if( InputMdl ) IoFreeMdl( InputMdl );
- ExFreePool(QueryContext);
+ exFreePool(QueryContext);
return 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] Sat Jan 3 23:33:43
2009
@@ -123,7 +123,7 @@
* Object = Pointer to address file object to free
*/
{
- ExFreePool(Object);
+ exFreePool(Object);
}
@@ -135,7 +135,7 @@
* Object = Pointer to address file object to free
*/
{
- ExFreePool(Object);
+ exFreePool(Object);
}
@@ -190,7 +190,7 @@
/* Abort the request and free its resources */
TcpipReleaseSpinLock(&AddrFile->Lock, OldIrql);
(*SendRequest->Complete)(SendRequest->Context, STATUS_ADDRESS_CLOSED, 0);
- ExFreePool(SendRequest);
+ exFreePool(SendRequest);
TcpipAcquireSpinLock(&AddrFile->Lock, &OldIrql);
CurrentEntry = NextEntry;
}
@@ -247,7 +247,7 @@
TI_DbgPrint(MID_TRACE, ("Called (Proto %d).\n", Protocol));
- AddrFile = ExAllocatePool(NonPagedPool, sizeof(ADDRESS_FILE));
+ AddrFile = exAllocatePool(NonPagedPool, sizeof(ADDRESS_FILE));
if (!AddrFile) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return STATUS_INSUFFICIENT_RESOURCES;
@@ -272,7 +272,7 @@
Matched = AddrLocateADEv4(IPv4Address, &AddrFile->Address);
if (!Matched) {
- ExFreePool(AddrFile);
+ exFreePool(AddrFile);
TI_DbgPrint(MIN_TRACE, ("Non-local address given (0x%X).\n",
DN2H(IPv4Address)));
return STATUS_INVALID_PARAMETER;
}
@@ -290,7 +290,7 @@
AddrFile->Port != Address->Address[0].Address[0].sin_port) ||
AddrFile->Port == 0xffff)
{
- ExFreePool(AddrFile);
+ exFreePool(AddrFile);
return STATUS_INVALID_PARAMETER;
}
@@ -306,7 +306,7 @@
AddrFile->Port != Address->Address[0].Address[0].sin_port) ||
AddrFile->Port == 0xffff)
{
- ExFreePool(AddrFile);
+ exFreePool(AddrFile);
return STATUS_INVALID_PARAMETER;
}
@@ -389,7 +389,7 @@
TCPFreePort( AddrFile->Port );
if( AddrFile->Listener ) {
TCPClose( AddrFile->Listener );
- ExFreePool( AddrFile->Listener );
+ exFreePool( AddrFile->Listener );
}
break;
@@ -518,7 +518,7 @@
PCONTROL_CHANNEL ControlChannel;
TI_DbgPrint(MID_TRACE, ("Called.\n"));
- ControlChannel = ExAllocatePool(NonPagedPool, sizeof(*ControlChannel));
+ ControlChannel = exAllocatePool(NonPagedPool, sizeof(*ControlChannel));
if (!ControlChannel) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
@@ -558,7 +558,7 @@
PCONTROL_CHANNEL ControlChannel = Request->Handle.ControlChannel;
NTSTATUS Status = STATUS_SUCCESS;
- ExFreePool(ControlChannel);
+ exFreePool(ControlChannel);
Request->Handle.ControlChannel = NULL;
return Status;
Modified: trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -26,7 +26,7 @@
Interface, IF, ID->tei_entity, ID->tei_instance));
OutData =
- (PIFENTRY)ExAllocatePool( NonPagedPool,
+ (PIFENTRY)exAllocatePool( NonPagedPool,
sizeof(IFENTRY) + MAX_IFDESCR_LEN );
if( !OutData ) return TDI_NO_RESOURCES; /* Out of memory */
@@ -71,7 +71,7 @@
ID->tei_entity, ID->tei_instance, Size));
Status = InfoCopyOut( (PCHAR)OutData, Size, Buffer, BufferSize );
- ExFreePool( OutData );
+ exFreePool( OutData );
TI_DbgPrint(DEBUG_INFO,("Returning %x\n", Status));
@@ -86,7 +86,7 @@
ULONG NumNeighbors = NBCopyNeighbors( Interface, NULL );
ULONG MemSize = NumNeighbors * sizeof(IPARP_ENTRY);
PIPARP_ENTRY ArpEntries =
- ExAllocatePoolWithTag
+ exAllocatePoolWithTag
( NonPagedPool, MemSize, FOURCC('A','R','P','t') );
if( !ArpEntries ) return STATUS_NO_MEMORY;
@@ -94,7 +94,7 @@
Status = InfoCopyOut( (PVOID)ArpEntries, MemSize, Buffer, BufferSize );
- ExFreePool( ArpEntries );
+ exFreePool( ArpEntries );
return Status;
}
Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -131,7 +131,7 @@
#endif
CP
/* Allocate resources here. We release them again if something failed */
- Context = ExAllocatePool(NonPagedPool, sizeof(TRANSPORT_CONTEXT));
+ Context = exAllocatePool(NonPagedPool, sizeof(TRANSPORT_CONTEXT));
if (!Context) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return STATUS_INSUFFICIENT_RESOURCES;
@@ -169,7 +169,7 @@
TI_DbgPrint(MIN_TRACE, ("AddressType: %\n",
Address->Address[0].AddressType));
}
- PoolFreeBuffer(Context);
+ exFreePool(Context);
return STATUS_INVALID_PARAMETER;
}
CP
@@ -186,12 +186,12 @@
Status = TiGetProtocolNumber(&IrpSp->FileObject->FileName,
&Protocol);
if (!NT_SUCCESS(Status)) {
TI_DbgPrint(MIN_TRACE, ("Raw IP protocol number is invalid.\n"));
- PoolFreeBuffer(Context);
+ exFreePool(Context);
return STATUS_INVALID_PARAMETER;
}
} else {
TI_DbgPrint(MIN_TRACE, ("Invalid device object at (0x%X).\n",
DeviceObject));
- PoolFreeBuffer(Context);
+ exFreePool(Context);
return STATUS_INVALID_PARAMETER;
}
CP
@@ -213,7 +213,7 @@
if (EaInfo->EaValueLength < sizeof(PVOID)) {
TI_DbgPrint(MIN_TRACE, ("Parameters are invalid.\n"));
- PoolFreeBuffer(Context);
+ exFreePool(Context);
return STATUS_INVALID_PARAMETER;
}
@@ -221,7 +221,7 @@
if (DeviceObject != TCPDeviceObject) {
TI_DbgPrint(MIN_TRACE, ("Bad device object.\n"));
- PoolFreeBuffer(Context);
+ exFreePool(Context);
return STATUS_INVALID_PARAMETER;
}
@@ -244,7 +244,7 @@
}
if (!NT_SUCCESS(Status))
- PoolFreeBuffer(Context);
+ exFreePool(Context);
TI_DbgPrint(DEBUG_IRP, ("Leaving. Status = (0x%X).\n", Status));
@@ -353,7 +353,7 @@
case IRP_MJ_CLOSE:
Context = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext;
if (Context)
- PoolFreeBuffer(Context);
+ exFreePool(Context);
Status = STATUS_SUCCESS;
break;
@@ -608,7 +608,7 @@
IoDeleteDevice(IPDeviceObject);
if (EntityList)
- PoolFreeBuffer(EntityList);
+ exFreePool(EntityList);
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
}
@@ -714,7 +714,7 @@
/* Setup network layer and transport layer entities */
KeInitializeSpinLock(&EntityListLock);
- EntityList = ExAllocatePool(NonPagedPool, sizeof(TDIEntityID) * MAX_TDI_ENTITIES );
+ EntityList = exAllocatePool(NonPagedPool, sizeof(TDIEntityID) * MAX_TDI_ENTITIES );
if (!EntityList) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
ChewShutdown();
@@ -746,7 +746,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -758,7 +758,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
NdisFreePacketPool(GlobalPacketPool);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -787,7 +787,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
NdisFreePacketPool(GlobalPacketPool);
NdisFreeBufferPool(GlobalBufferPool);
return Status;
@@ -802,7 +802,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
NdisFreePacketPool(GlobalPacketPool);
NdisFreeBufferPool(GlobalBufferPool);
return Status;
@@ -818,7 +818,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
NdisFreePacketPool(GlobalPacketPool);
NdisFreeBufferPool(GlobalBufferPool);
return Status;
@@ -846,7 +846,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
NdisFreePacketPool(GlobalPacketPool);
NdisFreeBufferPool(GlobalBufferPool);
return Status;
@@ -865,7 +865,7 @@
IoDeleteDevice(RawIPDeviceObject);
IoDeleteDevice(UDPDeviceObject);
IoDeleteDevice(TCPDeviceObject);
- ExFreePool(EntityList);
+ exFreePool(EntityList);
NdisFreePacketPool(GlobalPacketPool);
NdisFreeBufferPool(GlobalBufferPool);
LANUnregisterProtocol();
Modified: trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] Sat Jan 3
23:33:43 2009
@@ -430,7 +430,7 @@
NDIS_STATUS Status;
PCHAR NewData;
- NewData = ExAllocatePool( NonPagedPool, Len );
+ NewData = exAllocatePool( NonPagedPool, Len );
if( !NewData ) return NDIS_STATUS_NOT_ACCEPTED; // XXX
TrackWithTag(EXALLOC_TAG, NewData, File, Line);
@@ -439,14 +439,14 @@
NdisAllocatePacket( &Status, &Packet, GlobalPacketPool );
if( Status != NDIS_STATUS_SUCCESS ) {
- ExFreePool( NewData );
+ exFreePool( NewData );
return Status;
}
TrackWithTag(NDIS_PACKET_TAG, Packet, File, Line);
NdisAllocateBuffer( &Status, &Buffer, GlobalBufferPool, NewData, Len );
if( Status != NDIS_STATUS_SUCCESS ) {
- ExFreePool( NewData );
+ exFreePool( NewData );
FreeNdisPacket( Packet );
}
TrackWithTag(NDIS_BUFFER_TAG, Buffer, File, Line);
@@ -482,8 +482,7 @@
XNdisQueryBuffer(Buffer, &Data, &Length);
UntrackFL(File,Line,Buffer);
NdisFreeBuffer(Buffer);
- UntrackFL(File,Line,Data);
- ExFreePool(Data);
+ exFreePool(Data);
}
/* Finally free the NDIS packet discriptor */
Modified: trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -21,7 +21,7 @@
UINT Count = 0;
UINT IfCount = CountInterfaces();
PIPADDR_ENTRY IpAddress =
- ExAllocatePool( NonPagedPool, sizeof( IPADDR_ENTRY ) * IfCount );
+ exAllocatePool( NonPagedPool, sizeof( IPADDR_ENTRY ) * IfCount );
PIPADDR_ENTRY IpCurrent = IpAddress;
IF_LIST_ITER(CurrentIF);
@@ -58,7 +58,7 @@
Status = InfoCopyOut( (PCHAR)IpAddress, sizeof(*IpAddress) * IfCount,
Buffer, BufferSize );
- ExFreePool( IpAddress );
+ exFreePool( IpAddress );
TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
@@ -72,17 +72,17 @@
UINT RtCount = CountFIBs();
UINT Size = sizeof( IPROUTE_ENTRY ) * RtCount;
PFIB_ENTRY RCache =
- ExAllocatePool( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount ),
+ exAllocatePool( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount ),
RCacheCur = RCache;
- PIPROUTE_ENTRY RouteEntries = ExAllocatePool( NonPagedPool, Size ),
+ PIPROUTE_ENTRY RouteEntries = exAllocatePool( NonPagedPool, Size ),
RtCurrent = RouteEntries;
TI_DbgPrint(DEBUG_INFO, ("Called, routes = %d, RCache = %08x\n",
RtCount, RCache));
if( !RCache || !RouteEntries ) {
- if( RCache ) ExFreePool( RCache );
- if( RouteEntries ) ExFreePool( RouteEntries );
+ if( RCache ) exFreePool( RCache );
+ if( RouteEntries ) exFreePool( RouteEntries );
return TDI_NO_RESOURCES;
}
@@ -133,8 +133,8 @@
Status = InfoCopyOut( (PCHAR)RouteEntries, Size, Buffer, BufferSize );
- ExFreePool( RouteEntries );
- ExFreePool( RCache );
+ exFreePool( RouteEntries );
+ exFreePool( RCache );
TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
Removed: trunk/reactos/drivers/network/tcpip/tcpip/pool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/pool.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/pool.c (removed)
@@ -1,68 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS TCP/IP protocol driver
- * FILE: tcpip/pool.c
- * PURPOSE: Routines for controling pools
- * PROGRAMMERS: Casper S. Hornstrup (chorns(a)users.sourceforge.net)
- * REVISIONS:
- * CSH 01/08-2000 Created
- */
-
-#include "precomp.h"
-
-
-PVOID PoolAllocateBuffer(
- ULONG Size)
-/*
- * FUNCTION: Returns a buffer from the free buffer pool
- * RETURNS:
- * Pointer to buffer, NULL if there was not enough
- * free resources
- */
-{
- PVOID Buffer;
-
- /* FIXME: Get buffer from a free buffer pool with enough room */
-
- Buffer = ExAllocatePool(NonPagedPool, Size);
-
- TI_DbgPrint(DEBUG_MEMORY, ("Allocated (%i) bytes at (0x%X).\n", Size,
Buffer));
-
- return Buffer;
-}
-
-
-VOID PoolFreeBuffer(
- PVOID Buffer)
-/*
- * FUNCTION: Returns a buffer to the free buffer pool
- * ARGUMENTS:
- * Buffer = Buffer to return to free buffer pool
- */
-{
- /* FIXME: Put buffer in free buffer pool */
-
- TI_DbgPrint(DEBUG_MEMORY, ("Freeing buffer at (0x%X).\n", Buffer));
-
- ExFreePool(Buffer);
-}
-
-PVOID TcpipAllocateFromNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List ) {
- PVOID Buffer;
-
- Buffer = ExAllocateFromNPagedLookasideList( List );
-
- TI_DbgPrint(DEBUG_MEMORY, ("Allocated from Nonpaged Lookaside List at
(0x%X).\n", Buffer));
-
- return Buffer;
-}
-
-VOID TcpipFreeToNPagedLookasideList( PNPAGED_LOOKASIDE_LIST List,
- PVOID Thing ) {
-
- TI_DbgPrint(DEBUG_MEMORY, ("Freeing buffer (0x%X) to Nonpaged Lookaside
List.\n", Thing));
-
- ExFreeToNPagedLookasideList( List, Thing );
-}
-
-/* EOF */
Modified: trunk/reactos/lib/drivers/ip/network/address.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/add…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/address.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/address.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -106,7 +106,7 @@
* Nothing
*/
{
- PoolFreeBuffer(Object);
+ exFreePool(Object);
}
Modified: trunk/reactos/lib/drivers/ip/network/ip.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/ip.…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/ip.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/ip.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -33,7 +33,7 @@
* Object = Pointer to an IP packet structure
*/
{
- TcpipFreeToNPagedLookasideList(&IPPacketList, Object);
+ exFreeToNPagedLookasideList(&IPPacketList, Object);
}
@@ -70,7 +70,7 @@
{
PIP_PACKET IPPacket;
- IPPacket = TcpipAllocateFromNPagedLookasideList(&IPPacketList);
+ IPPacket = exAllocateFromNPagedLookasideList(&IPPacketList);
if (!IPPacket)
return NULL;
Modified: trunk/reactos/lib/drivers/ip/network/loopback.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/loo…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/loopback.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/loopback.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -45,7 +45,7 @@
Adapter = WorkItem->Adapter;
BytesTransferred = WorkItem->BytesTransferred;
- ExFreePool( WorkItem );
+ exFreePool( WorkItem );
IPPacket.NdisPacket = Packet;
@@ -88,7 +88,7 @@
TcpipAcquireSpinLock( &LoopWorkLock, &OldIrql );
- WQItem = ExAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) );
+ WQItem = exAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) );
if( !WQItem ) {
TcpipReleaseSpinLock( &LoopWorkLock, OldIrql );
return;
Modified: trunk/reactos/lib/drivers/ip/network/memtrack.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/mem…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -1,8 +1,8 @@
#define MEMTRACK_NO_POOL
#include "precomp.h"
-#ifdef MEMTRACK
+#ifdef DBG
#define TRACK_TAG TAG('T','r','C','K')
static LIST_ENTRY AllocatedObjectsList;
@@ -29,12 +29,24 @@
0 );
}
-VOID ShowTrackedThing( PCHAR What, PALLOCATION_TRACKER Thing,
- PCHAR File, UINT Line ) {
- /* if( ShowTag( Thing->Tag ) ) */
- if( File ) {
+VOID ShowTrackedThing( PCHAR What, PALLOCATION_TRACKER Thing, BOOLEAN ForceShow ) {
+
+ if (ForceShow)
+ {
+ DbgPrint("[%s] Thing %08x %c%c%c%c (%s:%d)\n",
+ What,
+ Thing->Thing,
+ ((PCHAR)&Thing->Tag)[3],
+ ((PCHAR)&Thing->Tag)[2],
+ ((PCHAR)&Thing->Tag)[1],
+ ((PCHAR)&Thing->Tag)[0],
+ Thing->FileName,
+ Thing->LineNo);
+ }
+ else
+ {
TI_DbgPrint(MAX_TRACE,
- ("[%s] Thing %08x %c%c%c%c (%s:%d) (Called from %s:%d)\n",
+ ("[%s] Thing %08x %c%c%c%c (%s:%d)\n",
What,
Thing->Thing,
((PCHAR)&Thing->Tag)[3],
@@ -42,19 +54,7 @@
((PCHAR)&Thing->Tag)[1],
((PCHAR)&Thing->Tag)[0],
Thing->FileName,
- Thing->LineNo,
- File, Line));
- } else {
- TI_DbgPrint(MAX_TRACE,
- ( "[%s] Thing %08x %c%c%c%c (%s:%d)\n",
- What,
- Thing->Thing,
- ((PCHAR)&Thing->Tag)[3],
- ((PCHAR)&Thing->Tag)[2],
- ((PCHAR)&Thing->Tag)[1],
- ((PCHAR)&Thing->Tag)[0],
- Thing->FileName,
- Thing->LineNo ));
+ Thing->LineNo));
}
}
@@ -66,6 +66,15 @@
PLIST_ENTRY Entry;
PALLOCATION_TRACKER ThingInList;
+ if (!TrackedThing) return;
+
+ TrackedThing->Tag = Tag;
+ TrackedThing->Thing = Thing;
+ TrackedThing->FileName = FileName;
+ TrackedThing->LineNo = LineNo;
+
+ ShowTrackedThing( "Alloc", TrackedThing, FALSE );
+
TcpipAcquireSpinLock( &AllocatedObjectsLock, &OldIrql );
Entry = AllocatedObjectsList.Flink;
while( Entry != &AllocatedObjectsList ) {
@@ -74,25 +83,21 @@
RemoveEntryList(Entry);
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
- ShowTrackedThing( "Alloc", ThingInList, FileName, LineNo );
- PoolFreeBuffer( ThingInList );
+ ShowTrackedThing( "Alloc", ThingInList, FALSE );
+
TrackDumpFL( FileName, LineNo );
DbgPrint("TRACK: SPECIFIED ALREADY ALLOCATED ITEM %x\n", Thing);
+ ShowTrackedThing( "Double Alloc (Item in list)", ThingInList, TRUE
);
+ ShowTrackedThing( "Double Alloc (Item not in list)", TrackedThing,
TRUE );
TcpipBugCheck( 0 );
+
+ ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList,
+ ThingInList );
}
Entry = Entry->Flink;
}
- if( TrackedThing ) {
- TrackedThing->Tag = Tag;
- TrackedThing->Thing = Thing;
- TrackedThing->FileName = FileName;
- TrackedThing->LineNo = LineNo;
-
-
- InsertHeadList( &AllocatedObjectsList, &TrackedThing->Entry );
- ShowTrackedThing( "Alloc", TrackedThing, FileName, LineNo );
- }
+ InsertHeadList( &AllocatedObjectsList, &TrackedThing->Entry );
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
@@ -107,7 +112,7 @@
return TagsToShow[i] ? TRUE : FALSE;
}
-VOID UntrackFL( PCHAR File, DWORD Line, PVOID Thing ) {
+VOID UntrackFL( PCHAR File, DWORD Line, PVOID Thing, DWORD Tag ) {
KIRQL OldIrql;
PLIST_ENTRY Entry;
PALLOCATION_TRACKER ThingInList;
@@ -119,19 +124,25 @@
if( ThingInList->Thing == Thing ) {
RemoveEntryList(Entry);
- ShowTrackedThing( "Free ", ThingInList, File, Line );
+ ShowTrackedThing( "Free ", ThingInList, FALSE );
+
+ if ( ThingInList->Tag != Tag ) {
+ DbgPrint("UNTRACK: TAG DOES NOT MATCH (%x)\n", Thing);
+ ShowTrackedThing("Tag Mismatch (Item in list)", ThingInList,
TRUE);
+ TcpipBugCheck( 0 );
+ }
ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList,
ThingInList );
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
+
/* TrackDumpFL( File, Line ); */
return;
}
Entry = Entry->Flink;
}
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
- TrackDumpFL( File, Line );
DbgPrint("UNTRACK: SPECIFIED ALREADY FREE ITEM %x\n", Thing);
TcpipBugCheck( 0 );
}
@@ -147,10 +158,10 @@
Entry = AllocatedObjectsList.Flink;
while( Entry != &AllocatedObjectsList ) {
Thing = CONTAINING_RECORD(Entry, ALLOCATION_TRACKER, Entry);
- ShowTrackedThing( "Dump ", Thing, 0, 0 );
+ ShowTrackedThing( "Dump ", Thing, FALSE );
Entry = Entry->Flink;
}
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
}
-#endif/*MEMTRACK*/
+#endif /* DBG */
Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -21,7 +21,7 @@
ASSERT_KM_POINTER(Packet->Complete);
Packet->Complete( Packet->Context, Packet->Packet, Status );
TI_DbgPrint(MID_TRACE, ("Completed\n"));
- PoolFreeBuffer( Packet );
+ exFreePool( Packet );
TI_DbgPrint(MID_TRACE, ("Freed\n"));
}
@@ -89,7 +89,7 @@
ErrorCode );
}
- PoolFreeBuffer( Packet );
+ exFreePool( Packet );
}
}
@@ -283,7 +283,7 @@
"LinkAddress (0x%X) LinkAddressLength (%d) State (0x%X)\n",
Interface, Address, LinkAddress, LinkAddressLength, State));
- NCE = ExAllocatePool
+ NCE = exAllocatePool
(NonPagedPool, sizeof(NEIGHBOR_CACHE_ENTRY) + LinkAddressLength);
if (NCE == NULL)
{
@@ -466,7 +466,7 @@
(DEBUG_NCACHE,
("Called. NCE (0x%X) NdisPacket (0x%X).\n", NCE, NdisPacket));
- Packet = PoolAllocateBuffer( sizeof(NEIGHBOR_PACKET) );
+ Packet = exAllocatePool( NonPagedPool, sizeof(NEIGHBOR_PACKET) );
if( !Packet ) return FALSE;
/* FIXME: Should we limit the number of queued packets? */
@@ -529,7 +529,7 @@
*PrevNCE = CurNCE->Next;
NBFlushPacketQueue( CurNCE, TRUE, NDIS_STATUS_REQUEST_ABORTED );
- ExFreePool(CurNCE);
+ exFreePool(CurNCE);
break;
}
Modified: trunk/reactos/lib/drivers/ip/network/ports.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/por…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/ports.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/ports.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -17,7 +17,7 @@
PortSet->PortsToOversee = PortsToManage;
PortSet->ProtoBitBuffer =
- PoolAllocateBuffer( (PortSet->PortsToOversee + 7) / 8 );
+ exAllocatePool( NonPagedPool, (PortSet->PortsToOversee + 7) / 8 );
if(!PortSet->ProtoBitBuffer) return STATUS_INSUFFICIENT_RESOURCES;
RtlInitializeBitMap( &PortSet->ProtoBitmap,
PortSet->ProtoBitBuffer,
@@ -28,7 +28,7 @@
}
VOID PortsShutdown( PPORT_SET PortSet ) {
- PoolFreeBuffer( PortSet->ProtoBitBuffer );
+ exFreePool( PortSet->ProtoBitBuffer );
}
VOID DeallocatePort( PPORT_SET PortSet, ULONG Port ) {
Modified: trunk/reactos/lib/drivers/ip/network/receive.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/rec…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/receive.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/receive.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -41,7 +41,7 @@
TI_DbgPrint(DEBUG_IP, ("Called. First (%d) Last (%d).\n", First, Last));
- Hole = TcpipAllocateFromNPagedLookasideList(&IPHoleList);
+ Hole = exAllocateFromNPagedLookasideList(&IPHoleList);
if (!Hole) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return NULL;
@@ -82,7 +82,7 @@
TI_DbgPrint(DEBUG_IP, ("Freeing hole descriptor at (0x%X).\n", CurrentH));
/* And free the hole descriptor */
- TcpipFreeToNPagedLookasideList(&IPHoleList, CurrentH);
+ exFreeToNPagedLookasideList(&IPHoleList, CurrentH);
CurrentEntry = NextEntry;
}
@@ -103,13 +103,13 @@
TI_DbgPrint(DEBUG_IP, ("Freeing fragment at (0x%X).\n", CurrentF));
/* And free the fragment descriptor */
- TcpipFreeToNPagedLookasideList(&IPFragmentList, CurrentF);
+ exFreeToNPagedLookasideList(&IPFragmentList, CurrentF);
CurrentEntry = NextEntry;
}
TI_DbgPrint(DEBUG_IP, ("Freeing IPDR data at (0x%X).\n", IPDR));
- TcpipFreeToNPagedLookasideList(&IPDRList, IPDR);
+ exFreeToNPagedLookasideList(&IPDRList, IPDR);
}
@@ -308,7 +308,7 @@
TI_DbgPrint(DEBUG_IP, ("Starting new assembly.\n"));
/* We don't have a reassembly structure, create one */
- IPDR = TcpipAllocateFromNPagedLookasideList(&IPDRList);
+ IPDR = exAllocateFromNPagedLookasideList(&IPDRList);
if (!IPDR)
/* We don't have the resources to process this packet, discard it */
return;
@@ -319,7 +319,7 @@
Hole = CreateHoleDescriptor(0, 65536);
if (!Hole) {
/* We don't have the resources to process this packet, discard it */
- TcpipFreeToNPagedLookasideList(&IPDRList, IPDR);
+ exFreeToNPagedLookasideList(&IPDRList, IPDR);
return;
}
AddrInitIPv4(&IPDR->SrcAddr, IPv4Header->SrcAddr);
@@ -388,7 +388,7 @@
/* Put the new hole descriptor in the list */
InsertTailList(&IPDR->HoleListHead, &Hole->ListEntry);
} else
- TcpipFreeToNPagedLookasideList(&IPHoleList, Hole);
+ exFreeToNPagedLookasideList(&IPHoleList, Hole);
/* If this is the first fragment, save the IP header */
if (FragFirst == 0) {
@@ -402,7 +402,7 @@
/* Create a buffer, copy the data into it and put it
in the fragment list */
- Fragment = TcpipAllocateFromNPagedLookasideList(&IPFragmentList);
+ Fragment = exAllocateFromNPagedLookasideList(&IPFragmentList);
if (!Fragment) {
/* We don't have the resources to process this packet, discard it */
Cleanup(&IPDR->Lock, OldIrql, IPDR);
Modified: trunk/reactos/lib/drivers/ip/network/router.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/rou…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/router.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/router.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -51,7 +51,7 @@
* Object = Pointer to an forward information base structure
*/
{
- PoolFreeBuffer(Object);
+ exFreePool(Object);
}
@@ -213,7 +213,7 @@
A2S(Netmask),
A2S(&Router->Address)));
- FIBE = PoolAllocateBuffer(sizeof(FIB_ENTRY));
+ FIBE = exAllocatePool(NonPagedPool, sizeof(FIB_ENTRY));
if (!FIBE) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return NULL;
Modified: trunk/reactos/lib/drivers/ip/network/transmit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/tra…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/transmit.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/transmit.c [iso-8859-1] Sat Jan 3 23:33:43 2009
@@ -212,14 +212,14 @@
if (!PrepareNextFragment(IFC)) {
FreeNdisPacket(IFC->NdisPacket);
- ExFreePool(IFC);
+ exFreePool(IFC);
return NDIS_STATUS_FAILURE;
}
if (!NT_SUCCESS((NdisStatus = IPSendFragment(IFC->NdisPacket, NCE, IFC))))
{
FreeNdisPacket(IFC->NdisPacket);
- ExFreePool(IFC);
+ exFreePool(IFC);
}
return NdisStatus;
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] Sat Jan 3 23:33:43
2009
@@ -115,7 +115,7 @@
if( Bucket->AssociatedEndpoint == Connection ) {
RemoveEntryList( &Bucket->Entry );
- ExFreePool( Bucket );
+ exFreePool( Bucket );
break;
}
@@ -142,7 +142,7 @@
(PTDI_REQUEST_KERNEL)Request );
if( Status == STATUS_PENDING ) {
- Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
+ Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
if( Bucket ) {
Bucket->AssociatedEndpoint = Connection;
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] Sat Jan 3 23:33:43
2009
@@ -119,7 +119,7 @@
("Called TSLEEP: tok = %x, pri = %d, wmesg = %s, tmio = %x\n",
token, priority, msg, tmio));
- SleepingThread = PoolAllocateBuffer( sizeof( *SleepingThread ) );
+ SleepingThread = exAllocatePool( NonPagedPool, sizeof( *SleepingThread ) );
if( SleepingThread ) {
KeInitializeEvent( &SleepingThread->Event, NotificationEvent, FALSE );
SleepingThread->SleepToken = token;
@@ -146,7 +146,7 @@
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
- PoolFreeBuffer( SleepingThread );
+ exFreePool( SleepingThread );
} else
return OSK_ENOBUFS;
@@ -238,22 +238,22 @@
if ( ! Found ) {
if ( ArrayAllocated <= ArrayUsed ) {
NewSize = ( 0 == ArrayAllocated ? 16 : 2 * ArrayAllocated );
- NewArray = PoolAllocateBuffer( 2 * NewSize * sizeof( OSK_UINT ) );
+ NewArray = exAllocatePool( NonPagedPool, 2 * NewSize * sizeof( OSK_UINT ) );
if ( NULL != NewArray ) {
if ( 0 != ArrayAllocated ) {
memcpy( NewArray, Sizes,
ArrayAllocated * sizeof( OSK_UINT ) );
- PoolFreeBuffer( Sizes );
+ exFreePool( Sizes );
memcpy( NewArray + NewSize, Counts,
ArrayAllocated * sizeof( OSK_UINT ) );
- PoolFreeBuffer( Counts );
+ exFreePool( Counts );
}
Sizes = NewArray;
Counts = NewArray + NewSize;
ArrayAllocated = NewSize;
} else if ( 0 != ArrayAllocated ) {
- PoolFreeBuffer( Sizes );
- PoolFreeBuffer( Counts );
+ exFreePool( Sizes );
+ exFreePool( Counts );
ArrayAllocated = 0;
}
}
@@ -281,7 +281,7 @@
v = ExAllocateFromNPagedLookasideList( &LargeLookasideList );
Signature = SIGNATURE_LARGE;
} else {
- v = PoolAllocateBuffer( Bytes + sizeof(ULONG) );
+ v = ExAllocatePool( NonPagedPool, Bytes + sizeof(ULONG) );
Signature = SIGNATURE_OTHER;
}
if( v ) {
@@ -297,7 +297,7 @@
void *data, OSK_PCHAR File, OSK_UINT Line ) {
ULONG Signature;
- UntrackFL( (PCHAR)File, Line, data );
+ UntrackFL( (PCHAR)File, Line, data,
FOURCC('f','b','s','d') );
data = (void *)((char *) data - sizeof(ULONG));
Signature = *((ULONG *) data);
if ( SIGNATURE_SMALL == Signature ) {
@@ -305,7 +305,7 @@
} else if ( SIGNATURE_LARGE == Signature ) {
ExFreeToNPagedLookasideList( &LargeLookasideList, data );
} else if ( SIGNATURE_OTHER == Signature ) {
- PoolFreeBuffer( data );
+ ExFreePool( data );
} else {
ASSERT( FALSE );
}
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] Sat Jan 3 23:33:43
2009
@@ -53,7 +53,7 @@
Complete( Bucket->Request.RequestContext, Status, 0 );
/* Frees the bucket allocated in TCPConnect */
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
}
}
@@ -90,7 +90,7 @@
break;
} else {
Complete( Bucket->Request.RequestContext, Status, 0 );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
}
}
}
@@ -142,7 +142,7 @@
Complete( Bucket->Request.RequestContext,
STATUS_SUCCESS, Received );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
} else if( Status == STATUS_PENDING ) {
InsertHeadList
( &Connection->ReceiveRequest, &Bucket->Entry );
@@ -152,7 +152,7 @@
("Completing Receive request: %x %x\n",
Bucket->Request, Status));
Complete( Bucket->Request.RequestContext, Status, 0 );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
}
}
}
@@ -201,7 +201,7 @@
Complete( Bucket->Request.RequestContext,
STATUS_SUCCESS, Sent );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
} else if( Status == STATUS_PENDING ) {
InsertHeadList
( &Connection->SendRequest, &Bucket->Entry );
@@ -211,7 +211,7 @@
("Completing Send request: %x %x\n",
Bucket->Request, Status));
Complete( Bucket->Request.RequestContext, Status, 0 );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
}
}
}
@@ -238,7 +238,7 @@
Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
Complete = Bucket->Request.RequestNotifyObject;
Complete( Bucket->Request.RequestContext, IrpStatus[i], 0 );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
}
}
}
@@ -260,7 +260,7 @@
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext ) {
PCONNECTION_ENDPOINT Connection =
- ExAllocatePool(NonPagedPool, sizeof(CONNECTION_ENDPOINT));
+ exAllocatePool(NonPagedPool, sizeof(CONNECTION_ENDPOINT));
if (!Connection)
return Connection;
@@ -283,7 +283,7 @@
VOID TCPFreeConnectionEndpoint( PCONNECTION_ENDPOINT Connection ) {
TCPClose( Connection );
- ExFreePool( Connection );
+ exFreePool( Connection );
}
NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
@@ -545,7 +545,7 @@
TI_DbgPrint(DEBUG_TCP,("TCPConnect: Called\n"));
- Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
+ Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
if( !Bucket ) return STATUS_NO_MEMORY;
TcpipRecursiveMutexEnter( &TCPLock, TRUE );
@@ -695,7 +695,7 @@
/* Keep this request around ... there was no data yet */
if( Status == STATUS_PENDING ) {
/* Freed in TCPSocketState */
- Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
+ Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
if( !Bucket ) {
TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
TcpipRecursiveMutexLeave( &TCPLock );
@@ -754,7 +754,7 @@
/* Keep this request around ... there was no data yet */
if( Status == STATUS_PENDING ) {
/* Freed in TCPSocketState */
- Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) );
+ Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
if( !Bucket ) {
TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
TcpipRecursiveMutexLeave( &TCPLock );
@@ -845,7 +845,7 @@
if( Bucket->Request.RequestContext == Irp ) {
RemoveEntryList( &Bucket->Entry );
- PoolFreeBuffer( Bucket );
+ exFreePool( Bucket );
break;
}
}
Modified: trunk/reactos/lib/drivers/oskittcp/include/memtrack.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/inclu…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/include/memtrack.h [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/oskittcp/include/memtrack.h [iso-8859-1] Sat Jan 3 23:33:43
2009
@@ -8,7 +8,7 @@
#define FBSD_MALLOC FOURCC('d','s','b','f')
#define EXALLOC_TAG FOURCC('E','x','A','l')
-#ifdef MEMTRACK
+#ifdef DBG
#define MTMARK() TrackDumpFL(__FILE__, __LINE__)
#define NdisAllocateBuffer(x,y,z,a,b) { \
NdisAllocateBuffer(x,y,z,a,b); \
@@ -71,8 +71,10 @@
#define exFreePool(x) ExFreePool(x)
#define exAllocatePool(x,y) ExAllocatePool(x,y)
#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolWithTag(x,y,z)
-#define TrackWithTag(a,b,c,d)
-#define UntrackFL(a,b,c)
+#define exAllocateFromNPagedLookasideList(x) ExAllocateFromNPagedLookasideList(x)
+#define exFreeToNPagedLookasideList(x,y) ExFreeToNPagedLookasideList(x,y)
+#define TrackWithTag(w,x,y,z)
+#define UntrackFL(w,x,y,z)
#endif
#endif/*MEMMTRAC_H*/