[AFD] Introduce and use pool tags. Thanks go to Arty for assisting me with this....
[reactos.git] / drivers / network / afd / afd / tdiconn.c
index 12454b9..afa9f0f 100644 (file)
@@ -85,7 +85,9 @@ PTRANSPORT_ADDRESS TaCopyTransportAddress( PTRANSPORT_ADDRESS OtherAddress ) {
     if (!AddrLen)
         return NULL;
 
-    A = ExAllocatePool( NonPagedPool, AddrLen );
+    A = ExAllocatePoolWithTag(NonPagedPool,
+                              AddrLen,
+                              TAG_AFD_TRANSPORT_ADDRESS);
 
     if( A )
         TaCopyTransportAddressInPlace( A, OtherAddress );
@@ -117,13 +119,13 @@ PTRANSPORT_ADDRESS TaBuildNullTransportAddress(UINT AddressType)
     if (!AddrLen)
         return NULL;
 
-    A = ExAllocatePool(NonPagedPool, AddrLen);
+    A = ExAllocatePoolWithTag(NonPagedPool, AddrLen, TAG_AFD_TRANSPORT_ADDRESS);
 
     if (A)
     {
         if (TdiBuildNullTransportAddressInPlace(A, AddressType) != STATUS_SUCCESS)
         {
-            ExFreePool(A);
+            ExFreePoolWithTag(A, TAG_AFD_TRANSPORT_ADDRESS);
             return NULL;
         }
     }
@@ -190,9 +192,9 @@ NTSTATUS TdiBuildNullConnectionInfo
     }
 
     ConnInfo = (PTDI_CONNECTION_INFORMATION)
-        ExAllocatePool(NonPagedPool,
-                       sizeof(TDI_CONNECTION_INFORMATION) +
-                       TdiAddressSize);
+        ExAllocatePoolWithTag(NonPagedPool,
+                              sizeof(TDI_CONNECTION_INFORMATION) + TdiAddressSize,
+                              TAG_AFD_TDI_CONNECTION_INFORMATION);
     if (!ConnInfo) {
         *ConnectionInfo = NULL;
         return STATUS_INSUFFICIENT_RESOURCES;
@@ -202,7 +204,7 @@ NTSTATUS TdiBuildNullConnectionInfo
 
     if (!NT_SUCCESS(Status))
     {
-        ExFreePool( ConnInfo );
+        ExFreePoolWithTag(ConnInfo, TAG_AFD_TDI_CONNECTION_INFORMATION);
         ConnInfo = NULL;
     }