NdisAllocateCloneNetBufferList function

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

Syntax


PNET_BUFFER_LIST NdisAllocateCloneNetBufferList(
  _In_      PNET_BUFFER_LIST OriginalNetBufferList,
  _In_opt_  NDIS_HANDLE NetBufferListPoolHandle,
  _In_opt_  NDIS_HANDLE NetBufferPoolHandle,
  _In_      ULONG AllocateCloneFlags
);

Parameters

OriginalNetBufferList [in]

A pointer to an existing NET_BUFFER_LIST structure.

NetBufferListPoolHandle [in, optional]

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

NetBufferPoolHandle [in, optional]

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

AllocateCloneFlags [in]

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

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

Irql_NetBuffer_Function

See also

NdisAllocateNetBufferListPool
NdisAllocateNetBufferPool
NdisFreeCloneNetBufferList
NET_BUFFER
NET_BUFFER_LIST
NET_BUFFER_LIST_CONTEXT

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft