Reassembled NET_BUFFER_LIST Structures
An NDIS driver can create a reassembled NET_BUFFER_LIST structure from an existing NET_BUFFER_LIST structure. The reassembled structure references the original data from multiple source NET_BUFFER structures. Drivers can use this type of structure to efficiently combine many smaller buffers into a single large buffer.
The following figure shows the relationship between a parent NET_BUFFER_LIST structure and a reassembled child structure:
The preceding figure contains a parent NET_BUFFER_LIST structure and a child structure that was derived from that parent. The parent structure has one NET_BUFFER_LIST_CONTEXT structure and three NET_BUFFER structures with MDLs attached. The parent structure's parent pointer is NULL indicating that it is not a derived structure.
The child NET_BUFFER_LIST structure has one NET_BUFFER structure with MDLs attached. The child NET_BUFFER_LIST structure has a pointer to the parent structure. The NULL where a NET_BUFFER_LIST_CONTEXT structure pointer would be indicates that the child has no NET_BUFFER_LIST_CONTEXT structure.
NDIS drivers call the NdisAllocateReassembledNetBufferList function to reassemble a fragmented NET_BUFFER_LIST structure. NDIS allocates a new NET_BUFFER structure and MDLs with the reassembled NET_BUFFER_LIST structure. NDIS does not allocate a NET_BUFFER_LIST_CONTEXT structure for the reassembled structure. The reassembled NET_BUFFER structure and MDLs describe the same data as does the parent structure. The data is not copied.
To create the reassembled NET_BUFFER_LIST structure, NdisAllocateReassembledNetBufferList skips over the number of bytes specified in the StartOffset parameter in each of the parent NET_BUFFER structures. NdisAllocateReassembledNetBufferList concatenates the remaining data in each parent NET_BUFFER structure into the MDL chain of one reassembled NET_BUFFER structure. NdisAllocateReassembledNetBufferList retreats (increases the used data space in) the reassembled NET_BUFFER structure by the amount specified in DataOffsetDelta .
NDIS drivers call the NdisFreeReassembledNetBufferList function to free a reassembled NET_BUFFER_LIST structure and the associated NET_BUFFER structure and MDL chain.