NdisAllocateCloneNetBufferList function (ndis/nblapi.h)

Call the NdisAllocateCloneNetBufferList function to create a new clone NET_BUFFER_LIST structure.

Syntax

NDIS_EXPORTED_ROUTINE NET_BUFFER_LIST * NdisAllocateCloneNetBufferList(
  [in]           NET_BUFFER_LIST *OriginalNetBufferList,
  [in, optional] NDIS_HANDLE     NetBufferListPoolHandle,
  [in, optional] NDIS_HANDLE     NetBufferPoolHandle,
  [in]           ULONG           AllocateCloneFlags
);

Parameters

[in] OriginalNetBufferList

A pointer to an existing NET_BUFFER_LIST structure.

[in, optional] NetBufferListPoolHandle

A handle that was obtained from a call to the NdisAllocateNetBufferListPool function.

[in, optional] NetBufferPoolHandle

A NET_BUFFER structure pool handle that was previously returned from a call to NdisAllocateNetBufferPool.

[in] 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.

Each NET_BUFFER structure in the original NET_BUFFER_LIST structure is only cloned from the start of the used data space, not the start of the entire data space. To get the offset from the beginning of the data space to the start of the used data space, use the NET_BUFFER_DATA_OFFSET macro.

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 of the associated structures and MDL chains that were allocated by calling NdisAllocateCloneNetBufferList.

Requirements

Requirement Value
Minimum supported client Supported in NDIS 6.0 and later.
Target Platform Universal
Header ndis/nblapi.h (include ndis.h)
Library Ndis.lib
IRQL <= DISPATCH_LEVEL
DDI compliance rules Irql_NetBuffer_Function(ndis), NdisAllocateCloneNetBufferList(ndis), NdisAllocateCloneNetBufferList_InitFail(ndis)

See also

NET_BUFFER

NET_BUFFER_LIST

NET_BUFFER_LIST_CONTEXT

NdisAllocateNetBufferListPool

NdisAllocateNetBufferPool

NdisFreeCloneNetBufferList