src/SeLow/SeLow.c
// NDIS packet transmission completion notification procedure

NDIS packet transmission completion notification procedure
NDIS packet transmission completion notification procedure
void SlNdisSendNetBufferListsCompleteProc(NDIS_HANDLE protocol_binding_context, NET_BUFFER_LIST *net_buffer_lists,
										  ULONG send_complete_flags)
{
	NET_BUFFER_LIST *nbl;
	nbl = net_buffer_lists;
	while (nbl != NULL)
	{
		NET_BUFFER_LIST *current_nbl = nbl;
		SL_FILE *f;
		NET_BUFFER *nb = NET_BUFFER_LIST_FIRST_NB(nbl);
		if (nb != NULL)
		{
			UINT size = NET_BUFFER_DATA_LENGTH(nb);
			NdisAdvanceNetBufferDataStart(nb, size, false, NULL);
		}
		f = ((void **)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl))[0];
		nbl = NET_BUFFER_LIST_NEXT_NBL(nbl);
		NET_BUFFER_LIST_NEXT_NBL(current_nbl) = NULL;
		NdisFreeNetBufferList(current_nbl);
		InterlockedExchangeAdd(&f->NumSendingPackets, (LONG)-1);
		InterlockedExchangeAdd(&f->Adapter->NumPendingSendPackets, (LONG)-1);
	}
}
void SlNdisSendNetBufferListsCompleteProc ( NDIS_HANDLE protocol_binding_context , NET_BUFFER_LIST * net_buffer_lists , ULONG send_complete_flags ) { NET_BUFFER_LIST * nbl ; nbl = net_buffer_lists ; while ( nbl != NULL ) { NET_BUFFER_LIST * current_nbl = nbl ; SL_FILE * f ; NET_BUFFER * nb = NET_BUFFER_LIST_FIRST_NB ( nbl ) ; if ( nb != NULL ) { UINT size = NET_BUFFER_DATA_LENGTH ( nb ) ; NdisAdvanceNetBufferDataStart ( nb , size , false , NULL ) ; } f = ( ( void * * ) NET_BUFFER_LIST_CONTEXT_DATA_START ( nbl ) ) [ 0 ] ; nbl = NET_BUFFER_LIST_NEXT_NBL ( nbl ) ; NET_BUFFER_LIST_NEXT_NBL ( current_nbl ) = NULL ; NdisFreeNetBufferList ( current_nbl ) ; InterlockedExchangeAdd ( & f -> NumSendingPackets , ( LONG ) - 1 ) ; InterlockedExchangeAdd ( & f -> Adapter -> NumPendingSendPackets , ( LONG ) - 1 ) ; } }
NDIS packet transmission completion notification procedure
NDIS packet transmission completion notification procedure
// Get a file context
 // Release the NET_BUFFER_LIST
 // Reduce the number of packets being sent by 1
