Partager via


NdisInitializeNPagedLookasideList (Windows CE 5.0)

Send Feedback

NdisInitializeNPagedLookasideList initializes a lookaside list. After a successful initialization, nonpaged fixed-size blocks can be allocated from and freed to the lookaside list.

VOID  NdisInitializeNPagedLookasideList(  IN  PNPAGED_LOOKASIDE_LISTLookaside,  IN  PALLOCATE_FUNCTION Allocate OPTIONAL,  IN  PFREE_FUNCTION Free OPTIONAL,  IN  ULONG Flags,  IN  ULONG Size,  IN  ULONG Tag,  IN  USHORT Depth);

Parameters

  • Lookaside
    Pointer to the caller-supplied lookaside list head to be initialized. The driver must provide a list head that is resident — that is, in nonpaged system space.
  • Allocate
    Either is NULL or specifies the entry point of a caller-supplied function that will allocate an entry of the specified Size whenever it is called. If Allocate is NULL, NdisAllocateFromNPagedLookasideList subsequently allocates entries on behalf of the caller. If the caller provides an Allocate function, it also must provide a Free function.
  • Free
    Either is NULL or specifies the entry point of a caller-supplied function that will free an entry of the specified Size whenever it is called. If Free is NULL, NdisFreeToNPagedLookasideList subsequently frees entries on behalf of the caller.
  • Flags
    Must be zero. This parameter is reserved for system use.
  • Size
    Specifies the size in bytes of each entry to be subsequently allocated from the lookaside list.
  • Tag
    Specifies a caller-supplied pool tag for lookaside list entries. The Tag is a string of four characters delimited by single quote marks (for example, 'derF'). The characters are usually specified in reverse order so they are easier to read when dumping pool or tracking pool usage in the debugger.
  • Depth
    Must be zero. This parameter is also reserved for system use.

Return Values

None.

Remarks

NdisInitializeNPagedLookasideList initializes the caller-supplied list head but allocates no memory for list entries. The initial entries are allocated on an as-needed basis either with calls to NdisAllocateFromNPagedLookasideList or by the driver-supplied Allocate callback. The list becomes populated as the driver frees entries back to the list with NdisFreeToNPagedLookasideList. Entries collect on the list until a system-determined but dynamically sized limit is reached. Then, any surplus entries in the lookaside list are returned to nonpaged pool, either by NdisFreeToNPagedLookasideList or with calls to the driver-supplied Free callback.

All entries in the lookaside list are of the same size, which is specified when the driver called NdisInitializeNPagedLookasideList. A lookaside list is particularly useful to drivers that must dynamically allocate and free fixed-size context areas in which to maintain run-time state about their outstanding I/O operations. For instance, connection-oriented NDIS drivers are likely to find lookaside lists particularly useful because such drivers usually maintain a dynamic set of context areas to track outgoing and incoming calls.

It is more efficient for a driver to allow the NdisAllocate/Free..LookasideList functions manage the allocation and deallocation of entries. However, a driver that tracks state internally about its memory usage might supply Allocate and Free functions to NdisInitializeNPagedLookasideList.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.lib

See Also

NdisAllocateFromNPagedLookasideList | NdisFreeToNPagedLookasideList | NdisDeleteNPagedLookasideList

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.