The FreeNetBufferListForwardingContext function releases resources in the out-of-band (OOB) extensible switch forwarding context of a NET_BUFFER_LIST structure. This data was used for send or receive operations in a Hyper-V extensible switch, and was previously allocated by calling the AllocateNetBufferListForwardingContext function.



void NdisSwitchFreeNetBufferListForwardingContext(
  [in]      NDIS_SWITCH_CONTEXT NdisSwitchContext,
  [in, out] PNET_BUFFER_LIST NetBufferList


[in] NdisSwitchContext

An NDIS_SWITCH_CONTEXT value that contains the handle of the extensible switch module to which the Hyper-V extensible switch extension is attached. When the extension calls NdisFGetOptionalSwitchHandlers, this handle is returned through the NdisSwitchContext parameter.

[in, out] NetBufferList

A pointer to a linked list of NET_BUFFER_LIST structures.

Note  This structure must contain an extensible switch forwarding context that was previously allocated by calling the AllocateNetBufferListForwardingContext function.

Return value

If the call succeeds, the function returns NDIS_STATUS_SUCCESS. Otherwise, it returns an NDIS_STATUS_Xxx error code that is defined in Ndis.h.


The extensible switch extension can originate packet send operations within the extensible switch data path. For example, the extension can send packets to any port on the extensible switch. For more information about this data path, see Hyper-V Extensible Switch Data Path.

If the extensible switch extension originates a packet send operation, the extension must call the AllocateNetBufferListForwardingContext function. This function allocates and initializes the forwarding context for the specified NET_BUFFER_LIST structure. For more information about this context, see Hyper-V Extensible Switch Forwarding Context.

When the send operation is complete, the extension must call the FreeNetBufferListForwardingContext function to deallocate the forwarding context.

Note  The extension must call the FreeNetBufferListForwardingContext function when the send operation is completed. The extension must do this regardless of whether it adds the packet's NET_BUFFER_LIST structure to a lookaside list or calls NdisFreeNetBufferList to return the structure to a pool.
For more information on how to originate send operations, see Filter Module Send and Receive Operations.
Note  If the NetBufferList parameter contains a pointer to a linked-list of multiple NET_BUFFER_LIST structures, only the first NET_BUFFER_LIST structure in the list has its forwarding context deallocated.


Requirement Value
Minimum supported client Supported in NDIS 6.30 and later.
Target Platform Desktop
Header ndis.h (include Ndis.h)

See also