[AFD] Introduce and use pool tags. Thanks go to Arty for assisting me with this....
[reactos.git] / drivers / network / afd / afd / context.c
index ce2d9e1..6a72a1c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/context.c
@@ -7,6 +7,7 @@
  * UPDATE HISTORY:
  * 20040708 Created
  */
+
 #include "afd.h"
 
 NTSTATUS NTAPI
@@ -17,6 +18,8 @@ AfdGetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp,
     PAFD_FCB FCB = FileObject->FsContext;
     UINT ContextSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength;
 
+    UNREFERENCED_PARAMETER(DeviceObject);
+
     if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
 
     if( FCB->ContextSize < ContextSize ) ContextSize = FCB->ContextSize;
@@ -40,6 +43,8 @@ AfdGetContextSize( PDEVICE_OBJECT DeviceObject, PIRP Irp,
     PFILE_OBJECT FileObject = IrpSp->FileObject;
     PAFD_FCB FCB = FileObject->FsContext;
 
+    UNREFERENCED_PARAMETER(DeviceObject);
+
     if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
 
     if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
@@ -62,18 +67,21 @@ AfdSetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp,
     PAFD_FCB FCB = FileObject->FsContext;
     PVOID Context = LockRequest(Irp, IrpSp, FALSE, NULL);
 
+    UNREFERENCED_PARAMETER(DeviceObject);
+
     if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
 
     if (!Context)
         return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0);
 
     if( FCB->Context ) {
-        ExFreePool( FCB->Context );
+        ExFreePoolWithTag(FCB->Context, TAG_AFD_SOCKET_CONTEXT);
         FCB->ContextSize = 0;
     }
 
-    FCB->Context = ExAllocatePool( PagedPool,
-                                   IrpSp->Parameters.DeviceIoControl.InputBufferLength );
+    FCB->Context = ExAllocatePoolWithTag(PagedPool,
+                                         IrpSp->Parameters.DeviceIoControl.InputBufferLength,
+                                         TAG_AFD_SOCKET_CONTEXT);
 
     if( !FCB->Context ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 );