Bewerken

Delen via


PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE callback function (ndis.h)

The ProtocolSendNetBufferListsComplete function completes a send operation that the protocol driver initiated with a call to the NdisSendNetBufferLists function.

Note  You must declare the function by using the PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE type. For more information, see the following Examples section.
 

Syntax

PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE ProtocolSendNetBufferListsComplete;

void ProtocolSendNetBufferListsComplete(
  [in] NDIS_HANDLE ProtocolBindingContext,
  [in] PNET_BUFFER_LIST NetBufferList,
  [in] ULONG SendCompleteFlags
)
{...}

Parameters

[in] ProtocolBindingContext

A handle to a context area that the protocol driver allocated to maintain state information about a binding. This handle was passed to NDIS in a previous call to NdisOpenAdapterEx.

[in] NetBufferList

A pointer to a list of NET_BUFFER_LIST structures that the protocol driver supplied in a previous call to NdisSendNetBufferLists.

[in] SendCompleteFlags

NDIS flags that can be combined with an OR operation. To clear all the flags, set this member to zero. This function supports the NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL flag which; if set, indicates that the current IRQL is DISPATCH_LEVEL. For more information about this flag, see Dispatch IRQL Tracking.

Return value

None

Remarks

ProtocolSendNetBufferListsComplete is a required function for protocol drivers. ProtocolSendNetBufferListsComplete performs whatever postprocessing is necessary to complete a send operation. For example, the protocol driver can notify the clients that requested the protocol to send the network data that the send operation is complete.

NDIS calls ProtocolSendNetBufferListsComplete after the underlying miniport driver calls the NdisMSendNetBufferListsComplete function. Completion of a send operation usually implies that the underlying miniport driver has transmitted the specified network data. However, a miniport driver can indicate that a send operation has completed as soon as it transfers the network data to its NIC.

When NDIS calls ProtocolSendNetBufferListsComplete, the protocol driver regains ownership of all of the resources associated with the NET_BUFFER_LIST structures that are specified by the NetBufferLists parameter.

NDIS always submits protocol-supplied network data to the underlying miniport driver in the protocol-determined order as passed to NdisSendNetBufferLists. However, the underlying driver can complete the send requests in any order. That is, protocol drivers can rely on NDIS to submit network data in FIFO order to the underlying driver. However, protocol drivers cannot rely on the underlying driver to call NdisMSendNetBufferListsComplete in the same order.

NDIS calls ProtocolSendNetBufferListsComplete at IRQL<= DISPATCH_LEVEL.

Examples

To define a ProtocolSendNetBufferListsComplete function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of function types for drivers. Declaring a function using the function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define a ProtocolSendNetBufferListsComplete function that is named "MySendNetBufferListsComplete", use the PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE type as shown in this code example:

PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE MySendNetBufferListsComplete;

Then, implement your function as follows:

_Use_decl_annotations_
VOID
 MySendNetBufferListsComplete(
    NDIS_HANDLE  ProtocolBindingContext,
    PNET_BUFFER_LIST  NetBufferLists,
    ULONG  SendCompleteFlags
    )
  {...}

The PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE function type is defined in the Ndis.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the Use_decl_annotations annotation to your function definition. The Use_decl_annotations annotation ensures that the annotations that are applied to the PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers.

For information about Use_decl_annotations, see Annotating Function Behavior.

Requirements

Requirement Value
Minimum supported client Supported in NDIS 6.0 and later.
Target Platform Windows
Header ndis.h (include Ndis.h)
IRQL <= DISPATCH_LEVEL

See also

NET_BUFFER

NET_BUFFER_LIST

NdisMSendNetBufferListsComplete

NdisOpenAdapterEx

NdisSendNetBufferLists