PVOID
ExAllocateFromZone(
IN PZONE_HEADER Zone
);
ExAllocateFromZone removes an entry from the free list for a given zone and returns a pointer to the entry.
ExAllocateFromZone returns a pointer to the entry if it can be allocated.
Consider using a lookaside list instead of a zone. Lookaside lists are more efficient and are easier to manage.
Callers of ExAllocateFromZone must be running at IRQL <= DISPATCH_LEVEL.
ExIsFullZone should be called immediately preceding a call to ExAllocateFromZone to be sure that a free entry is available. Allocate additional temporary memory with ExAllocatePool if neccesary.
ExAllocatePool, ExExtendZone, ExInitializeNPagedLookasideList, ExInitializePagedLookasideList, ExInitializeZone, ExFreeToZone, ExIsFullZone