NdisAllocateFromNPagedLookasideList (NDIS 5.1) function
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisAllocateFromNPagedLookasideList removes the first entry from the given lookaside list head. If the lookaside list currently is empty, an entry is allocated from nonpaged pool.
- Lookaside [in]
Pointer to the head of the lookaside list from which the entry will be allocated. The caller already initialized the list head with NdisInitializeNPagedLookasideList.
NdisAllocateFromNPagedLookasideList returns a pointer to an entry if one can be removed from the lookaside list or allocated; otherwise, it returns NULL.
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 an nonpaged entry.
All entries allocated from a nonpaged lookaside list are of a fixed size, specified when the driver originally called NdisInitializeNPagedLookasideList. Consequently, a lookaside list is particularly 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 NdisFreeToNPagedLookasideList as each VC is torn down.