}
/* The allocated address goes in index 0 */
- Irp->Tail.Overlay.DriverContext[0] = ExAllocatePool(NonPagedPool, MmGetMdlByteCount(Irp->MdlAddress));
+ Irp->Tail.Overlay.DriverContext[0] = ExAllocatePoolWithTag(NonPagedPool,
+ MmGetMdlByteCount(Irp->MdlAddress),
+ TAG_AFD_DATA_BUFFER);
+
if (!Irp->Tail.Overlay.DriverContext[0])
{
AFD_DbgPrint(MIN_TRACE,("Failed to allocate memory\n"));
}
/* We need to create the info struct that AFD expects for all send/recv requests */
- AfdInfo = ExAllocatePool(NonPagedPool, sizeof(AFD_RECV_INFO) + sizeof(AFD_WSABUF));
+ AfdInfo = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(AFD_RECV_INFO) + sizeof(AFD_WSABUF),
+ TAG_AFD_DATA_BUFFER);
+
if (!AfdInfo)
{
AFD_DbgPrint(MIN_TRACE,("Failed to allocate memory\n"));
MmGetMdlByteCount(Irp->MdlAddress));
}
- ExFreePool(Irp->Tail.Overlay.DriverContext[0]);
+ ExFreePoolWithTag(Irp->Tail.Overlay.DriverContext[0], TAG_AFD_DATA_BUFFER);
MmUnlockPages( Irp->MdlAddress );
IoFreeMdl( Irp->MdlAddress );
Irp->MdlAddress = NULL;
/* Copy the buffer array so we don't lose it */
UINT Lock = LockAddress ? 2 : 0;
UINT Size = (sizeof(AFD_WSABUF) + sizeof(AFD_MAPBUF)) * (Count + Lock);
- PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size );
+ PAFD_WSABUF NewBuf = ExAllocatePoolWithTag(PagedPool, Size, TAG_AFD_WSA_BUFFER);
BOOLEAN LockFailed = FALSE;
PAFD_MAPBUF MapBuf;
AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info "
"from userland (%p %p)\n",
Buf, AddressLen));
- ExFreePool( NewBuf );
+ ExFreePoolWithTag(NewBuf, TAG_AFD_WSA_BUFFER);
_SEH2_YIELD(return NULL);
} _SEH2_END;
AFD_DbgPrint(MIN_TRACE,("Failed to lock pages\n"));
IoFreeMdl( MapBuf[i].Mdl );
MapBuf[i].Mdl = NULL;
- ExFreePool( NewBuf );
+ ExFreePoolWithTag(NewBuf, TAG_AFD_WSA_BUFFER);
return NULL;
}
} else {
- ExFreePool( NewBuf );
+ ExFreePoolWithTag(NewBuf, TAG_AFD_WSA_BUFFER);
return NULL;
}
}
}
}
- ExFreePool( Buf );
+ ExFreePoolWithTag(Buf, TAG_AFD_WSA_BUFFER);
Buf = NULL;
}
UINT i;
NTSTATUS Status = STATUS_SUCCESS;
- PAFD_HANDLE FileObjects = ExAllocatePool
- ( NonPagedPool, HandleCount * sizeof(AFD_HANDLE) );
+ PAFD_HANDLE FileObjects = ExAllocatePoolWithTag(NonPagedPool,
+ HandleCount * sizeof(AFD_HANDLE),
+ TAG_AFD_POLL_HANDLE);
for( i = 0; FileObjects && i < HandleCount; i++ ) {
FileObjects[i].Status = 0;
ObDereferenceObject( (PVOID)HandleArray[i].Handle );
}
- ExFreePool( HandleArray );
+ ExFreePoolWithTag(HandleArray, TAG_AFD_POLL_HANDLE);
HandleArray = NULL;
}