[ros-diffs] [cgutman] 38297: Huge memtrack commit (part 1 of 2) - Add checking for proper tags - Enable memtrack by default - Display the conflicting entries when an error occurs - Remove pool* routines and replace with ex* routines

cgutman at svn.reactos.org cgutman at svn.reactos.org
Tue Dec 23 13:39:56 CET 2008


Author: cgutman
Date: Tue Dec 23 06:39:55 2008
New Revision: 38297

URL: http://svn.reactos.org/svn/reactos?rev=38297&view=rev
Log:
Huge memtrack commit (part 1 of 2)
 - Add checking for proper tags
 - Enable memtrack by default
 - Display the conflicting entries when an error occurs
 - Remove pool* routines and replace with ex* routines

Removed:
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c
Modified:
    branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c
    branches/aicom-network-fixes/drivers/network/tcpip/include/memtrack.h
    branches/aicom-network-fixes/drivers/network/tcpip/include/pool.h
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip.rbuild
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/buffer.c
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/iinfo.c
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/mockbuffer.c
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/ninfo.c

Modified: branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/include/memtrack.h
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/include/memtrack.h?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/include/memtrack.h [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/include/memtrack.h [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -10,15 +10,17 @@
 #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
 #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__)
+#define exAllocateFromNPagedLookasideList(x) ExAllocateFromNPagedLookasideListX(x,__FILE__,__LINE__)
+#define exFreeToNPagedLookasideList(x,y) ExFreeToNPagedLookasideListX(x,y,__FILE__,__LINE__)
 
 typedef struct _ALLOCATION_TRACKER {
     LIST_ENTRY Entry;
@@ -31,35 +33,34 @@
 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
-#else
-#define MTMARK()
-#define Track(x,y)
-#define TrackingInit()
-#define TrackDump()
-#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 TrackWithTag(w,x,y,z)
-#define UntrackFL(x,y,z)
-#endif
 
 #endif/*MEMMTRAC_H*/

Modified: branches/aicom-network-fixes/drivers/network/tcpip/include/pool.h
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/include/pool.h?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/include/pool.h [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/include/pool.h [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip.rbuild?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -33,7 +33,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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/buffer.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/buffer.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/buffer.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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) {
 	    _SEH_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;
 
 	_SEH_TRY {
@@ -1440,7 +1440,7 @@
 
 	if( !NT_SUCCESS(Status) || !InputMdl ) {
 	    if( InputMdl ) IoFreeMdl( InputMdl );
-	    ExFreePool(QueryContext);
+	    exFreePool(QueryContext);
 	    return Status;
 	}
 

Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/iinfo.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/iinfo.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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 @@
     DWORD NumNeighbors = NBCopyNeighbors( Interface, NULL );
     DWORD 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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/mockbuffer.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/mockbuffer.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/mockbuffer.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/ninfo.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/ninfo.c?rev=38297&r1=38296&r2=38297&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] Tue Dec 23 06:39:55 2008
@@ -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: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c?rev=38296&view=auto
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/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 at 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 */



More information about the Ros-diffs mailing list