Previous Next

ExAllocateFromPagedLookasideList

The ExAllocateFromPagedLookasideList routine returns a pointer to a paged entry from the given lookaside list, or it returns a pointer to a newly allocated paged entry.

PVOID 
  ExAllocateFromPagedLookasideList(
    IN PPAGED_LOOKASIDE_LIST  Lookaside
    );

Parameters

Lookaside
Pointer to the resident head of the lookaside list, which the caller already initialized with ExInitializePagedLookasideList.

Return Value

ExAllocateFromPagedLookasideList returns a pointer to an entry if one can be allocated. Otherwise, it returns NULL.

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

If the given lookaside list is not empty, ExAllocateFromPagedLookasideList removes the first entry from the list and returns a pointer to this entry. Otherwise, ExAllocateFromPagedLookasideList either calls the Allocate routine specified at list initialization or ExAllocatePoolWithTag to return an entry pointer.

The caller can then set up the returned entry with any caller-determined data. Because the entries in a paged lookaside list are allocated from pageable memory, access to these entries must not cause a page fault. Consequently, the user of a paged lookaside list must ensure that each such entry cannot be accessed from an arbitrary thread context or at raised IRQL. The caller should release each entry with ExFreeToPagedLookasideList when it is no longer in use.

Callers of ExAllocateFromPagedLookasideList must be running at IRQL < DISPATCH_LEVEL.

See Also

ExInitializePagedLookasideList, ExFreeToPagedLookasideList