NdisAllocateFromNPagedLookasideList (Compact 2013)

3/26/2014

This function removes the first entry from the given lookaside list head. If the lookaside list currently is empty, an entry is allocated from nonpaged pool.

Syntax

PVOID  NdisAllocateFromNPagedLookasideList(
  IN PNPAGED_LOOKASIDE_LIST Lookaside
);

Parameters

  • Lookaside
    A pointer to the head of the lookaside list from which the entry will be allocated. The caller already initialized the list head with the NdisInitializeNPagedLookasideList function.

Return Value

NdisAllocateFromNPagedLookasideList returns a pointer to an entry if one can be removed from the lookaside list or allocated; otherwise, it returns NULL.

Remarks

If the lookaside list is not empty, NdisAllocateFromNPagedLookasideList removes the first entry from the list and returns its address to the caller. If the lookaside list is empty, NdisAllocateFromNPagedLookasideList either calls the Allocate function that the caller specified at list initialization, if any, or it allocates an entry on behalf of the caller. NdisAllocateFromNPagedLookasideList returns NULL if the caller-supplied **Allocate****function, if any, or if this function itself cannot allocate a nonpaged entry.

All entries allocated from a nonpaged lookaside list are of a fixed size, specified when the driver originally called NdisInitializeNPagedLookasideList. Therefore, a lookaside list is especially useful to drivers that must allocate fixed-size blocks in which to maintain state in response to dynamic I/O demand. For example, any connection-oriented NDIS driver might allocate the VC context areas it needs from a lookaside list as VCs are created and release each such entry back to the lookaside list with NdisInitializeNPagedLookasideListas each VC is torn down.

Requirements

Header

ndis.h

Library

ndis.lib

See Also

Reference

NDIS Lookaside Lists Interface
NdisFreeToNPagedLookasideList
NdisInitializeNPagedLookasideList
NdisDeleteNPagedLookasideList