Previous Next

ExAllocateFromNPagedLookasideList

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

PVOID 
  ExAllocateFromNPagedLookasideList(
    IN PNPAGED_LOOKASIDE_LIST  Lookaside
    );

Parameters

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

Return Value

ExAllocateFromNPagedLookasideList 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, ExAllocateFromNPagedLookasideList removes the first entry from the list and returns a pointer to this entry. Otherwise, ExAllocateFromNPagedLookasideList 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. For example, a driver might use each such fixed-size entry to set up command blocks, like SCSI SRBs, to peripheral devices on a particular type of I/O bus. The caller should release each entry with ExFreeToNPagedLookasideList when it is no longer in use.

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

See Also

ExInitializeNPagedLookasideList, ExAllocateFromPagedLookasideList, ExFreeToNPagedLookasideList