Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining

NdisAllocateFragmentNetBufferList function

Call the NdisAllocateFragmentNetBufferList function to create a new fragmented NET_BUFFER_LIST structure based upon the data in an existing NET_BUFFER_LIST structure.


PNET_BUFFER_LIST NdisAllocateFragmentNetBufferList(
  _In_     PNET_BUFFER_LIST OriginalNetBufferList,
  _In_opt_ NDIS_HANDLE      NetBufferListPoolHandle,
  _In_opt_ NDIS_HANDLE      NetBufferPoolHandle,
  _In_     ULONG            StartOffset,
  _In_     ULONG            MaximumLength,
  _In_     ULONG            DataOffsetDelta,
  _In_     ULONG            DataBackFill,
  _In_     ULONG            AllocateFragmentFlags


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.

StartOffset [in]

An additional byte offset from the start of the data in each NET_BUFFER structure. This offset is in addition to the value of the DataOffset member specified in each NET_BUFFER structure.

MaximumLength [in]

The maximum length, in bytes, for each fragment in the new NET_BUFFER_LIST structure. Each fragment is described by a NET_BUFFER structure.

DataOffsetDelta [in]

The additional amount of used data space that NDIS should make available in the new NET_BUFFER structures.

DataBackFill [in]

The amount of data space in addition to the value of the DataOffsetDelta parameter to allocate if allocation is necessary. If NDIS must allocate memory to supply the data space requested in DataOffsetDelta, it should also allocate the additional space that DataBackFill specifies.

AllocateFragmentFlags [in]

NDIS flags that can be combined with an OR operation. Set this parameter to zero. There are currently no flags defined for this function.

Return value

NdisAllocateFragmentNetBufferList returns a pointer to a new fragmented NET_BUFFER_LIST structure. If the allocation failed, the return value is NULL.


NdisAllocateFragmentNetBufferList allocates and initializes a new fragment NET_BUFFER_LIST structure and NET_BUFFER structures that describe the same data that is described by the NET_BUFFER_LIST structure that the caller passed to NdisAllocateFragmentNetBufferList.

If the fragment 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.

For each NET_BUFFER structure in the specified source NET_BUFFER_LIST structure, NDIS creates the fragment NET_BUFFER structures as follows:

  • NDIS creates the fragments starting from the beginning of the used data space in the source NET_BUFFER structure and offset by the value specified in the StartOffset parameter.

  • NDIS divides the used data space(after accounting for the StartOffset ) in the source NET_BUFFER structure into fragments.

  • The length of the used data space of each fragment is less than or equal to the value specified in the MaximumLength parameter. The used data space of the last fragment can be less than MaximumLength .

  • Each fragment is described by a new NET_BUFFER structure and a new set of MDL chains.

  • The data offset of the new NET_BUFFER structures is retreated (the value of the DataOffset member is reduced) by the number of bytes specified in the DataOffsetDelta parameter.

  • If NDIS must allocate memory to supply the data space requested in DataOffsetDelta, it should also allocate the additional space that DataBackFill specifies.

The new fragment NET_BUFFER_LIST structure that NdisAllocateFragmentNetBufferList creates does not include an initial NET_BUFFER_LIST_CONTEXT structure.

Call the NdisFreeFragmentNetBufferList function to free a NET_BUFFER_LIST structure and all associated NET_BUFFER structures and MDL chains that were previously allocated by calling NdisAllocateFragmentNetBufferList.


Target platform



Supported in NDIS 6.0 and later.


Ndis.h (include Ndis.h)



DDI compliance rules


See also




Send comments about this topic to Microsoft

© 2015 Microsoft