ExAllocateFromLookasideListEx function

The ExAllocateFromLookasideListEx routine removes the first entry from the specified lookaside list, or, if the list is empty, dynamically allocates the storage for a new entry.

Syntax

PVOID ExAllocateFromLookasideListEx(
  PLOOKASIDE_LIST_EX Lookaside
);

Parameters

Lookaside

A pointer to a LOOKASIDE_LIST_EX structure that describes a lookaside list. This structure was previously initialized by the ExInitializeLookasideListEx routine.

Return Value

ExAllocateFromLookasideListEx returns a pointer to a lookaside-list entry, if an entry is available in the list or can be dynamically allocated. Otherwise, this routine returns NULL.

Remarks

This routine removes the first entry, if an entry is available, from the specified lookaside list and returns a pointer to this entry. If the list is empty, the routine allocates storage for a new entry and returns a pointer to this entry. If this allocation fails, the routine returns NULL.

If the lookaside list is empty, ExAllocateFromLookasideListEx calls the LookasideListAllocateEx routine to allocate storage for a new entry, if the driver has provided such a routine. Otherwise, a default allocation routine is used to allocate the entry.

After the caller finishes using the entry, it should free the entry by calling the ExFreeToLookasideListEx routine.

In the current implementation, a lookaside list operates as a last-in, first-out (LIFO) stack. Thus, the last entry to be freed (and pushed onto the stack) is the next entry to be allocated (popped) from the list.

For more information about lookaside lists, see Using Lookaside Lists.

Requirements

   
Windows version Available in Windows Vista and later versions of Windows.
Target Platform Desktop
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "<= DISPATCH_LEVEL"

See Also

ExFreeToLookasideListEx

ExInitializeLookasideListEx

LOOKASIDE_LIST_EX

LookasideListAllocateEx