ExAllocateFromZone

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.

Parameters

Zone
Points to the zone header that controls the storage from which the entry is to be allocated.

Return Value

ExAllocateFromZone returns a pointer to the entry if it can be allocated.

Comments

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.

See Also

ExAllocatePool, ExExtendZone, ExInitializeNPagedLookasideList, ExInitializePagedLookasideList, ExInitializeZone, ExFreeToZone, ExIsFullZone