Compartilhar via


NdisAllocateCloneNetBufferList (Compact 2013)

3/26/2014

Call this function to create a new clone NET_BUFFER_LIST structure.

Syntax

PNET_BUFFER_LIST
  NdisAllocateCloneNetBufferList(
    IN PNET_BUFFER_LIST  OriginalNetBufferList,
    IN NDIS_HANDLE  NetBufferListPoolHandle OPTIONAL,
    IN NDIS_HANDLE  NetBufferPoolHandle OPTIONAL,
    IN ULONG  AllocateCloneFlags
    );

Parameters

  • OriginalNetBufferList
    A pointer to an existing NET_BUFFER_LIST structure.
  • NetBufferListPoolHandle
    A handle that was obtained from a call to the NdisAllocateNetBufferListPool function.
  • NetBufferPoolHandle
    A NET_BUFFER structure pool handle that was previously returned from a call to NdisAllocateNetBufferPool.
  • AllocateCloneFlags
    NDIS flags that can be combined with an OR operation. The following flags are defined:

    • NDIS_CLONE_FLAGS_RESERVED
      Reserved for NDIS.
    • NDIS_CLONE_FLAGS_USE_ORIGINAL_MDLS
      If this flag is set, NDIS does not allocate new MDLs for the cloned NET_BUFFER_LIST. Instead, the cloned NET_BUFFER_LIST uses the same MDL chain as the original NET_BUFFER_LIST. If NDIS_CLONE_FLAGS_USE_ORIGINAL_MDLS is cleared, NDIS allocates new MDLs to reference the original data buffers.

Return Value

NdisAllocateCloneNetBufferList returns a pointer to the new clone NET_BUFFER_LIST structure. If the allocation was unsuccessful, this pointer is NULL.

Remarks

Call NdisAllocateCloneNetBufferList to create a clone NET_BUFFER_LIST structure that you can use to send duplicate data on a separate data path.

If the cloned NET_BUFFER_LIST structure should have attributes that are associated with a given pool, the caller must specify the pool handle in the NetBufferListPoolHandle or NetBufferPoolHandle parameter. For example, the ProtocolType member of the NET_BUFFER_LIST structure is associated with the pool.

The clone NET_BUFFER_LIST structure describes the same data that is described by the NET_BUFFER_LIST structure at OriginalNetBufferList. NDIS does not copy the data that is described by the original MDLs to new data buffers. Instead, the cloned structures reference the original data buffers. The clone NET_BUFFER_LIST structure does not include an initial NET_BUFFER_LIST_CONTEXT structure.

Call the NdisFreeCloneNetBufferList function to free a NET_BUFFER_LIST structure and all the associated structures and MDL chains that were allocated by calling NdisAllocateCloneNetBufferList.

Requirements

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NdisAllocateNetBufferListPool
NdisAllocateNetBufferPool
NdisFreeCloneNetBufferList
NET_BUFFER
NET_BUFFER_LIST
NET_BUFFER_LIST_CONTEXT