ExFreeToNPagedLookasideList function

The ExFreeToNPagedLookasideList routine returns a nonpaged entry to the given lookaside list or to nonpaged pool.

Syntax

void ExFreeToNPagedLookasideList(
  PNPAGED_LOOKASIDE_LIST   Lookaside,
  __drv_freesMem(Mem)PVOID Entry
);

Parameters

Lookaside

A pointer to the NPAGED_LOOKASIDE_LIST structure for the lookaside list, which the caller already initialized with ExInitializeNPagedLookasideList.

Entry

A pointer to the entry to be freed. The caller obtained this pointer from a preceding call to ExAllocateFromNPagedLookasideList.

Return Value

None

Remarks

ExFreeToNPagedLookasideList is the reciprocal of ExAllocateFromNPagedLookasideList. It releases a caller-allocated entry back to the caller's lookaside list or to nonpaged pool when that entry is no longer in use.

The same entry can be reallocated or another entry allocated later with a subsequent call to ExAllocateFromNPagedLookasideList. The user of the lookaside list can allocate and free such entries dynamically on an as-needed basis until it calls ExDeleteNPagedLookasideList, which releases any outstanding entries in the list before it clears the system state for the given lookaside list and returns control.

If the specified lookaside list has not yet reached the system-determined maximum number of entries, ExFreeToNPagedLookasideList inserts the given entry at the front of the list. Otherwise, the buffer at Entry is released to nonpaged pool using the caller-supplied Free routine, if any, that was set up when the lookaside list was initialized or ExFreePool.

For more information, see Using Lookaside Lists.

Requirements

   
Windows version Available starting with Windows 2000.
Target Platform Desktop
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "<= DISPATCH_LEVEL"
DDI compliance rules SpIrql

See Also

ExAllocateFromNPagedLookasideList

ExDeleteNPagedLookasideList

ExInitializeNPagedLookasideList

NPAGED_LOOKASIDE_LIST