ExAllocateFromNPagedLookasideList

PVOID
    ExAllocateFromNPagedLookasideList(

        IN PNPAGED_LOOKASIDE_LIST  Lookaside
        );

ExAllocateFromNPagedLookasideList removes the first entry from the specified lookaside list in nonpaged memory. If the lookaside list is empty, an entry is allocated from nonpaged pool.

Parameters

Lookaside
Points to the header of the lookaside list from which the entry will be allocated.

Return Value

ExAllocateFromNPagedLookasideList returns a pointer to an entry if one can be allocated; otherwise it returns NULL.

Comments

If the lookaside list is not empty, ExAllocateFromNPagedLookasideList removes the first entry from the list and returns its address to the caller. If the lookaside list is empty, ExAllocateFromNPagedLookasideList calls the allocate routine specified at list initialization to allocate another entry from nonpaged pool and returns its address to the caller. If no custom allocate routine was specified, this routine calls ExAllocatePoolWithTag. If the allocate routine cannot allocate an entry, ExAllocateFromNPagedLookasideList returns NULL.

Callers of ExAllocateFromNPagedLookasideList must be running at IRQL <= DISPATCH_LEVEL.

See Also

ExInitializeNPagedLookasideList, ExFreeToNPagedLookasideList