Expand Minimize

ExAllocateFromLookasideListEx routine

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(
  _Inout_  PLOOKASIDE_LIST_EX Lookaside
);

Parameters

Lookaside [in, out]

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

Version

Available in Windows Vista and later versions of Windows.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

See also

ExFreeToLookasideListEx
ExInitializeLookasideListEx
LookasideListAllocateEx
LOOKASIDE_LIST_EX

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft